matrix-dimension/web/app/configs/widget/config_screen/config_screen.component.html

41 lines
2.0 KiB
HTML
Raw Normal View History

<div *ngIf="isLoading">
<my-spinner></my-spinner>
</div>
<div *ngIf="!isLoading">
<my-ibox [isCollapsible]="true" [defaultCollapsed]="widgetComponent.defaultExpandedWidgetId">
<h5 class="my-ibox-title">
<i class="far fa-plus-square"></i> Add {{ widgetComponent.defaultName }}
</h5>
<div class="my-ibox-content">
<form (submit)="widgetComponent.addWidget()" novalidate name="addForm">
<ng-container *ngTemplateOutlet="widgetParamsTemplate;context:{widget:widgetComponent.newWidget}"></ng-container>
<div style="margin-top: 25px">
<button type="submit" class="btn btn-sm btn-success" [disabled]="widgetComponent.isUpdating">
<i class="fa fa-plus"></i> Add Widget
</button>
</div>
</form>
</div>
</my-ibox>
<my-ibox *ngFor="let widget of widgetComponent.widgets trackById" [isCollapsible]="true" [defaultCollapsed]="widget.id !== widgetComponent.defaultExpandedWidgetId">
<h5 class="my-ibox-title">
<i class="far fa-edit"></i> {{ widget.name || widget.url || widgetComponent.defaultName }}
</h5>
<div class="my-ibox-content">
<form (submit)="widgetComponent.saveWidget(widget)" novalidate name="editForm">
<ng-container *ngTemplateOutlet="widgetParamsTemplate;context:{widget:widget}"></ng-container>
<div style="margin-top: 25px">
<button type="submit" class="btn btn-sm btn-primary" [disabled]="widgetComponent.isUpdating">
<i class="far fa-save"></i> Save Widget
</button>
<button type="button" class="btn btn-sm btn-danger" [disabled]="widgetComponent.isUpdating" (click)="widgetComponent.removeWidget(widget)">
<i class="far fa-trash-alt"></i> Remove Widget
</button>
</div>
</form>
</div>
</my-ibox>
</div>