first commit
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
<app-page-header [eyebrow]="'routers.eyebrow' | translate" [title]="'routers.title' | translate" [subtitle]="'routers.subtitle' | translate">
|
||||
<div header-actions class="header-actions-row">
|
||||
<button pButton type="button" icon="pi pi-plus" (click)="openCreate()" [label]="'routers.add' | translate"></button>
|
||||
</div>
|
||||
</app-page-header>
|
||||
|
||||
<div class="inline-summary inline-summary--soft">
|
||||
<div class="inline-summary__item">
|
||||
<strong>{{ routers.length }}</strong>
|
||||
<span>{{ 'routers.registeredDevices' | translate }}</span>
|
||||
</div>
|
||||
<div class="inline-summary__divider"></div>
|
||||
<div class="inline-summary__item">
|
||||
<strong>{{ keyCount }}</strong>
|
||||
<span>{{ 'routers.summaryKeyAccess' | translate }}</span>
|
||||
</div>
|
||||
<div class="inline-summary__divider"></div>
|
||||
<div class="inline-summary__item">
|
||||
<strong>{{ passwordCount }}</strong>
|
||||
<span>{{ 'routers.summaryPasswordAccess' | translate }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<app-section-card [title]="'routers.listTitle' | translate" [subtitle]="'routers.listSubtitle' | translate">
|
||||
<p-table [value]="routers" responsiveLayout="scroll" styleClass="app-table">
|
||||
<ng-template pTemplate="header">
|
||||
<tr><th>{{ 'routers.name' | translate }}</th><th>{{ 'routers.endpoint' | translate }}</th><th>{{ 'routers.access' | translate }}</th><th>{{ 'common.actions' | translate }}</th></tr>
|
||||
</ng-template>
|
||||
<ng-template pTemplate="body" let-routerItem>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="table-primary">{{ routerItem.name }}</div>
|
||||
<small class="table-secondary">{{ 'routers.routerOsTarget' | translate }}</small>
|
||||
</td>
|
||||
<td>
|
||||
<div class="table-primary">{{ routerItem.host }}:{{ routerItem.port }}</div>
|
||||
<small class="table-secondary">{{ routerItem.ssh_user }}</small>
|
||||
</td>
|
||||
<td>
|
||||
<div class="inline-tags">
|
||||
<p-tag [value]="routerItem.ssh_password ? ('routers.passwordMode' | translate) : ('routers.noPassword' | translate)" [severity]="routerItem.ssh_password ? 'warning' : 'secondary'"></p-tag>
|
||||
<p-tag [value]="routerItem.ssh_key ? ('routers.keyMode' | translate) : ('routers.noKey' | translate)" [severity]="routerItem.ssh_key ? 'success' : 'secondary'"></p-tag>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="table-actions table-actions--labels">
|
||||
<button pButton type="button" size="small" styleClass="table-action-btn table-action-btn--wide" icon="pi pi-arrow-right" [label]="'common.open' | translate" (click)="open(routerItem.id)"></button>
|
||||
<button pButton type="button" size="small" styleClass="table-action-btn table-action-btn--wide" severity="secondary" icon="pi pi-pencil" [label]="'common.edit' | translate" (click)="edit(routerItem)"></button>
|
||||
<button pButton type="button" size="small" styleClass="table-action-btn table-action-btn--wide" severity="danger" icon="pi pi-trash" [label]="'common.delete' | translate" (click)="remove(routerItem.id)"></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</ng-template>
|
||||
</p-table>
|
||||
</app-section-card>
|
||||
|
||||
<p-dialog [(visible)]="visible" [modal]="true" [header]="dialogTitle" [style]="{ width: '640px' }" styleClass="router-dialog">
|
||||
<form [formGroup]="form" (ngSubmit)="save()" class="form-grid-2">
|
||||
<span class="form-field">
|
||||
<label>{{ 'routers.name' | translate }}</label>
|
||||
<input pInputText formControlName="name" placeholder="core-router-waw" />
|
||||
</span>
|
||||
<span class="form-field">
|
||||
<label>{{ 'routers.host' | translate }}</label>
|
||||
<input pInputText formControlName="host" placeholder="10.0.0.1" />
|
||||
</span>
|
||||
<span class="form-field">
|
||||
<label>{{ 'routers.port' | translate }}</label>
|
||||
<input pInputText type="number" formControlName="port" placeholder="22" />
|
||||
</span>
|
||||
<span class="form-field">
|
||||
<label>{{ 'routers.sshUser' | translate }}</label>
|
||||
<input pInputText formControlName="ssh_user" placeholder="admin" />
|
||||
</span>
|
||||
<span class="form-field form-field--full">
|
||||
<label>{{ 'routers.sshPassword' | translate }}</label>
|
||||
<input pInputText formControlName="ssh_password" [placeholder]="'routers.optionalPassword' | translate" />
|
||||
</span>
|
||||
<span class="form-field form-field--full">
|
||||
<label>{{ 'routers.sshPrivateKey' | translate }}</label>
|
||||
<textarea pInputTextarea formControlName="ssh_key" rows="7" [placeholder]="'routers.optionalPrivateKey' | translate"></textarea>
|
||||
</span>
|
||||
<div class="dialog-actions">
|
||||
<button pButton type="button" severity="secondary" [label]="'common.cancel' | translate" (click)="visible=false"></button>
|
||||
<button pButton type="submit" [disabled]="form.invalid || saving" [loading]="saving" [label]="'routers.saveRouter' | translate"></button>
|
||||
</div>
|
||||
</form>
|
||||
</p-dialog>
|
||||
Reference in New Issue
Block a user