Merge pull request #4284 from TTvanWillegen/master
UI: Added show logo option in dashboard settings [Issue #3544]
This commit is contained in:
commit
5d9ea35fd9
@ -56,6 +56,8 @@
|
|||||||
[syncStateWithQueryParam]="syncStateWithQueryParam"
|
[syncStateWithQueryParam]="syncStateWithQueryParam"
|
||||||
[states]="dashboardConfiguration.states">
|
[states]="dashboardConfiguration.states">
|
||||||
</tb-states-component>
|
</tb-states-component>
|
||||||
|
<img *ngIf="showDashboardLogo() && isFullscreen" [src]="dashboardLogo"
|
||||||
|
aria-label="dashboard_logo" class="dashboard_logo"/>
|
||||||
</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">
|
||||||
|
|||||||
@ -54,6 +54,11 @@ div.tb-dashboard-page {
|
|||||||
z-index: 13;
|
z-index: 13;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|
||||||
|
.dashboard_logo{
|
||||||
|
height: 75%;
|
||||||
|
margin-right: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
&.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);
|
||||||
|
|||||||
@ -191,6 +191,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
|
|||||||
|
|
||||||
addingLayoutCtx: DashboardPageLayoutContext;
|
addingLayoutCtx: DashboardPageLayoutContext;
|
||||||
|
|
||||||
|
logo = 'assets/logo_title_white.svg';
|
||||||
|
|
||||||
dashboardCtx: DashboardContext = {
|
dashboardCtx: DashboardContext = {
|
||||||
instanceId: this.utils.guid(),
|
instanceId: this.utils.guid(),
|
||||||
@ -484,6 +485,19 @@ 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 false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public get dashboardLogo(): string {
|
||||||
|
return this.dashboard.configuration.settings.dashboardLogoUrl || this.logo;
|
||||||
|
}
|
||||||
|
|
||||||
public showRightLayoutSwitch(): boolean {
|
public showRightLayoutSwitch(): boolean {
|
||||||
return this.isMobile && this.layouts.right.show;
|
return this.isMobile && this.layouts.right.show;
|
||||||
}
|
}
|
||||||
@ -605,7 +619,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
|
|||||||
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
|
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
|
||||||
data: {
|
data: {
|
||||||
settings: deepClone(this.dashboard.configuration.settings),
|
settings: deepClone(this.dashboard.configuration.settings),
|
||||||
gridSettings
|
gridSettings,
|
||||||
}
|
}
|
||||||
}).afterClosed().subscribe((data) => {
|
}).afterClosed().subscribe((data) => {
|
||||||
if (data) {
|
if (data) {
|
||||||
|
|||||||
@ -52,7 +52,8 @@
|
|||||||
formControlName="titleColor">
|
formControlName="titleColor">
|
||||||
</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" style="margin-bottom: 8px;"
|
||||||
|
fxLayout.lt-md="column" fxLayoutAlign.lt-md fxLayoutGap="8px">
|
||||||
<mat-checkbox fxFlex formControlName="showDashboardsSelect">
|
<mat-checkbox fxFlex formControlName="showDashboardsSelect">
|
||||||
{{ 'dashboard.display-dashboards-selection' | translate }}
|
{{ 'dashboard.display-dashboards-selection' | translate }}
|
||||||
</mat-checkbox>
|
</mat-checkbox>
|
||||||
@ -69,6 +70,13 @@
|
|||||||
{{ 'dashboard.display-dashboard-export' | translate }}
|
{{ 'dashboard.display-dashboard-export' | translate }}
|
||||||
</mat-checkbox>
|
</mat-checkbox>
|
||||||
</div>
|
</div>
|
||||||
|
<mat-checkbox formControlName="showDashboardLogo">
|
||||||
|
{{ 'dashboard.display-dashboard-toolbar-logo' | translate }}
|
||||||
|
</mat-checkbox>
|
||||||
|
<tb-image-input fxFlex *ngIf="settingsFormGroup.get('showDashboardLogo').value"
|
||||||
|
label="{{'dashboard.dashboard-logo-image' | translate}}"
|
||||||
|
formControlName="dashboardLogoUrl">
|
||||||
|
</tb-image-input>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="gridSettings" [formGroup]="gridSettingsFormGroup">
|
<div *ngIf="gridSettings" [formGroup]="gridSettingsFormGroup">
|
||||||
<tb-color-input fxFlex
|
<tb-color-input fxFlex
|
||||||
|
|||||||
@ -79,6 +79,8 @@ 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) ? false : this.settings.showDashboardLogo, []],
|
||||||
|
dashboardLogoUrl: [isUndefined(this.settings.dashboardLogoUrl) ? null : this.settings.dashboardLogoUrl, []],
|
||||||
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, []]
|
||||||
});
|
});
|
||||||
|
|||||||
@ -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"
|
||||||
|
|||||||
@ -86,6 +86,8 @@ export interface DashboardSettings {
|
|||||||
showDashboardsSelect?: boolean;
|
showDashboardsSelect?: boolean;
|
||||||
showEntitiesSelect?: boolean;
|
showEntitiesSelect?: boolean;
|
||||||
showFilters?: boolean;
|
showFilters?: boolean;
|
||||||
|
showDashboardLogo?: boolean;
|
||||||
|
dashboardLogoUrl?: string;
|
||||||
showDashboardTimewindow?: boolean;
|
showDashboardTimewindow?: boolean;
|
||||||
showDashboardExport?: boolean;
|
showDashboardExport?: boolean;
|
||||||
toolbarAlwaysOpen?: boolean;
|
toolbarAlwaysOpen?: boolean;
|
||||||
|
|||||||
@ -746,6 +746,8 @@
|
|||||||
"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-toolbar-logo": "Display dashboard logo in fullscreen mode",
|
||||||
|
"dashboard-logo-image": "Dashboard image 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}}",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user