diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts index 2fc5dc98de..8671c7d195 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts @@ -120,6 +120,8 @@ import { DisplayWidgetTypesPanelData, WidgetTypes } from '@home/components/dashboard-page/widget-types-panel.component'; +import { LogoComponent } from '@app/shared/components/logo.component'; +import { concat } from 'lodash'; // @dynamic @Component({ @@ -189,10 +191,10 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC currentDashboardScope: DashboardPageScope; addingLayoutCtx: DashboardPageLayoutContext; - - dashboard_logo = 'assets/example_logo.png'; - + logo_name_local = 'example_logo.png'; + dashboard_logo = 'assets/' + this.logo_name_local; + dashboardCtx: DashboardContext = { instanceId: this.utils.guid(), getDashboard: () => this.dashboard, @@ -490,6 +492,11 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC return true; } } + + public updateLogoName(): string { + this.dashboard_logo = 'assets/' + this.dashboard.configuration.settings.logoName + return this.dashboard.configuration.settings.logoName; + } public showRightLayoutSwitch(): boolean { return this.isMobile && this.layouts.right.show; @@ -611,11 +618,16 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC panelClass: ['tb-dialog', 'tb-fullscreen-dialog'], data: { settings: deepClone(this.dashboard.configuration.settings), - gridSettings + gridSettings, } - }).afterClosed().subscribe((data) => { + } + ).afterClosed().subscribe((data) => { if (data) { this.dashboard.configuration.settings = data.settings; + if (this.dashboard.configuration.settings) + { + this.updateLogoName(); + } const newGridSettings = data.gridSettings; if (newGridSettings) { const layout = this.dashboard.configuration.states[layoutKeys.state].layouts[layoutKeys.layout]; diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-settings-dialog.component.html b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-settings-dialog.component.html index 89d4510c44..f745a8508d 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-settings-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-settings-dialog.component.html @@ -51,6 +51,10 @@ openOnInput formControlName="titleColor"> + + dashboard.display-dashboard-enterLogoName + +
diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-settings-dialog.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-settings-dialog.component.ts index 195f7e6433..9aae5c0aaf 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-settings-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-settings-dialog.component.ts @@ -34,6 +34,7 @@ export interface DashboardSettingsDialogData { gridSettings?: GridSettings; } + @Component({ selector: 'tb-dashboard-settings-dialog', templateUrl: './dashboard-settings-dialog.component.html', @@ -45,13 +46,16 @@ export class DashboardSettingsDialogComponent extends DialogComponent, protected router: Router, @@ -69,6 +73,7 @@ export class DashboardSettingsDialogComponent extends DialogComponent