That's better, make it a simple list
This commit is contained in:
parent
be8a91942b
commit
a680c6e385
@ -14,53 +14,38 @@
|
|||||||
@for (entry of entries; track entry.id) {
|
@for (entry of entries; track entry.id) {
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<div>
|
<ng-template #timestamp>
|
||||||
<ng-template #timestamp>
|
<div class="text-light">
|
||||||
<div class="text-light">
|
{{ entry.timestamp | customDate:'longDate' }} {{ entry.timestamp | date:'shortTime' }}
|
||||||
{{ entry.timestamp | customDate:'longDate' }} {{ entry.timestamp | date:'shortTime' }}
|
</div>
|
||||||
</div>
|
</ng-template>
|
||||||
</ng-template>
|
<span class="text-muted" [ngbTooltip]="timestamp">{{ entry.timestamp | customDate:'relative' }}</span>
|
||||||
<span [ngbTooltip]="timestamp">{{ entry.timestamp | customDate:'relative' }}</span>
|
@if (entry.actor) {
|
||||||
@if (entry.actor) {
|
<span class="ms-3 fst-italic">{{ entry.actor.username }}</span>
|
||||||
<span class="ms-3 fst-italic">{{ entry.actor.username }}</span>
|
} @else {
|
||||||
} @else {
|
<span class="ms-3 fst-italic">System</span>
|
||||||
<span class="ms-3 fst-italic">System</span>
|
}
|
||||||
}
|
<span class="badge bg-secondary ms-auto" [class.bg-primary]="entry.action === AuditLogAction.Create">{{ entry.action | titlecase }}</span>
|
||||||
<span class="badge bg-secondary ms-3">{{ entry.action | titlecase }}</span>
|
|
||||||
</div>
|
|
||||||
<button type="button" class="ml-auto btn btn-link" (click)="toggleEntry(entry)">
|
|
||||||
<i-bs class="me-2" name="info-circle"></i-bs>
|
|
||||||
<ng-container i18n>Details</ng-container>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
<div #collapse="ngbCollapse" [ngbCollapse]="!openEntries.has(entry.id)">
|
@if (entry.action === AuditLogAction.Update) {
|
||||||
<table class="table table-borderless m-0 ms-2">
|
<ul class="mt-2">
|
||||||
<thead>
|
@for (change of entry.changes | keyvalue; track change.key) {
|
||||||
<tr>
|
@if (change.value["type"] === 'm2m') {
|
||||||
<th i18n>Field</th>
|
<li>
|
||||||
<th i18n>Change</th>
|
<span class="fst-italic" i18n>{{ change.value["operation"] | titlecase }}</span>
|
||||||
</tr>
|
<span class="text-light">{{ change.key | titlecase }}</span>:
|
||||||
<tbody>
|
<code class="text-primary">{{ change.value["objects"].join(', ') }}</code>
|
||||||
@for (change of entry.changes | keyvalue; track change.key) {
|
</li>
|
||||||
@if (change.value["type"] === 'm2m') {
|
|
||||||
<tr>
|
|
||||||
<td>{{ change.key | titlecase }}:</td>
|
|
||||||
<td>
|
|
||||||
{{ change.value["operation"] | titlecase }}
|
|
||||||
<span class="fst-italic">{{ change.value["objects"].join(', ') }}</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
}
|
|
||||||
@else {
|
|
||||||
<tr>
|
|
||||||
<td>{{ change.key | titlecase }}:</td>
|
|
||||||
<td>{{ change.value[1] }}</td>
|
|
||||||
</tr>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</tbody>
|
@else {
|
||||||
</table>
|
<li>
|
||||||
</div>
|
<span class="text-light">{{ change.key | titlecase }}</span>:
|
||||||
|
<code class="text-primary">{{ change.value[1] }}</code>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
}
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Component, Input, OnInit } from '@angular/core'
|
import { Component, Input, OnInit } from '@angular/core'
|
||||||
import { AuditLogEntry } from 'src/app/data/auditlog-entry'
|
import { AuditLogAction, AuditLogEntry } from 'src/app/data/auditlog-entry'
|
||||||
import { DocumentService } from 'src/app/services/rest/document.service'
|
import { DocumentService } from 'src/app/services/rest/document.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -8,7 +8,9 @@ import { DocumentService } from 'src/app/services/rest/document.service'
|
|||||||
styleUrl: './audit-log.component.scss',
|
styleUrl: './audit-log.component.scss',
|
||||||
})
|
})
|
||||||
export class AuditLogComponent implements OnInit {
|
export class AuditLogComponent implements OnInit {
|
||||||
_documentId: number
|
public AuditLogAction = AuditLogAction
|
||||||
|
|
||||||
|
private _documentId: number
|
||||||
@Input()
|
@Input()
|
||||||
set documentId(id: number) {
|
set documentId(id: number) {
|
||||||
this._documentId = id
|
this._documentId = id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user