|
| 1 | +@if (audits.totalElements === 0) { |
| 2 | + <div>{{ 'audit.data.not-found' | translate }}</div> |
| 3 | +} @else { |
| 4 | + <ds-pagination |
| 5 | + [paginationOptions]="pageConfig" |
| 6 | + [collectionSize]="audits?.totalElements" |
| 7 | + [hideGear]="true" |
| 8 | + [hidePagerWhenSinglePage]="true"> |
| 9 | + <div class="table-responsive"> |
| 10 | + <table class="table table-striped table-hover"> |
| 11 | + <thead> |
| 12 | + <tr> |
| 13 | + <th>{{ 'audit.overview.table.entityType' | translate }}</th> |
| 14 | + <th>{{ 'audit.overview.table.eperson' | translate }}</th> |
| 15 | + <th>{{ 'audit.overview.table.timestamp' | translate }}</th> |
| 16 | + @if (isOverviewPage) { |
| 17 | + <th>{{ 'audit.overview.table.subjectUUID' | translate }}</th> |
| 18 | + <th>{{ 'audit.overview.table.subjectType' | translate }}</th> |
| 19 | + <th>{{ 'audit.overview.table.objectUUID' | translate }}</th> |
| 20 | + <th>{{ 'audit.overview.table.objectType' | translate }}</th> |
| 21 | + } @else { |
| 22 | + <th>{{ 'audit.overview.table.other' | translate }}</th> |
| 23 | + } |
| 24 | + </tr> |
| 25 | + </thead> |
| 26 | + <tbody> |
| 27 | + @for (audit of audits?.page; track audit) { |
| 28 | + <tr> |
| 29 | + <td> |
| 30 | + @if (audit.hasDetails) { |
| 31 | + <div role="button" class="d-flex align-items-center" (click)="toggleCollapse(audit)"> |
| 32 | + <div class="btn btn-link p-1 mr-1"> |
| 33 | + @if (audit.isCollapsed) { |
| 34 | + <i class="fas fa-caret-right"></i> |
| 35 | + } @else { |
| 36 | + <i class="fas fa-caret-down"></i> |
| 37 | + } |
| 38 | + </div> |
| 39 | + <div> |
| 40 | + {{ audit.eventType }} |
| 41 | + </div> |
| 42 | + </div> |
| 43 | + } @else { |
| 44 | + <div class="ml-4"> |
| 45 | + {{ audit.eventType }} |
| 46 | + </div> |
| 47 | + } |
| 48 | + </td> |
| 49 | + <td>{{ audit.epersonName }}</td> |
| 50 | + <td>{{ audit.timeStamp | date:dateFormat:'UTC' }}</td> |
| 51 | + @if (isOverviewPage) { |
| 52 | + <td> |
| 53 | + @if (audit.objectUUID) { |
| 54 | + <ng-container *ngVar="(getObjectRoute$(audit.objectUUID) | async) as objectRoute"> |
| 55 | + @if (objectRoute !== ('/' + auditPath)) { |
| 56 | + <a [routerLink]="[objectRoute]">{{audit.objectUUID}}</a> |
| 57 | + } @else { |
| 58 | + <span>{{audit.objectUUID}}</span> |
| 59 | + } |
| 60 | + </ng-container> |
| 61 | + } |
| 62 | + </td> |
| 63 | + <td>{{ audit.objectType }}</td> |
| 64 | + <td> |
| 65 | + @if (audit.subjectUUID) { |
| 66 | + <ng-container *ngVar="(getObjectRoute$(audit.subjectUUID) | async) as subjectRoute"> |
| 67 | + @if (subjectRoute !== ('/' + auditPath)) { |
| 68 | + <a [routerLink]="[subjectRoute]">{{audit.subjectUUID}}</a> |
| 69 | + } @else { |
| 70 | + <span>{{audit.subjectUUID}}</span> |
| 71 | + } |
| 72 | + </ng-container> |
| 73 | + } |
| 74 | + </td> |
| 75 | + <td>{{ audit.subjectType }}</td> |
| 76 | + } @else { |
| 77 | + <td> |
| 78 | + <span> |
| 79 | + @if (audit.otherAuditObject; as dso) { |
| 80 | + {{ getDsoName(dso) }} <em>({{ dso.type }})</em> |
| 81 | + } @else { |
| 82 | + {{ 'audit.data.self' | translate}} |
| 83 | + } |
| 84 | + </span> |
| 85 | + </td> |
| 86 | + } |
| 87 | + </tr> |
| 88 | + @if (audit.hasDetails) { |
| 89 | + <tr [(ngbCollapse)]="audit.isCollapsed" [id]="audit.id" [ngClass]="{'border-top-0': !audit.isCollapsed}" class="w-100 nested-row"> |
| 90 | + @if (isOverviewPage) { |
| 91 | + <td colspan="7" class="border-top-0"> |
| 92 | + <ng-container *ngTemplateOutlet="auditInto; context: { audit }"></ng-container> |
| 93 | + </td> |
| 94 | + } @else { |
| 95 | + <td colspan="4" class="border-top-0"> |
| 96 | + <ng-container *ngTemplateOutlet="auditInto; context: { audit }"></ng-container> |
| 97 | + </td> |
| 98 | + } |
| 99 | + </tr> |
| 100 | + } |
| 101 | + } |
| 102 | + </tbody> |
| 103 | + </table> |
| 104 | + </div> |
| 105 | + </ds-pagination> |
| 106 | +} |
| 107 | + |
| 108 | +<ng-template #auditInto let-audit=audit> |
| 109 | + <div class="w-100"> |
| 110 | + <div class="d-flex flex-column mw-100 w-100"> |
| 111 | + @if (audit.metadataField) { |
| 112 | + <div class="d-flex mb-1"> |
| 113 | + <small class="font-weight-bold me-2" >{{"audit.detail.metadata.field" | translate}}</small> |
| 114 | + <small>{{ audit.metadataField | dsStringReplace: "_":"." }}</small> |
| 115 | + </div> |
| 116 | + } |
| 117 | + @if (audit.value) { |
| 118 | + <div class="d-flex mb-1"> |
| 119 | + <small class="font-weight-bold me-2">{{"audit.detail.metadata.value" | translate}}</small> |
| 120 | + <small class="content dont-break-out preserve-line-breaks"> |
| 121 | + {{ audit.value }} |
| 122 | + </small> |
| 123 | + </div> |
| 124 | + } |
| 125 | + @if (audit.authority) { |
| 126 | + <div class="d-flex mb-1"> |
| 127 | + <small class="font-weight-bold me-2">{{"audit.detail.metadata.authority" | translate}}</small> |
| 128 | + <small>{{ audit.authority }}</small> |
| 129 | + </div> |
| 130 | + } |
| 131 | + @if (audit.confidence !== null) { |
| 132 | + <div class="d-flex mb-1"> |
| 133 | + <small class="font-weight-bold me-2">{{"audit.detail.metadata.confidence" | translate}}</small> |
| 134 | + <small>{{ audit.confidence }}</small> |
| 135 | + </div> |
| 136 | + } |
| 137 | + @if (audit.place !== null) { |
| 138 | + <div class="d-flex mb-1"> |
| 139 | + <small class="font-weight-bold me-2">{{"audit.detail.metadata.place" | translate}}</small> |
| 140 | + <small>{{ audit.place }}</small> |
| 141 | + </div> |
| 142 | + } |
| 143 | + @if (audit.action) { |
| 144 | + <div class="d-flex mb-1"> |
| 145 | + <small class="font-weight-bold me-2">{{"audit.detail.metadata.action" | translate}}</small> |
| 146 | + <small>{{ audit.action }}</small> |
| 147 | + </div> |
| 148 | + } |
| 149 | + @if (audit.checksum) { |
| 150 | + <div class="d-flex"> |
| 151 | + <small class="font-weight-bold me-2">{{"audit.detail.metadata.checksum" | translate}}</small> |
| 152 | + <small>{{ audit.checksum }}</small> |
| 153 | + </div> |
| 154 | + } |
| 155 | + </div> |
| 156 | + </div> |
| 157 | +</ng-template> |
0 commit comments