add admin interface, angular migration
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
<header>
|
||||
<h3>{{'admin.quotas' | i18n}}@if (selectedUsername) { - {{selectedUsername}}}</h3>
|
||||
<span class="spacer"></span>
|
||||
@if (selectedUsername) {
|
||||
<button mat-raised-button color="primary" (click)="createQuota()">
|
||||
<mat-icon>add</mat-icon>
|
||||
{{'admin.quotas.create' | i18n}}
|
||||
</button>
|
||||
}
|
||||
</header>
|
||||
|
||||
@if (loading) {
|
||||
<mat-progress-bar mode="indeterminate"></mat-progress-bar>
|
||||
}
|
||||
|
||||
@if (selectedUsername) {
|
||||
<div>
|
||||
|
||||
@if (quotas.length > 0) {
|
||||
<div class="mat-elevation-z8">
|
||||
<table mat-table [dataSource]="quotas">
|
||||
|
||||
<ng-container matColumnDef="id">
|
||||
<th mat-header-cell *matHeaderCellDef> {{'admin.quotas.id' | i18n}} </th>
|
||||
<td mat-cell *matCellDef="let quota"> {{quota.id}} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="name">
|
||||
<th mat-header-cell *matHeaderCellDef> {{'admin.quotas.name' | i18n}} </th>
|
||||
<td mat-cell *matCellDef="let quota"> {{quota.name}} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="value">
|
||||
<th mat-header-cell *matHeaderCellDef> {{'admin.quotas.value' | i18n}} </th>
|
||||
<td mat-cell *matCellDef="let quota"> {{quota.value}} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="unit">
|
||||
<th mat-header-cell *matHeaderCellDef> {{'admin.quotas.unit' | i18n}} </th>
|
||||
<td mat-cell *matCellDef="let quota"> {{quota.unit || '-'}} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="disposable">
|
||||
<th mat-header-cell *matHeaderCellDef> {{'admin.quotas.disposable' | i18n}} </th>
|
||||
<td mat-cell *matCellDef="let quota">
|
||||
@if (quota.disposable) {
|
||||
<mat-icon>check</mat-icon>
|
||||
}
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="actions">
|
||||
<th mat-header-cell *matHeaderCellDef> {{'admin.actions' | i18n}} </th>
|
||||
<td mat-cell *matCellDef="let quota">
|
||||
<button mat-icon-button (click)="editQuota(quota)" [title]="'admin.quotas.edit' | i18n">
|
||||
<mat-icon>edit</mat-icon>
|
||||
</button>
|
||||
<button mat-icon-button (click)="deleteQuota(quota)" [title]="'admin.quotas.delete' | i18n">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!loading && quotas.length === 0) {
|
||||
<p style="text-align: center; margin-top: 20px;">{{'admin.quotas.no_quotas' | i18n}}</p>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
Reference in New Issue
Block a user