refactoring
This commit is contained in:
parent
6efe46a249
commit
39db38051a
@ -112,14 +112,12 @@ export class GatewayLogsComponent implements OnInit, AfterViewInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private updateWidgetTitle(): void {
|
private updateWidgetTitle(): void {
|
||||||
const titlePlaceholder = '${connectorName}';
|
|
||||||
if (this.ctx.settings.isConnectorLog && this.ctx.settings.connectorLogState) {
|
if (this.ctx.settings.isConnectorLog && this.ctx.settings.connectorLogState) {
|
||||||
const widgetTitle = this.ctx['widget'].config.title;
|
const widgetTitle = this.ctx['widget'].config.title;
|
||||||
|
const titlePlaceholder = '${connectorName}';
|
||||||
if (widgetTitle.includes(titlePlaceholder)) {
|
if (widgetTitle.includes(titlePlaceholder)) {
|
||||||
const connector = this.ctx.stateController.getStateParams()[this.ctx.settings.connectorLogState];
|
const connector = this.ctx.stateController.getStateParams()[this.ctx.settings.connectorLogState];
|
||||||
this.ctx.widgetTitle = widgetTitle.replace(titlePlaceholder, connector.key);
|
this.ctx.widgetTitle = widgetTitle.replace(titlePlaceholder, connector.key);
|
||||||
} else {
|
|
||||||
this.ctx.widgetTitle = widgetTitle;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user