More webapp changes+fixes
This commit is contained in:
@@ -9,18 +9,20 @@
|
||||
<span nz-icon nzType="arrow-left" nzTheme="outline"></span>
|
||||
Back to Clients
|
||||
</button>
|
||||
<div class="header-actions">
|
||||
<button
|
||||
nz-button
|
||||
nzDanger
|
||||
nz-popconfirm
|
||||
nzPopconfirmTitle="Are you sure you want to delete this client?"
|
||||
(nzOnConfirm)="deleteClient()"
|
||||
>
|
||||
<span nz-icon nzType="delete"></span>
|
||||
Delete
|
||||
</button>
|
||||
</div>
|
||||
@if (expertMode()) {
|
||||
<div class="header-actions">
|
||||
<button
|
||||
nz-button
|
||||
nzDanger
|
||||
nz-popconfirm
|
||||
nzPopconfirmTitle="Are you sure you want to delete this client?"
|
||||
(nzOnConfirm)="deleteClient()"
|
||||
>
|
||||
<span nz-icon nzType="delete"></span>
|
||||
Delete
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<nz-card>
|
||||
|
||||
@@ -59,9 +59,11 @@
|
||||
.timestamp-absolute {
|
||||
font-size: 13px;
|
||||
color: #333;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.timestamp-relative {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
|
||||
import { ApiService } from '../../../core/services/api.service';
|
||||
import { AuthService } from '../../../core/services/auth.service';
|
||||
import { NotificationService } from '../../../core/services/notification.service';
|
||||
import { SettingsService } from '../../../core/services/settings.service';
|
||||
import { Client, ClientType, getClientTypeIcon } from '../../../core/models';
|
||||
import { RelativeTimePipe } from '../../../shared/pipes/relative-time.pipe';
|
||||
import { MetadataGridComponent, MetadataValueComponent } from '../../../shared/components/metadata-grid';
|
||||
@@ -41,9 +42,11 @@ export class ClientDetailComponent implements OnInit {
|
||||
private apiService = inject(ApiService);
|
||||
private authService = inject(AuthService);
|
||||
private notification = inject(NotificationService);
|
||||
private settingsService = inject(SettingsService);
|
||||
|
||||
client = signal<Client | null>(null);
|
||||
loading = signal(true);
|
||||
expertMode = this.settingsService.expertMode;
|
||||
|
||||
ngOnInit(): void {
|
||||
const clientId = this.route.snapshot.paramMap.get('id');
|
||||
|
||||
@@ -28,31 +28,41 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (client of clients(); track client.client_id) {
|
||||
<tr class="clickable-row" (click)="openClient(client.client_id)">
|
||||
<tr class="clickable-row">
|
||||
<td>
|
||||
<span
|
||||
nz-icon
|
||||
[nzType]="getClientIcon(client.type)"
|
||||
nzTheme="outline"
|
||||
class="client-icon"
|
||||
></span>
|
||||
<a class="cell-link" [routerLink]="['/clients', client.client_id]">
|
||||
<span
|
||||
nz-icon
|
||||
[nzType]="getClientIcon(client.type)"
|
||||
nzTheme="outline"
|
||||
class="client-icon"
|
||||
></span>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<div class="client-name">{{ client.name || '-' }}</div>
|
||||
<div class="client-id mono">{{ client.client_id }}</div>
|
||||
<a class="cell-link" [routerLink]="['/clients', client.client_id]">
|
||||
<div class="client-name">{{ client.name || '-' }}</div>
|
||||
<div class="client-id mono">{{ client.client_id }}</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<nz-tag>{{ getClientTypeLabel(client.type) }}</nz-tag>
|
||||
<a class="cell-link" [routerLink]="['/clients', client.client_id]">
|
||||
<nz-tag>{{ getClientTypeLabel(client.type) }}</nz-tag>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<div class="agent-info">
|
||||
<span>{{ client.agent_model }}</span>
|
||||
<span class="agent-version">v{{ client.agent_version }}</span>
|
||||
</div>
|
||||
<a class="cell-link" [routerLink]="['/clients', client.client_id]">
|
||||
<div class="agent-info">
|
||||
<span style="white-space: pre;">{{ client.agent_model }}</span>
|
||||
<span style="white-space: pre;" class="agent-version">v{{ client.agent_version }}</span>
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<div class="timestamp-absolute">{{ client.timestamp_created | date:'yyyy-MM-dd HH:mm:ss' }}</div>
|
||||
<div class="timestamp-relative">{{ client.timestamp_created | relativeTime }}</div>
|
||||
<a class="cell-link" [routerLink]="['/clients', client.client_id]">
|
||||
<div class="timestamp-absolute">{{ client.timestamp_created | date:'yyyy-MM-dd HH:mm:ss' }}</div>
|
||||
<div class="timestamp-relative">{{ client.timestamp_created | relativeTime }}</div>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
} @empty {
|
||||
|
||||
@@ -46,9 +46,11 @@
|
||||
.timestamp-absolute {
|
||||
font-size: 13px;
|
||||
color: #333;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.timestamp-relative {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, inject, signal, OnInit } from '@angular/core';
|
||||
import { CommonModule, DatePipe } from '@angular/common';
|
||||
import { Router } from '@angular/router';
|
||||
import { Router, RouterLink } from '@angular/router';
|
||||
import { NzTableModule } from 'ng-zorro-antd/table';
|
||||
import { NzButtonModule } from 'ng-zorro-antd/button';
|
||||
import { NzIconModule } from 'ng-zorro-antd/icon';
|
||||
@@ -19,6 +19,7 @@ import { RelativeTimePipe } from '../../../shared/pipes/relative-time.pipe';
|
||||
imports: [
|
||||
CommonModule,
|
||||
DatePipe,
|
||||
RouterLink,
|
||||
NzTableModule,
|
||||
NzButtonModule,
|
||||
NzIconModule,
|
||||
|
||||
Reference in New Issue
Block a user