2020-08-25 08:16:11 +02:00
|
|
|
<rb-icon-button icon="add" mode="primary" (click)="newModel = !newModel; oldModelGroup = ''" class="space-below">
|
|
|
|
New model
|
|
|
|
</rb-icon-button>
|
2020-08-20 10:42:02 +02:00
|
|
|
|
|
|
|
<form *ngIf="newModel" #modelForm="ngForm">
|
|
|
|
<rb-form-input name="group" label="group" appValidate="string" required [(ngModel)]="modelGroup" #groupInput="ngModel"
|
|
|
|
[rbFormInputAutocomplete]="autocomplete.bind(this, groups)"
|
|
|
|
[rbDebounceTime]="0" [rbInitialOpen]="true">
|
|
|
|
<ng-template rbFormValidationMessage="failure">{{groupInput.errors.failure}}</ng-template>
|
|
|
|
<ng-template rbFormValidationMessage="required">Cannot be empty</ng-template>
|
|
|
|
</rb-form-input>
|
|
|
|
<rb-form-input name="name" label="name" appValidate="string" required [(ngModel)]="model.name" #nameInput="ngModel">
|
|
|
|
<ng-template rbFormValidationMessage="failure">{{nameInput.errors.failure}}</ng-template>
|
|
|
|
<ng-template rbFormValidationMessage="required">Cannot be empty</ng-template>
|
|
|
|
</rb-form-input>
|
|
|
|
<rb-form-input name="url" label="URL" appValidate="url" required [(ngModel)]="model.url" #urlInput="ngModel">
|
|
|
|
<ng-template rbFormValidationMessage="failure">{{urlInput.errors.failure}}</ng-template>
|
|
|
|
<ng-template rbFormValidationMessage="required">Cannot be empty</ng-template>
|
|
|
|
</rb-form-input>
|
|
|
|
|
|
|
|
<rb-icon-button icon="save" mode="primary" type="submit" [disabled]="!modelForm.form.valid" (click)="saveModel()">
|
|
|
|
Save model
|
|
|
|
</rb-icon-button>
|
|
|
|
</form>
|
|
|
|
|
2020-08-28 09:22:28 +02:00
|
|
|
<rb-table class="space-above space-below">
|
2020-08-20 10:42:02 +02:00
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>URL</th>
|
|
|
|
<th></th>
|
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<ng-container *ngFor="let group of d.arr.modelGroups">
|
|
|
|
<tr><th>{{group.group}}</th><th></th><th></th><th></th><th></th></tr>
|
|
|
|
<tr *ngFor="let modelItem of group.models">
|
|
|
|
<td>{{modelItem.name}}</td>
|
|
|
|
<td>{{modelItem.url}}</td>
|
|
|
|
<td>
|
|
|
|
<span class="rb-ic rb-ic-edit clickable"
|
|
|
|
(click)="modelGroup = group.group;
|
|
|
|
oldModelGroup = group.group;
|
|
|
|
oldModelName = modelItem.name;
|
|
|
|
model = modelItem;
|
|
|
|
newModel = true;">
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<span class="rb-ic rb-ic-delete clickable"
|
2020-08-28 09:22:28 +02:00
|
|
|
(click)="delete(modalDeleteConfirm, modelItem.name, group.group)"></span>
|
2020-08-20 10:42:02 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</ng-container>
|
|
|
|
</rb-table>
|
|
|
|
|
2020-08-28 09:22:28 +02:00
|
|
|
<rb-table>
|
|
|
|
<tr>
|
|
|
|
<th>Model files</th>
|
|
|
|
<th></th>
|
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
<tr *ngFor="let file of d.arr.modelFiles">
|
|
|
|
<td>{{file.name}}</td>
|
|
|
|
<td>{{file.size | size:'M'}}</td>
|
|
|
|
<td><span class="rb-ic rb-ic-delete clickable" (click)="delete(modalDeleteConfirm, file.name)"></span></td>
|
|
|
|
</tr>
|
|
|
|
</rb-table>
|
|
|
|
|
2020-08-20 10:42:02 +02:00
|
|
|
<ng-template #modalDeleteConfirm>
|
|
|
|
<rb-alert alertTitle="Are you sure?" type="danger" okBtnLabel="Delete model" cancelBtnLabel="Cancel">
|
2020-08-28 09:22:28 +02:00
|
|
|
Do you really want to delete?
|
2020-08-20 10:42:02 +02:00
|
|
|
</rb-alert>
|
|
|
|
</ng-template>
|