Added dashboard logo checkbox

This commit is contained in:
mdheer 2021-03-22 22:21:25 +01:00
parent 9a747d49b1
commit e7fe89f589
12 changed files with 50 additions and 18 deletions

View File

@ -46,6 +46,14 @@
<mat-icon>view_compact</mat-icon> <mat-icon>view_compact</mat-icon>
</button> </button>
</div> </div>
<div fxFlex.lt-md fxLayout="row"
fxLayoutAlign.gt-sm="start center"
fxLayoutAlign="end center" fxLayoutGap="12px" class="db-logo-and-title" >
<img [fxShow]="showDashboardLogo()" [src]="dashboard_logo"
aria-label="white_label_logo" class="whitelabel-logo-db"/>
<tb-states-component fxFlex.lt-md <tb-states-component fxFlex.lt-md
[statesControllerId]="isEdit ? 'default' : dashboardConfiguration.settings.stateControllerId" [statesControllerId]="isEdit ? 'default' : dashboardConfiguration.settings.stateControllerId"
[dashboardCtrl]="this" [dashboardCtrl]="this"
@ -56,6 +64,8 @@
[syncStateWithQueryParam]="syncStateWithQueryParam" [syncStateWithQueryParam]="syncStateWithQueryParam"
[states]="dashboardConfiguration.states"> [states]="dashboardConfiguration.states">
</tb-states-component> </tb-states-component>
</div>
</div> </div>
<div class="tb-dashboard-action-panel" fxFlex="1 0 auto" fxLayout="row-reverse" <div class="tb-dashboard-action-panel" fxFlex="1 0 auto" fxLayout="row-reverse"
fxLayoutAlign.gt-sm="start center" fxLayoutAlign="space-between center" fxLayoutGap="12px"> fxLayoutAlign.gt-sm="start center" fxLayoutAlign="space-between center" fxLayoutGap="12px">

View File

@ -54,6 +54,14 @@ div.tb-dashboard-page {
z-index: 13; z-index: 13;
pointer-events: none; pointer-events: none;
.db-logo-and-title {
height: $toolbar-height;
.whitelabel-logo-db{
height: 100%;
width: auto;
}
}
&.tb-dashboard-toolbar-opened { &.tb-dashboard-toolbar-opened {
right: 0; right: 0;
// transition: right .3s cubic-bezier(.55, 0, .55, .2); // transition: right .3s cubic-bezier(.55, 0, .55, .2);
@ -63,8 +71,9 @@ div.tb-dashboard-page {
right: 18px; right: 18px;
transition: right .3s cubic-bezier(.55, 0, .55, .2) .2s; transition: right .3s cubic-bezier(.55, 0, .55, .2) .2s;
} }
}
}
.tb-dashboard-container { .tb-dashboard-container {
&.tb-dashboard-toolbar-opened { &.tb-dashboard-toolbar-opened {
&.is-fullscreen { &.is-fullscreen {

View File

@ -190,6 +190,8 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
addingLayoutCtx: DashboardPageLayoutContext; addingLayoutCtx: DashboardPageLayoutContext;
dashboard_logo = 'assets/example_logo.png';
dashboardCtx: DashboardContext = { dashboardCtx: DashboardContext = {
instanceId: this.utils.guid(), instanceId: this.utils.guid(),
@ -480,6 +482,15 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
} }
} }
public showDashboardLogo(): boolean {
if (this.dashboard.configuration.settings &&
isDefined(this.dashboard.configuration.settings.showDashboardLogo)) {
return this.dashboard.configuration.settings.showDashboardLogo;
} else {
return true;
}
}
public showRightLayoutSwitch(): boolean { public showRightLayoutSwitch(): boolean {
return this.isMobile && this.layouts.right.show; return this.isMobile && this.layouts.right.show;
} }

View File

@ -53,6 +53,9 @@
</tb-color-input> </tb-color-input>
</div> </div>
<div fxLayout="row" fxLayoutAlign="start center" fxLayout.lt-md="column" fxLayoutAlign.lt-md fxLayoutGap="8px"> <div fxLayout="row" fxLayoutAlign="start center" fxLayout.lt-md="column" fxLayoutAlign.lt-md fxLayoutGap="8px">
<mat-checkbox fxFlex formControlName="showDashboardLogo">
{{ 'dashboard.display-dashboard-showDashboardLogo' | translate }}
</mat-checkbox>
<mat-checkbox fxFlex formControlName="showDashboardsSelect"> <mat-checkbox fxFlex formControlName="showDashboardsSelect">
{{ 'dashboard.display-dashboards-selection' | translate }} {{ 'dashboard.display-dashboards-selection' | translate }}
</mat-checkbox> </mat-checkbox>

View File

@ -79,6 +79,7 @@ export class DashboardSettingsDialogComponent extends DialogComponent<DashboardS
showDashboardsSelect: [isUndefined(this.settings.showDashboardsSelect) ? true : this.settings.showDashboardsSelect, []], showDashboardsSelect: [isUndefined(this.settings.showDashboardsSelect) ? true : this.settings.showDashboardsSelect, []],
showEntitiesSelect: [isUndefined(this.settings.showEntitiesSelect) ? true : this.settings.showEntitiesSelect, []], showEntitiesSelect: [isUndefined(this.settings.showEntitiesSelect) ? true : this.settings.showEntitiesSelect, []],
showFilters: [isUndefined(this.settings.showFilters) ? true : this.settings.showFilters, []], showFilters: [isUndefined(this.settings.showFilters) ? true : this.settings.showFilters, []],
showDashboardLogo: [isUndefined(this.settings.showDashboardLogo) ? true : this.settings.showDashboardLogo, []],
showDashboardTimewindow: [isUndefined(this.settings.showDashboardTimewindow) ? true : this.settings.showDashboardTimewindow, []], showDashboardTimewindow: [isUndefined(this.settings.showDashboardTimewindow) ? true : this.settings.showDashboardTimewindow, []],
showDashboardExport: [isUndefined(this.settings.showDashboardExport) ? true : this.settings.showDashboardExport, []] showDashboardExport: [isUndefined(this.settings.showDashboardExport) ? true : this.settings.showDashboardExport, []]
}); });

View File

@ -26,10 +26,6 @@
</button> </button>
</mat-fab-trigger> </mat-fab-trigger>
<mat-toolbar color="primary"> <mat-toolbar color="primary">
<div fxFlex="auto" fxLayout="row">
<img [src]="white_label_logo"
aria-label="white_label_logo" class="whitelabel-logo-db"/>
</div>
<mat-fab-actions class="mat-toolbar-tools"> <mat-fab-actions class="mat-toolbar-tools">
<ng-content></ng-content> <ng-content></ng-content>
</mat-fab-actions> </mat-fab-actions>

View File

@ -4413,7 +4413,8 @@
"showDashboardExport": false, "showDashboardExport": false,
"toolbarAlwaysOpen": true, "toolbarAlwaysOpen": true,
"titleColor": "rgba(0,0,0,0.870588)", "titleColor": "rgba(0,0,0,0.870588)",
"showFilters": false "showFilters": false,
"showDashboardLogo": false
} }
}, },
"name": "Api Usage" "name": "Api Usage"

View File

@ -86,6 +86,7 @@ export interface DashboardSettings {
showDashboardsSelect?: boolean; showDashboardsSelect?: boolean;
showEntitiesSelect?: boolean; showEntitiesSelect?: boolean;
showFilters?: boolean; showFilters?: boolean;
showDashboardLogo?: boolean;
showDashboardTimewindow?: boolean; showDashboardTimewindow?: boolean;
showDashboardExport?: boolean; showDashboardExport?: boolean;
toolbarAlwaysOpen?: boolean; toolbarAlwaysOpen?: boolean;

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -725,6 +725,7 @@
"display-filters": "Display filters", "display-filters": "Display filters",
"display-dashboard-timewindow": "Display timewindow", "display-dashboard-timewindow": "Display timewindow",
"display-dashboard-export": "Display export", "display-dashboard-export": "Display export",
"display-dashboard-showDashboardLogo": "Display dashboard logo",
"import": "Import dashboard", "import": "Import dashboard",
"export": "Export dashboard", "export": "Export dashboard",
"export-failed-error": "Unable to export dashboard: {{error}}", "export-failed-error": "Unable to export dashboard: {{error}}",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 16 KiB