Minor improvements

This commit is contained in:
Igor Kulikov 2020-02-26 19:43:16 +02:00
parent b3e90244c2
commit ec6a14a34a
6 changed files with 4 additions and 103 deletions

View File

@ -5,22 +5,6 @@
"image": null
},
"widgetTypes": [
{
"alias": "extension_configuration_widget",
"name": "Extensions table",
"descriptor": {
"type": "latest",
"sizeX": 9,
"sizeY": 6.5,
"resources": [],
"templateHtml": "<tb-extensions-table-widget \n ctx=\"ctx\">\n</tb-extensions-table-widget>",
"templateCss": "#container {\n overflow: auto;\n}",
"controllerScript": "self.onInit = function() {\n var scope = self.ctx.$scope;\n scope.ctx = self.ctx;\n}\n\nself.onDataUpdated = function() {\n}\n\nself.onResize = function() {\n}\n\nself.typeParameters = function() {\n return {\n maxDatasources: 1\n };\n}\n\nself.onDestroy = function() {\n}\n",
"settingsSchema": "{\n \"schema\": {\n \"type\": \"object\",\n \"title\": \"ExtensionTableSettings\",\n \"properties\": {\n \"extensionsTitle\": {\n \"title\": \"Extension table title\",\n \"type\": \"string\",\n \"default\": \"\"\n }\n },\n \"required\": []\n },\n \"form\": [\n \"extensionsTitle\"\n ]\n}",
"dataKeySettingsSchema": "{}\n",
"defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}]}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"4px\",\"settings\":{},\"title\":\"Extensions table\",\"dropShadow\":true,\"enableFullscreen\":true,\"widgetStyle\":{},\"titleStyle\":{\"fontSize\":\"18px\",\"fontWeight\":400,\"padding\":\"5px 10px 5px 10px\"},\"useDashboardTimewindow\":true,\"showLegend\":false,\"actions\":{}}"
}
},
{
"alias": "gateway_configuration",
"name": "Gateway Configuration",
@ -38,4 +22,4 @@
}
}
]
}
}

File diff suppressed because one or more lines are too long

View File

@ -79,9 +79,6 @@
(contextmenu)="openWidgetContextMenu($event, widget)">
<div fxLayout="row" fxLayoutAlign="space-between start">
<div class="tb-widget-title" fxLayout="column" fxLayoutAlign="center start" [fxShow]="widget.showWidgetTitlePanel">
<div *ngIf="widget.hasWidgetTitleTemplate">
TODO:
</div>
<span [fxShow]="widget.showTitle"
[ngStyle]="widget.titleStyle"
[matTooltip]="widget.titleTooltip"
@ -101,7 +98,7 @@
</div>
<div [fxShow]="widget.showWidgetActions"
class="tb-widget-actions"
[ngClass]="{'tb-widget-actions-absolute': !(widget.showWidgetTitlePanel&&(widget.hasWidgetTitleTemplate||widget.showTitle||widget.hasAggregation))}"
[ngClass]="{'tb-widget-actions-absolute': !(widget.showWidgetTitlePanel&&(widget.showTitle||widget.hasAggregation))}"
fxLayout="row"
fxLayoutAlign="start center"
(mousedown)="$event.stopPropagation()">

View File

@ -311,9 +311,6 @@ export class DashboardWidget implements GridsterItem, IDashboardWidget {
style: {[klass: string]: any};
hasWidgetTitleTemplate: boolean;
widgetTitleTemplate: string;
showWidgetTitlePanel: boolean;
showWidgetActions: boolean;
@ -395,11 +392,8 @@ export class DashboardWidget implements GridsterItem, IDashboardWidget {
this.style = {...this.widget.config.widgetStyle, ...this.style};
}
this.hasWidgetTitleTemplate = this.widgetContext.widgetTitleTemplate ? true : false;
this.widgetTitleTemplate = this.widgetContext.widgetTitleTemplate ? this.widgetContext.widgetTitleTemplate : '';
this.showWidgetTitlePanel = this.widgetContext.hideTitlePanel ? false :
this.hasWidgetTitleTemplate || this.showTitle || this.hasTimewindow;
this.showTitle || this.hasTimewindow;
this.showWidgetActions = this.widgetContext.hideTitlePanel ? false : true;

View File

@ -176,7 +176,6 @@ export class WidgetContext {
hideTitlePanel = false;
widgetTitleTemplate?: string;
widgetTitle?: string;
widgetTitleTooltip?: string;
customHeaderActions?: Array<WidgetHeaderAction>;
@ -212,7 +211,6 @@ export class WidgetContext {
reset() {
this.destroyed = false;
this.hideTitlePanel = false;
this.widgetTitleTemplate = undefined;
this.widgetTitle = undefined;
this.customHeaderActions = undefined;
this.widgetActions = undefined;

View File

@ -42,6 +42,7 @@ body {
margin: 0;
padding: 0;
background-color: rgb(250,250,250);
overflow: hidden;
}
tb-root {