More webapp changes+fixes
This commit is contained in:
@@ -15,6 +15,19 @@
|
||||
<span nz-icon nzType="edit"></span>
|
||||
Edit
|
||||
</button>
|
||||
@if (expertMode()) {
|
||||
<button
|
||||
nz-button
|
||||
nzDanger
|
||||
nz-popconfirm
|
||||
nzPopconfirmTitle="Are you sure you want to delete this channel? All messages and subscriptions will be lost."
|
||||
(nzOnConfirm)="deleteChannel()"
|
||||
[nzLoading]="deleting()"
|
||||
>
|
||||
<span nz-icon nzType="delete"></span>
|
||||
Delete
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -152,28 +165,76 @@
|
||||
<th>Subscriber</th>
|
||||
<th nzWidth="0">Status</th>
|
||||
<th nzWidth="0">Created</th>
|
||||
<th nzWidth="0">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (sub of subscriptions(); track sub.subscription_id) {
|
||||
<tr>
|
||||
<tr class="clickable-row">
|
||||
<td>
|
||||
<div class="cell-name">{{ getUserDisplayName(sub.subscriber_user_id) }}</div>
|
||||
<div class="cell-id mono">{{ sub.subscriber_user_id }}</div>
|
||||
<a class="cell-link" [routerLink]="['/subscriptions', sub.subscription_id]">
|
||||
<div class="cell-name">{{ getUserDisplayName(sub.subscriber_user_id) }}</div>
|
||||
<div class="cell-id mono">{{ sub.subscriber_user_id }}</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<nz-tag [nzColor]="sub.confirmed ? 'green' : 'orange'">
|
||||
{{ sub.confirmed ? 'Confirmed' : 'Pending' }}
|
||||
</nz-tag>
|
||||
<a class="cell-link" [routerLink]="['/subscriptions', sub.subscription_id]">
|
||||
<nz-tag [nzColor]="sub.confirmed ? 'green' : 'orange'">
|
||||
{{ sub.confirmed ? 'Confirmed' : 'Pending' }}
|
||||
</nz-tag>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<div class="timestamp-absolute">{{ sub.timestamp_created | date:'yyyy-MM-dd HH:mm:ss' }}</div>
|
||||
<div class="timestamp-relative">{{ sub.timestamp_created | relativeTime }}</div>
|
||||
<a class="cell-link" [routerLink]="['/subscriptions', sub.subscription_id]">
|
||||
<div class="timestamp-absolute">{{ sub.timestamp_created | date:'yyyy-MM-dd HH:mm:ss' }}</div>
|
||||
<div class="timestamp-relative">{{ sub.timestamp_created | relativeTime }}</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<div class="action-buttons">
|
||||
@if (!sub.confirmed) {
|
||||
<button
|
||||
nz-button
|
||||
nzSize="small"
|
||||
nzType="primary"
|
||||
nz-tooltip
|
||||
nzTooltipTitle="Accept"
|
||||
(click)="acceptSubscription(sub)"
|
||||
>
|
||||
<span nz-icon nzType="check"></span>
|
||||
</button>
|
||||
<button
|
||||
nz-button
|
||||
nzSize="small"
|
||||
nzDanger
|
||||
nz-tooltip
|
||||
nzTooltipTitle="Deny"
|
||||
nz-popconfirm
|
||||
nzPopconfirmTitle="Deny this subscription request?"
|
||||
(nzOnConfirm)="denySubscription(sub)"
|
||||
>
|
||||
<span nz-icon nzType="close"></span>
|
||||
</button>
|
||||
} @else {
|
||||
<button
|
||||
nz-button
|
||||
nzSize="small"
|
||||
nzDanger
|
||||
nz-tooltip
|
||||
nzTooltipTitle="Revoke"
|
||||
nz-popconfirm
|
||||
nzPopconfirmTitle="Revoke this subscription?"
|
||||
(nzOnConfirm)="revokeSubscription(sub)"
|
||||
>
|
||||
<span nz-icon nzType="delete"></span>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
} @empty {
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<td colspan="4">
|
||||
<nz-empty nzNotFoundContent="No subscriptions"></nz-empty>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -182,6 +243,84 @@
|
||||
</nz-table>
|
||||
</nz-card>
|
||||
}
|
||||
|
||||
<nz-card nzTitle="Messages" class="mt-16">
|
||||
<nz-table
|
||||
#messageTable
|
||||
[nzData]="messages()"
|
||||
[nzLoading]="loadingMessages()"
|
||||
[nzShowPagination]="false"
|
||||
[nzNoResult]="noMessagesResultTpl"
|
||||
nzSize="small"
|
||||
>
|
||||
<ng-template #noMessagesResultTpl></ng-template>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<th>Content</th>
|
||||
<th nzWidth="0">Sender</th>
|
||||
<th nzWidth="0">Priority</th>
|
||||
<th nzWidth="0">Time</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (message of messages(); track message.message_id) {
|
||||
<tr class="clickable-row">
|
||||
<td>
|
||||
<a class="cell-link" [routerLink]="['/messages', message.message_id]">
|
||||
<div class="message-title">{{ message.title }}</div>
|
||||
<div class="message-id mono">{{ message.message_id }}</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="cell-link" [routerLink]="['/messages', message.message_id]">
|
||||
@if (message.content) {
|
||||
<div class="message-content">{{ message.content | slice:0:128 }}{{ message.content.length > 128 ? '...' : '' }}</div>
|
||||
} @else {
|
||||
<span class="text-muted"></span>
|
||||
}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="cell-link" [routerLink]="['/messages', message.message_id]">
|
||||
<span style="white-space: pre">{{ message.sender_name || '-' }}</span>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="cell-link" [routerLink]="['/messages', message.message_id]">
|
||||
<nz-tag [nzColor]="getPriorityColor(message.priority)">
|
||||
{{ getPriorityLabel(message.priority) }}
|
||||
</nz-tag>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="cell-link" [routerLink]="['/messages', message.message_id]">
|
||||
<div class="timestamp-absolute">{{ message.timestamp | date:'yyyy-MM-dd HH:mm:ss' }}</div>
|
||||
<div class="timestamp-relative">{{ message.timestamp | relativeTime }}</div>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
} @empty {
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<nz-empty nzNotFoundContent="No messages"></nz-empty>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</nz-table>
|
||||
@if (messagesTotalCount() > messagesPageSize) {
|
||||
<div class="pagination-controls">
|
||||
<nz-pagination
|
||||
[nzPageIndex]="messagesCurrentPage()"
|
||||
[nzPageSize]="messagesPageSize"
|
||||
[nzTotal]="messagesTotalCount()"
|
||||
[nzDisabled]="loadingMessages()"
|
||||
(nzPageIndexChange)="messagesGoToPage($event)"
|
||||
></nz-pagination>
|
||||
</div>
|
||||
}
|
||||
</nz-card>
|
||||
} @else {
|
||||
<nz-card>
|
||||
<div class="not-found">
|
||||
|
||||
Reference in New Issue
Block a user