|
| 1 | +<div class="activity-log-page"> |
| 2 | + <p-card class="activity-log-header-card"> |
| 3 | + <div class="activity-log-header"> |
| 4 | + <div class="activity-log-header__title"> |
| 5 | + <h2>Activity Log</h2> |
| 6 | + <p>Global audit feed for project and task events across the workspace.</p> |
| 7 | + </div> |
| 8 | + |
| 9 | + <div class="activity-log-header__meta"> |
| 10 | + <span class="meta-pill"> |
| 11 | + <i class="pi pi-bolt"></i> |
| 12 | + {{ isLiveConnected ? 'Live connected' : 'Live disconnected' }} |
| 13 | + </span> |
| 14 | + <span class="meta-pill" *ngIf="isPreviewMode"> |
| 15 | + <i class="pi pi-eye"></i> |
| 16 | + Preview mode |
| 17 | + </span> |
| 18 | + <span class="meta-pill" *ngIf="previewDetail">{{ previewDetail }}</span> |
| 19 | + </div> |
| 20 | + </div> |
| 21 | + </p-card> |
| 22 | + |
| 23 | + <div class="activity-log-kpis"> |
| 24 | + <p-card class="kpi-card"><span class="kpi-card__label">Total Events</span><span class="kpi-card__value">{{ totalEvents }}</span></p-card> |
| 25 | + <p-card class="kpi-card"><span class="kpi-card__label">Visible Events</span><span class="kpi-card__value">{{ visibleEvents }}</span></p-card> |
| 26 | + <p-card class="kpi-card"><span class="kpi-card__label">Today</span><span class="kpi-card__value">{{ todayEvents }}</span></p-card> |
| 27 | + <p-card class="kpi-card"><span class="kpi-card__label">Project Events</span><span class="kpi-card__value">{{ projectEvents }}</span></p-card> |
| 28 | + </div> |
| 29 | + |
| 30 | + <p-card class="activity-log-table-card"> |
| 31 | + <div class="activity-log-inline-error" *ngIf="errorMessage"> |
| 32 | + <i class="pi pi-exclamation-triangle"></i> |
| 33 | + {{ errorMessage }} |
| 34 | + </div> |
| 35 | + |
| 36 | + <p-table |
| 37 | + #dt |
| 38 | + [value]="filteredRows" |
| 39 | + [loading]="isLoading" |
| 40 | + [rowHover]="true" |
| 41 | + [paginator]="true" |
| 42 | + [rows]="15" |
| 43 | + [rowsPerPageOptions]="[15, 30, 60]" |
| 44 | + [tableStyle]="{ 'min-width': '72rem' }" |
| 45 | + [globalFilterFields]="['actorDisplayName', 'projectName', 'taskTitle', 'typeLabel', 'entityType']" |
| 46 | + (onFilter)="onTableFilter($event)"> |
| 47 | + <ng-template pTemplate="caption"> |
| 48 | + <div class="table-caption"> |
| 49 | + <button pButton type="button" icon="pi pi-filter-slash" label="Clear Filters" class="p-button-text" (click)="clearFilters(dt)"></button> |
| 50 | + <button pButton type="button" icon="pi pi-upload" label="Export CSV" class="p-button-text" (click)="exportCsv(dt)"></button> |
| 51 | + |
| 52 | + <div class="caption-date-filters"> |
| 53 | + <p-calendar |
| 54 | + [(ngModel)]="dateFrom" |
| 55 | + [showIcon]="true" |
| 56 | + [appendTo]="'body'" |
| 57 | + dateFormat="yy-mm-dd" |
| 58 | + placeholder="From" |
| 59 | + (onSelect)="onDateRangeChanged(dt)" |
| 60 | + (onClearClick)="onDateRangeChanged(dt)"> |
| 61 | + </p-calendar> |
| 62 | + |
| 63 | + <p-calendar |
| 64 | + [(ngModel)]="dateTo" |
| 65 | + [showIcon]="true" |
| 66 | + [appendTo]="'body'" |
| 67 | + dateFormat="yy-mm-dd" |
| 68 | + placeholder="To" |
| 69 | + (onSelect)="onDateRangeChanged(dt)" |
| 70 | + (onClearClick)="onDateRangeChanged(dt)"> |
| 71 | + </p-calendar> |
| 72 | + </div> |
| 73 | + |
| 74 | + <span class="table-search"> |
| 75 | + <i class="pi pi-search"></i> |
| 76 | + <input pInputText type="text" [(ngModel)]="tableSearch" (input)="onGlobalFilter(dt, $event)" placeholder="Search activity..." /> |
| 77 | + </span> |
| 78 | + </div> |
| 79 | + </ng-template> |
| 80 | + |
| 81 | + <ng-template pTemplate="header"> |
| 82 | + <tr> |
| 83 | + <th style="min-width: 12rem;"> |
| 84 | + <div class="column-head"> |
| 85 | + Actor |
| 86 | + <p-columnFilter type="text" field="actorDisplayName" display="menu"></p-columnFilter> |
| 87 | + </div> |
| 88 | + </th> |
| 89 | + <th style="min-width: 9rem;"> |
| 90 | + <div class="column-head"> |
| 91 | + Entity |
| 92 | + <p-columnFilter field="entityType" matchMode="equals" display="menu" [showMatchModes]="false" [showOperator]="false" [showAddButton]="false"> |
| 93 | + <ng-template pTemplate="filter" let-value let-filter="filterCallback"> |
| 94 | + <p-dropdown |
| 95 | + [options]="entityTypeOptions" |
| 96 | + optionLabel="label" |
| 97 | + optionValue="value" |
| 98 | + [ngModel]="value" |
| 99 | + [appendTo]="'body'" |
| 100 | + [showClear]="false" |
| 101 | + placeholder="Entity" |
| 102 | + (onChange)="filter($event.value)"> |
| 103 | + </p-dropdown> |
| 104 | + </ng-template> |
| 105 | + </p-columnFilter> |
| 106 | + </div> |
| 107 | + </th> |
| 108 | + <th style="min-width: 14rem;"> |
| 109 | + <div class="column-head"> |
| 110 | + Event Type |
| 111 | + <p-columnFilter field="type" matchMode="equals" display="menu" [showMatchModes]="false" [showOperator]="false" [showAddButton]="false"> |
| 112 | + <ng-template pTemplate="filter" let-value let-filter="filterCallback"> |
| 113 | + <p-dropdown |
| 114 | + [options]="typeOptions" |
| 115 | + optionLabel="label" |
| 116 | + optionValue="value" |
| 117 | + [ngModel]="value" |
| 118 | + [appendTo]="'body'" |
| 119 | + [showClear]="false" |
| 120 | + placeholder="Type" |
| 121 | + (onChange)="filter($event.value)"> |
| 122 | + </p-dropdown> |
| 123 | + </ng-template> |
| 124 | + </p-columnFilter> |
| 125 | + </div> |
| 126 | + </th> |
| 127 | + <th style="min-width: 14rem;"> |
| 128 | + <div class="column-head"> |
| 129 | + Project |
| 130 | + <p-columnFilter type="text" field="projectName" display="menu"></p-columnFilter> |
| 131 | + </div> |
| 132 | + </th> |
| 133 | + <th style="min-width: 16rem;">Task</th> |
| 134 | + <th style="min-width: 12rem;">Occurred At</th> |
| 135 | + </tr> |
| 136 | + </ng-template> |
| 137 | + |
| 138 | + <ng-template pTemplate="body" let-row> |
| 139 | + <tr> |
| 140 | + <td>{{ row.actorDisplayName || '-' }}</td> |
| 141 | + <td> |
| 142 | + <p-tag [value]="row.entityType" [severity]="row.entityType === 'Project' ? 'info' : 'contrast'"></p-tag> |
| 143 | + </td> |
| 144 | + <td>{{ row.typeLabel }}</td> |
| 145 | + <td>{{ row.projectName || '-' }}</td> |
| 146 | + <td>{{ row.taskTitle || '-' }}</td> |
| 147 | + <td>{{ row.occurredAtDate | date:'MMM d, y, h:mm a' }}</td> |
| 148 | + </tr> |
| 149 | + </ng-template> |
| 150 | + |
| 151 | + <ng-template pTemplate="emptymessage"> |
| 152 | + <tr> |
| 153 | + <td colspan="6" class="empty-cell"> |
| 154 | + <div class="empty-state"> |
| 155 | + <i class="pi pi-history"></i> |
| 156 | + <p>No activity found for current filters.</p> |
| 157 | + </div> |
| 158 | + </td> |
| 159 | + </tr> |
| 160 | + </ng-template> |
| 161 | + </p-table> |
| 162 | + </p-card> |
| 163 | +</div> |
0 commit comments