|
|
@ -15,27 +15,44 @@ |
|
|
limitations under the License. |
|
|
limitations under the License. |
|
|
|
|
|
|
|
|
--> |
|
|
--> |
|
|
|
|
|
|
|
|
|
|
|
<ng-template #widgetTitleTpl> |
|
|
|
|
|
<div class="flex flex-row items-center justify-start gap-2"> |
|
|
|
|
|
@if ((breadcrumbs$ | async).length > 1) { |
|
|
|
|
|
<span class='tb-breadcrumb-divider'> > </span> |
|
|
|
|
|
} |
|
|
|
|
|
<mat-form-field class="tb-widget-title tb-appearance-transparent flex-1 gt-xmd:flex-initial"> |
|
|
|
|
|
<input [disabled]="isReadOnly" matInput required maxlength="255" |
|
|
|
|
|
[(ngModel)]="widget.widgetName" (ngModelChange)="isDirty = true" |
|
|
|
|
|
placeholder="{{ 'widget.widget-title' | translate }}"/> |
|
|
|
|
|
</mat-form-field> |
|
|
|
|
|
<mat-form-field class="tb-appearance-transparent flex-1 gt-xmd:flex-initial"> |
|
|
|
|
|
<mat-select [disabled]="isReadOnly" placeholder="{{ 'widget.type' | translate }}" |
|
|
|
|
|
[(ngModel)]="widget.type" (ngModelChange)="widgetTypeChanged()"> |
|
|
|
|
|
@for (type of allWidgetTypes; track type) { |
|
|
|
|
|
<mat-option [value]="type"> |
|
|
|
|
|
{{ widgetTypesDataMap.get(widgetTypes[type]).name | translate }} |
|
|
|
|
|
</mat-option> |
|
|
|
|
|
} |
|
|
|
|
|
</mat-select> |
|
|
|
|
|
</mat-form-field> |
|
|
|
|
|
</div> |
|
|
|
|
|
</ng-template> |
|
|
|
|
|
|
|
|
<div class="flex flex-1 flex-col"> |
|
|
<div class="flex flex-1 flex-col"> |
|
|
<div class="flex flex-1 flex-col" tb-fullscreen [fullscreen]="fullscreen" [tb-hotkeys]="hotKeys" [cheatSheet]="cheatSheetComponent"> |
|
|
<div class="flex flex-1 flex-col" tb-fullscreen [fullscreen]="fullscreen" [tb-hotkeys]="hotKeys" [cheatSheet]="cheatSheetComponent"> |
|
|
<tb-hotkeys-cheatsheet #cheatSheetComponent></tb-hotkeys-cheatsheet> |
|
|
<tb-hotkeys-cheatsheet #cheatSheetComponent></tb-hotkeys-cheatsheet> |
|
|
<mat-toolbar class="mat-elevation-z1 tb-edit-toolbar mat-hue-3 gap-4 lt-xl:gap-2"> |
|
|
<mat-toolbar class="tb-edit-toolbar gap-4 lt-xl:gap-2"> |
|
|
<mat-form-field class="tb-widget-title tb-appearance-transparent"> |
|
|
<button mat-icon-button |
|
|
<input [disabled]="isReadOnly" matInput required maxlength="255" |
|
|
[class.!hidden]="fullscreen" |
|
|
[(ngModel)]="widget.widgetName" (ngModelChange)="isDirty = true" |
|
|
class="-ml-2 -mr-2 gt-sm:!hidden" (click)="toggleSidenav()"> |
|
|
placeholder="{{ 'widget.widget-title' | translate }}"/> |
|
|
<mat-icon class="material-icons">menu</mat-icon> |
|
|
</mat-form-field> |
|
|
</button> |
|
|
<mat-form-field class="tb-appearance-transparent"> |
|
|
<div class="flex flex-1 flex-row items-center overflow-hidden"> |
|
|
<mat-select [disabled]="isReadOnly" placeholder="{{ 'widget.type' | translate }}" |
|
|
<tb-breadcrumb class="mat-toolbar-tools" [componentBreadcrumbsTpl]="widgetTitleTpl"></tb-breadcrumb> |
|
|
[(ngModel)]="widget.type" (ngModelChange)="widgetTypeChanged()"> |
|
|
</div> |
|
|
@for (type of allWidgetTypes; track type) { |
|
|
<tb-github-badge class="lt-lg:!hidden"></tb-github-badge> |
|
|
<mat-option [value]="type"> |
|
|
<button mat-button class="lt-lg:!hidden" [disabled]="!iframeWidgetEditModeInited" |
|
|
{{ widgetTypesDataMap.get(widgetTypes[type]).name | translate }} |
|
|
|
|
|
</mat-option> |
|
|
|
|
|
} |
|
|
|
|
|
</mat-select> |
|
|
|
|
|
</mat-form-field> |
|
|
|
|
|
<span class="flex-1"></span> |
|
|
|
|
|
<button mat-button class="lt-md:!hidden" [disabled]="!iframeWidgetEditModeInited" |
|
|
|
|
|
(click)="applyWidgetScript()" |
|
|
(click)="applyWidgetScript()" |
|
|
matTooltip="{{ 'widget.run' | translate }} (CTRL + Return)" |
|
|
matTooltip="{{ 'widget.run' | translate }} (CTRL + Return)" |
|
|
matTooltipPosition="below"> |
|
|
matTooltipPosition="below"> |
|
|
@ -43,7 +60,7 @@ |
|
|
<span translate>action.run</span> |
|
|
<span translate>action.run</span> |
|
|
</button> |
|
|
</button> |
|
|
<button mat-raised-button |
|
|
<button mat-raised-button |
|
|
class="lt-md:!hidden" [disabled]="(isLoading$ | async) || undoDisabled()" |
|
|
class="lt-lg:!hidden" [disabled]="(isLoading$ | async) || undoDisabled()" |
|
|
(click)="undoWidget()" |
|
|
(click)="undoWidget()" |
|
|
matTooltip="{{ 'widget.undo' | translate }} (CTRL + Q)" |
|
|
matTooltip="{{ 'widget.undo' | translate }} (CTRL + Q)" |
|
|
matTooltipPosition="below"> |
|
|
matTooltipPosition="below"> |
|
|
@ -52,7 +69,7 @@ |
|
|
</button> |
|
|
</button> |
|
|
@if (!isReadOnly) { |
|
|
@if (!isReadOnly) { |
|
|
<button mat-raised-button |
|
|
<button mat-raised-button |
|
|
class="lt-md:!hidden" [disabled]="(isLoading$ | async) || saveDisabled()" |
|
|
class="lt-lg:!hidden" [disabled]="(isLoading$ | async) || saveDisabled()" |
|
|
(click)="saveWidget()" |
|
|
(click)="saveWidget()" |
|
|
[tb-circular-progress]="saveWidgetPending" |
|
|
[tb-circular-progress]="saveWidgetPending" |
|
|
matTooltip="{{ 'widget.save' | translate }} (CTRL + S)" |
|
|
matTooltip="{{ 'widget.save' | translate }} (CTRL + S)" |
|
|
@ -62,7 +79,7 @@ |
|
|
</button> |
|
|
</button> |
|
|
} |
|
|
} |
|
|
<button mat-raised-button |
|
|
<button mat-raised-button |
|
|
class="lt-md:!hidden" [disabled]="(isLoading$ | async) || saveAsDisabled()" |
|
|
class="lt-lg:!hidden" [disabled]="(isLoading$ | async) || saveAsDisabled()" |
|
|
(click)="saveWidgetAs()" |
|
|
(click)="saveWidgetAs()" |
|
|
[tb-circular-progress]="saveWidgetAsPending" |
|
|
[tb-circular-progress]="saveWidgetAsPending" |
|
|
matTooltip="{{ 'widget.saveAs' | translate }} (Shift + CTRL + S)" |
|
|
matTooltip="{{ 'widget.saveAs' | translate }} (Shift + CTRL + S)" |
|
|
@ -70,24 +87,20 @@ |
|
|
<mat-icon>save_as</mat-icon> |
|
|
<mat-icon>save_as</mat-icon> |
|
|
<span translate>action.saveAs</span> |
|
|
<span translate>action.saveAs</span> |
|
|
</button> |
|
|
</button> |
|
|
<button mat-button |
|
|
|
|
|
class="lt-lg:!hidden" |
|
|
|
|
|
(click)="fullscreen = !fullscreen" |
|
|
|
|
|
matTooltip="{{ 'widget.toggle-fullscreen' | translate }} (Shift + CTRL + F)" |
|
|
|
|
|
matTooltipPosition="below"> |
|
|
|
|
|
<mat-icon>{{ fullscreen ? 'fullscreen_exit' : 'fullscreen' }}</mat-icon> |
|
|
|
|
|
<span translate>widget.toggle-fullscreen</span> |
|
|
|
|
|
</button> |
|
|
|
|
|
<button mat-icon-button class="lt-md:!hidden gt-md:!hidden" |
|
|
|
|
|
(click)="fullscreen = !fullscreen" |
|
|
|
|
|
matTooltip="{{ 'widget.toggle-fullscreen' | translate }} (Shift + CTRL + F)" |
|
|
|
|
|
matTooltipPosition="below"> |
|
|
|
|
|
<mat-icon>{{ fullscreen ? 'fullscreen_exit' : 'fullscreen' }}</mat-icon> |
|
|
|
|
|
</button> |
|
|
|
|
|
<button mat-icon-button class="gt-md:!hidden" |
|
|
<button mat-icon-button class="gt-md:!hidden" |
|
|
[matMenuTriggerFor]="widgetEditMenu"> |
|
|
[matMenuTriggerFor]="widgetEditMenu"> |
|
|
<mat-icon>more_vert</mat-icon> |
|
|
<mat-icon>more_vert</mat-icon> |
|
|
</button> |
|
|
</button> |
|
|
|
|
|
<div class="flex flex-row items-center"> |
|
|
|
|
|
<mat-divider vertical></mat-divider> |
|
|
|
|
|
<button mat-icon-button class="lt-md:!hidden" |
|
|
|
|
|
matTooltip="{{ 'widget.toggle-fullscreen' | translate }} (Shift + CTRL + F)" |
|
|
|
|
|
matTooltipPosition="below" |
|
|
|
|
|
(click)="fullscreen = !fullscreen"> |
|
|
|
|
|
<mat-icon>{{ fullscreen ? 'fullscreen_exit' : 'fullscreen' }}</mat-icon> |
|
|
|
|
|
</button> |
|
|
|
|
|
<tb-notification-bell></tb-notification-bell> |
|
|
|
|
|
</div> |
|
|
<mat-menu #widgetEditMenu="matMenu" xPosition="before"> |
|
|
<mat-menu #widgetEditMenu="matMenu" xPosition="before"> |
|
|
<button mat-menu-item |
|
|
<button mat-menu-item |
|
|
[disabled]="!iframeWidgetEditModeInited" |
|
|
[disabled]="!iframeWidgetEditModeInited" |
|
|
@ -117,7 +130,12 @@ |
|
|
</button> |
|
|
</button> |
|
|
</mat-menu> |
|
|
</mat-menu> |
|
|
</mat-toolbar> |
|
|
</mat-toolbar> |
|
|
<div class="flex-1" style="position: relative;"> |
|
|
@if ((homeService.hideLoadingBar$ | async) === false && (isLoading$ | async)) { |
|
|
|
|
|
<mat-progress-bar color="warn" style="z-index: 10; margin-bottom: -4px; width: 100%;" mode="indeterminate" |
|
|
|
|
|
> |
|
|
|
|
|
</mat-progress-bar> |
|
|
|
|
|
} |
|
|
|
|
|
<div class="flex-1 mt-2" style="position: relative;"> |
|
|
<div class="tb-editor tb-absolute-fill"> |
|
|
<div class="tb-editor tb-absolute-fill"> |
|
|
<div #topPanel class="tb-split tb-split-vertical"> |
|
|
<div #topPanel class="tb-split tb-split-vertical"> |
|
|
<div #topLeftPanel class="tb-split tb-content"> |
|
|
<div #topLeftPanel class="tb-split tb-content"> |
|
|
|