Merge branch 'develop/3.5.2' into feature/widget-bundles
This commit is contained in:
commit
3b3f361fb1
@ -37,7 +37,7 @@
|
||||
"sizeX": 5,
|
||||
"sizeY": 2,
|
||||
"resources": [],
|
||||
"templateHtml": "<div class=\"gpio-panel\" style=\"height: 100%;\">\n <section fxLayout=\"row\" *ngFor=\"let row of rows\">\n <section fxFlex fxLayout=\"row\" *ngFor=\"let cell of row; let $index = index\">\n <section fxLayout=\"row\" fxFlex *ngIf=\"cell\" fxLayoutAlign=\"{{$index===0 ? 'end center' : 'start center'}}\">\n <span class=\"gpio-left-label\" [fxShow]=\"$index===0\">{{ cell.label }}</span>\n <section fxLayout=\"row\" class=\"led-panel\" [ngClass]=\"$index===0 ? 'col-0' : 'col-1'\"\n [ngStyle]=\"{backgroundColor: ledPanelBackgroundColor}\">\n <span class=\"pin\" [fxShow]=\"$index===0\">{{cell.pin}}</span>\n <span class=\"led-container\">\n <tb-led-light [size]=\"prefferedRowHeight\"\n [colorOn]=\"cell.colorOn\"\n [colorOff]=\"cell.colorOff\"\n [offOpacity]=\"'0.9'\"\n [enabled]=\"cell.enabled\">\n </tb-led-light>\n </span>\n <span class=\"pin\" [fxShow]=\"$index===1\">{{cell.pin}}</span>\n </section>\n <span class=\"gpio-right-label\" [fxShow]=\"$index===1\">{{ cell.label }}</span>\n </section>\n <section fxLayout=\"row\" fxFlex *ngIf=\"!cell\">\n <span fxFlex [fxShow]=\"$index===0\"></span>\n <span class=\"led-panel\"\n [ngStyle]=\"{backgroundColor: ledPanelBackgroundColor}\"></span>\n <span fxFlex [fxShow]=\"$index===1\"></span>\n </section>\n </section>\n </section> \n</div>",
|
||||
"templateHtml": "<div class=\"gpio-panel\" style=\"height: 100%;\">\n <section fxLayout=\"row\" *ngFor=\"let row of rows\">\n <section fxFlex fxLayout=\"row\" *ngFor=\"let cell of row; let $index = index\">\n <section fxLayout=\"row\" fxFlex *ngIf=\"cell\" fxLayoutAlign=\"{{$index===0 ? 'end center' : 'start center'}}\">\n <span class=\"gpio-left-label\" [fxShow]=\"$index===0\">{{ cell.label }}</span>\n <section fxLayout=\"row\" class=\"led-panel\" [ngClass]=\"$index===0 ? 'col-0' : 'col-1'\"\n [ngStyle]=\"{backgroundColor: ledPanelBackgroundColor}\">\n <span class=\"pin\" [fxShow]=\"$index===0\">{{cell.pin}}</span>\n <span class=\"led-container\">\n <tb-led-light [size]=\"prefferedRowHeight\"\n [colorOn]=\"cell.colorOn\"\n [colorOff]=\"cell.colorOff\"\n [offOpacity]=\"'0.9'\"\n [enabled]=\"cell.enabled\">\n </tb-led-light>\n </span>\n <span class=\"pin\" [fxShow]=\"$index===1\">{{cell.pin}}</span>\n </section>\n <span class=\"gpio-right-label\" [fxShow]=\"$index===1\">{{ cell.label }}</span>\n </section>\n <section fxLayout=\"row\" fxFlex *ngIf=\"!cell\">\n <span fxFlex [fxShow]=\"$index===0\"></span>\n <span class=\"led-panel\"\n [ngStyle]=\"{height: prefferedRowHeight+'px', backgroundColor: ledPanelBackgroundColor}\"></span>\n <span fxFlex [fxShow]=\"$index===1\"></span>\n </section>\n </section>\n </section> \n</div>",
|
||||
"templateCss": ".error {\n font-size: 14px !important;\n color: maroon;/*rgb(250,250,250);*/\n background-color: transparent;\n padding: 6px;\n}\n\n.error span {\n margin: auto;\n}\n\n.gpio-panel {\n padding-top: 10px;\n white-space: nowrap;\n}\n\n.gpio-panel section[fxflex] {\n min-width: 0px;\n}\n\n\n.gpio-panel tb-led-light > div {\n margin: auto;\n}\n\n.led-panel {\n margin: 0;\n width: 66px;\n min-width: 66px;\n}\n\n.led-container {\n width: 48px;\n min-width: 48px;\n}\n\n.pin {\n margin-top: auto;\n margin-bottom: auto;\n color: white;\n font-size: 12px;\n width: 16px;\n min-width: 16px;\n}\n\n.led-panel.col-0 .pin {\n margin-left: auto;\n padding-left: 2px;\n text-align: right;\n}\n\n.led-panel.col-1 .pin {\n margin-right: auto;\n \n text-align: left;\n}\n\n.gpio-left-label {\n margin-right: 8px;\n}\n\n.gpio-right-label {\n margin-left: 8px;\n}",
|
||||
"controllerScript": "var namespace;\nvar cssParser = new cssjs();\n\nself.onInit = function() {\n var utils = self.ctx.$injector.get(self.ctx.servicesMap.get('utils'));\n namespace = 'gpio-panel-' + utils.guid();\n cssParser.testMode = false;\n cssParser.cssPreviewNamespace = namespace;\n self.ctx.$container.addClass(namespace);\n self.ctx.ngZone.run(function() {\n init(); \n });\n}\n\nfunction init() {\n var i, gpio;\n \n var scope = self.ctx.$scope;\n var settings = self.ctx.settings;\n \n scope.gpioList = [];\n scope.gpioByPin = {};\n for (var g = 0; g < settings.gpioList.length; g++) {\n gpio = settings.gpioList[g];\n scope.gpioList.push(\n {\n row: gpio.row,\n col: gpio.col,\n pin: gpio.pin,\n label: gpio.label,\n enabled: false,\n colorOn: tinycolor(gpio.color).lighten(20).toHexString(),\n colorOff: tinycolor(gpio.color).darken().toHexString()\n }\n );\n scope.gpioByPin[gpio.pin] = scope.gpioList[scope.gpioList.length-1];\n }\n\n scope.ledPanelBackgroundColor = settings.ledPanelBackgroundColor || tinycolor('green').lighten(2).toRgbString();\n\n scope.gpioCells = {};\n var rowCount = 0;\n for (i = 0; i < scope.gpioList.length; i++) {\n gpio = scope.gpioList[i];\n scope.gpioCells[gpio.row+'_'+gpio.col] = gpio;\n rowCount = Math.max(rowCount, gpio.row+1);\n }\n \n scope.prefferedRowHeight = 32;\n scope.rows = [];\n for (i = 0; i < rowCount; i++) {\n var row = [];\n for (var c =0; c<2;c++) {\n if (scope.gpioCells[i+'_'+c]) {\n row[c] = scope.gpioCells[i+'_'+c];\n } else {\n row[c] = null;\n }\n }\n scope.rows.push(row);\n } \n \n self.onResize();\n}\n\nself.onDataUpdated = function() {\n var changed = false;\n for (var d = 0; d < self.ctx.data.length; d++) {\n var cellData = self.ctx.data[d];\n var dataKey = cellData.dataKey;\n var gpio = self.ctx.$scope.gpioByPin[dataKey.label];\n if (gpio) {\n var enabled = false;\n if (cellData.data.length > 0) {\n var tvPair = cellData.data[cellData.data.length - 1];\n enabled = (tvPair[1] === true || tvPair[1] === 'true');\n }\n if (gpio.enabled != enabled) {\n changed = true;\n gpio.enabled = enabled;\n }\n }\n }\n if (changed) {\n self.ctx.detectChanges();\n } \n}\n\nself.onResize = function() {\n var rowCount = self.ctx.$scope.rows.length;\n var prefferedRowHeight = (self.ctx.height - 35)/rowCount;\n prefferedRowHeight = Math.min(32, prefferedRowHeight);\n prefferedRowHeight = Math.max(12, prefferedRowHeight);\n self.ctx.$scope.prefferedRowHeight = prefferedRowHeight;\n \n var ratio = prefferedRowHeight/32;\n \n var css = '.gpio-left-label, .gpio-right-label {\\n' +\n ' font-size: ' + 16*ratio+'px;\\n'+\n '}\\n';\n var pinsFontSize = Math.max(9, 12*ratio);\n css += '.pin {\\n' +\n ' font-size: ' + pinsFontSize+'px;\\n'+\n '}\\n';\n \n cssParser.createStyleElement(namespace, css); \n \n self.ctx.detectChanges();\n}\n\nself.onDestroy = function() {\n}\n",
|
||||
"settingsSchema": "",
|
||||
@ -57,7 +57,7 @@
|
||||
"sizeX": 7,
|
||||
"sizeY": 10.5,
|
||||
"resources": [],
|
||||
"templateHtml": "<div class=\"gpio-panel\" style=\"height: 100%;\">\n <section fxLayout=\"row\" *ngFor=\"let row of rows\">\n <section fxFlex fxLayout=\"row\" *ngFor=\"let cell of row; let $index = index\">\n <section fxLayout=\"row\" fxFlex *ngIf=\"cell\" fxLayoutAlign=\"{{$index===0 ? 'end center' : 'start center'}}\">\n <span class=\"gpio-left-label\" [fxShow]=\"$index===0\">{{ cell.label }}</span>\n <section fxLayout=\"row\" class=\"led-panel\" [ngClass]=\"$index===0 ? 'col-0' : 'col-1'\"\n [ngStyle]=\"{backgroundColor: ledPanelBackgroundColor}\">\n <span class=\"pin\" [fxShow]=\"$index===0\">{{cell.pin}}</span>\n <span class=\"led-container\">\n <tb-led-light [size]=\"prefferedRowHeight\"\n [colorOn]=\"cell.colorOn\"\n [colorOff]=\"cell.colorOff\"\n [offOpacity]=\"'0.9'\"\n [enabled]=\"cell.enabled\">\n </tb-led-light>\n </span>\n <span class=\"pin\" [fxShow]=\"$index===1\">{{cell.pin}}</span>\n </section>\n <span class=\"gpio-right-label\" [fxShow]=\"$index===1\">{{ cell.label }}</span>\n </section>\n <section fxLayout=\"row\" fxFlex *ngIf=\"!cell\">\n <span fxFlex [fxShow]=\"$index===0\"></span>\n <span class=\"led-panel\"\n [ngStyle]=\"{backgroundColor: ledPanelBackgroundColor}\"></span>\n <span fxFlex [fxShow]=\"$index===1\"></span>\n </section>\n </section>\n </section> \n</div>",
|
||||
"templateHtml": "<div class=\"gpio-panel\" style=\"height: 100%;\">\n <section fxLayout=\"row\" *ngFor=\"let row of rows\">\n <section fxFlex fxLayout=\"row\" *ngFor=\"let cell of row; let $index = index\">\n <section fxLayout=\"row\" fxFlex *ngIf=\"cell\" fxLayoutAlign=\"{{$index===0 ? 'end center' : 'start center'}}\">\n <span class=\"gpio-left-label\" [fxShow]=\"$index===0\">{{ cell.label }}</span>\n <section fxLayout=\"row\" class=\"led-panel\" [ngClass]=\"$index===0 ? 'col-0' : 'col-1'\"\n [ngStyle]=\"{backgroundColor: ledPanelBackgroundColor}\">\n <span class=\"pin\" [fxShow]=\"$index===0\">{{cell.pin}}</span>\n <span class=\"led-container\">\n <tb-led-light [size]=\"prefferedRowHeight\"\n [colorOn]=\"cell.colorOn\"\n [colorOff]=\"cell.colorOff\"\n [offOpacity]=\"'0.9'\"\n [enabled]=\"cell.enabled\">\n </tb-led-light>\n </span>\n <span class=\"pin\" [fxShow]=\"$index===1\">{{cell.pin}}</span>\n </section>\n <span class=\"gpio-right-label\" [fxShow]=\"$index===1\">{{ cell.label }}</span>\n </section>\n <section fxLayout=\"row\" fxFlex *ngIf=\"!cell\">\n <span fxFlex [fxShow]=\"$index===0\"></span>\n <span class=\"led-panel\"\n [ngStyle]=\"{height: prefferedRowHeight+'px', backgroundColor: ledPanelBackgroundColor}\"></span>\n <span fxFlex [fxShow]=\"$index===1\"></span>\n </section>\n </section>\n </section> \n</div>",
|
||||
"templateCss": ".error {\n font-size: 14px !important;\n color: maroon;/*rgb(250,250,250);*/\n background-color: transparent;\n padding: 6px;\n}\n\n.error span {\n margin: auto;\n}\n\n.gpio-panel {\n padding-top: 10px;\n white-space: nowrap;\n}\n\n.gpio-panel section[fxflex] {\n min-width: 0px;\n}\n\n.gpio-panel tb-led-light > div {\n margin: auto;\n}\n\n.led-panel {\n margin: 0;\n width: 66px;\n min-width: 66px;\n}\n\n.led-container {\n width: 48px;\n min-width: 48px;\n}\n\n.pin {\n margin-top: auto;\n margin-bottom: auto;\n color: white;\n font-size: 12px;\n width: 16px;\n min-width: 16px;\n}\n\n.led-panel.col-0 .pin {\n margin-left: auto;\n padding-left: 2px;\n text-align: right;\n}\n\n.led-panel.col-1 .pin {\n margin-right: auto;\n \n text-align: left;\n}\n\n.gpio-left-label {\n margin-right: 8px;\n}\n\n.gpio-right-label {\n margin-left: 8px;\n}",
|
||||
"controllerScript": "var namespace;\nvar cssParser = new cssjs();\n\nself.onInit = function() {\n var utils = self.ctx.$injector.get(self.ctx.servicesMap.get('utils'));\n namespace = 'gpio-panel-' + utils.guid();\n cssParser.testMode = false;\n cssParser.cssPreviewNamespace = namespace;\n self.ctx.$container.addClass(namespace);\n self.ctx.ngZone.run(function() {\n init(); \n });\n}\n\nfunction init() {\n var i, gpio;\n \n var scope = self.ctx.$scope;\n var settings = self.ctx.settings;\n \n scope.gpioList = [];\n scope.gpioByPin = {};\n for (var g = 0; g < settings.gpioList.length; g++) {\n gpio = settings.gpioList[g];\n scope.gpioList.push(\n {\n row: gpio.row,\n col: gpio.col,\n pin: gpio.pin,\n label: gpio.label,\n enabled: false,\n colorOn: tinycolor(gpio.color).lighten(20).toHexString(),\n colorOff: tinycolor(gpio.color).darken().toHexString()\n }\n );\n scope.gpioByPin[gpio.pin] = scope.gpioList[scope.gpioList.length-1];\n }\n\n scope.ledPanelBackgroundColor = settings.ledPanelBackgroundColor || tinycolor('green').lighten(2).toRgbString();\n\n scope.gpioCells = {};\n var rowCount = 0;\n for (i = 0; i < scope.gpioList.length; i++) {\n gpio = scope.gpioList[i];\n scope.gpioCells[gpio.row+'_'+gpio.col] = gpio;\n rowCount = Math.max(rowCount, gpio.row+1);\n }\n \n scope.prefferedRowHeight = 32;\n scope.rows = [];\n for (i = 0; i < rowCount; i++) {\n var row = [];\n for (var c =0; c<2;c++) {\n if (scope.gpioCells[i+'_'+c]) {\n row[c] = scope.gpioCells[i+'_'+c];\n } else {\n row[c] = null;\n }\n }\n scope.rows.push(row);\n } \n \n self.onResize();\n}\n\nself.onDataUpdated = function() {\n var changed = false;\n for (var d = 0; d < self.ctx.data.length; d++) {\n var cellData = self.ctx.data[d];\n var dataKey = cellData.dataKey;\n var gpio = self.ctx.$scope.gpioByPin[dataKey.label];\n if (gpio) {\n var enabled = false;\n if (cellData.data.length > 0) {\n var tvPair = cellData.data[cellData.data.length - 1];\n enabled = (tvPair[1] === true || tvPair[1] === 'true');\n }\n if (gpio.enabled != enabled) {\n changed = true;\n gpio.enabled = enabled;\n }\n }\n }\n if (changed) {\n self.ctx.detectChanges();\n } \n}\n\nself.onResize = function() {\n var rowCount = self.ctx.$scope.rows.length;\n var prefferedRowHeight = (self.ctx.height - 35)/rowCount;\n prefferedRowHeight = Math.min(32, prefferedRowHeight);\n prefferedRowHeight = Math.max(12, prefferedRowHeight);\n self.ctx.$scope.prefferedRowHeight = prefferedRowHeight;\n \n var ratio = prefferedRowHeight/32;\n \n var css = '.gpio-left-label, .gpio-right-label {\\n' +\n ' font-size: ' + 16*ratio+'px;\\n'+\n '}\\n';\n var pinsFontSize = Math.max(9, 12*ratio);\n css += '.pin {\\n' +\n ' font-size: ' + pinsFontSize+'px;\\n'+\n '}\\n';\n \n cssParser.createStyleElement(namespace, css); \n \n self.ctx.detectChanges();\n}\n\nself.onDestroy = function() {\n}\n",
|
||||
"settingsSchema": "",
|
||||
|
||||
2
pom.xml
2
pom.xml
@ -78,7 +78,7 @@
|
||||
<zookeeper.version>3.8.1</zookeeper.version>
|
||||
<protobuf.version>3.21.9</protobuf.version>
|
||||
<grpc.version>1.42.1</grpc.version>
|
||||
<tbel.version>1.0.8</tbel.version>
|
||||
<tbel.version>1.0.9</tbel.version>
|
||||
<lombok.version>1.18.18</lombok.version>
|
||||
<paho.client.version>1.2.4</paho.client.version>
|
||||
<paho.mqttv5.client.version>1.2.5</paho.mqttv5.client.version>
|
||||
|
||||
@ -414,18 +414,19 @@ export const createLabelFromDatasource = (datasource: Datasource, pattern: strin
|
||||
|
||||
export const hasDatasourceLabelsVariables = (pattern: string): boolean => varsRegex.test(pattern) !== null;
|
||||
|
||||
export function formattedDataFormDatasourceData(input: DatasourceData[], dataIndex?: number): FormattedData[] {
|
||||
export function formattedDataFormDatasourceData(input: DatasourceData[], dataIndex?: number, ts?: number): FormattedData[] {
|
||||
return _(input).groupBy(el => el.datasource.entityName + el.datasource.entityType)
|
||||
.values().value().map((entityArray, i) => {
|
||||
const datasource = entityArray[0].datasource;
|
||||
const obj = formattedDataFromDatasource(datasource, i);
|
||||
entityArray.filter(el => el.data.length).forEach(el => {
|
||||
const index = isDefined(dataIndex) ? dataIndex : el.data.length - 1;
|
||||
if (!obj.hasOwnProperty(el.dataKey.label) || el.data[index][1] !== '') {
|
||||
obj[el.dataKey.label] = el.data[index][1];
|
||||
obj[el.dataKey.label + '|ts'] = el.data[index][0];
|
||||
const dataSet = isDefined(ts) ? el.data.find(data => data[0] === ts) : el.data[index];
|
||||
if (dataSet !== undefined && (!obj.hasOwnProperty(el.dataKey.label) || dataSet[1] !== '')) {
|
||||
obj[el.dataKey.label] = dataSet[1];
|
||||
obj[el.dataKey.label + '|ts'] = dataSet[0];
|
||||
if (el.dataKey.label.toLowerCase() === 'type') {
|
||||
obj.deviceType = el.data[index][1];
|
||||
obj.deviceType = dataSet[1];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -60,36 +60,38 @@
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="actions" [stickyEnd]="enableStickyAction">
|
||||
<mat-header-cell *matHeaderCellDef [ngStyle.gt-md]="{ minWidth: (source.timeseriesDatasource.countCellButtonAction * 48) + 'px',
|
||||
maxWidth: (source.timeseriesDatasource.countCellButtonAction * 48) + 'px',
|
||||
width: (source.timeseriesDatasource.countCellButtonAction * 48) + 'px' }">
|
||||
<mat-header-cell *matHeaderCellDef [ngStyle.gt-md]="{ minWidth: (source.timeseriesDatasource.countCellButtonAction * 40) + 'px',
|
||||
maxWidth: (source.timeseriesDatasource.countCellButtonAction * 40) + 'px',
|
||||
width: (source.timeseriesDatasource.countCellButtonAction * 40) + 'px' }">
|
||||
</mat-header-cell>
|
||||
<mat-cell *matCellDef="let entity; let row = index" [style]="rowStyle(source, entity, row)" [ngStyle.gt-md]="{ minWidth: (source.timeseriesDatasource.countCellButtonAction * 48) + 'px',
|
||||
maxWidth: (source.timeseriesDatasource.countCellButtonAction * 48) + 'px',
|
||||
width: (source.timeseriesDatasource.countCellButtonAction * 48) + 'px' }">
|
||||
<mat-cell *matCellDef="let row; let rowIndex = index" [style]="rowStyle(source, row, rowIndex)" [ngStyle.gt-md]="{ minWidth: (source.timeseriesDatasource.countCellButtonAction * 40) + 'px',
|
||||
maxWidth: (source.timeseriesDatasource.countCellButtonAction * 40) + 'px',
|
||||
width: (source.timeseriesDatasource.countCellButtonAction * 40) + 'px' }">
|
||||
<div [fxHide]="showCellActionsMenu && source.timeseriesDatasource.countCellButtonAction !== 1" fxShow.gt-md fxFlex fxLayout="row" fxLayoutAlign="end">
|
||||
<ng-container *ngFor="let actionDescriptor of row.actionCellButtons; trackBy: trackByActionCellDescriptionId">
|
||||
<span *ngIf="!actionDescriptor.icon" style="width: 48px;"></span>
|
||||
<span *ngIf="!actionDescriptor.icon" style="width: 40px;"></span>
|
||||
<button *ngIf="actionDescriptor.icon"
|
||||
class="tb-mat-40"
|
||||
mat-icon-button [disabled]="isLoading$ | async"
|
||||
matTooltip="{{ actionDescriptor.displayName }}"
|
||||
matTooltipPosition="above"
|
||||
(click)="onActionButtonClick($event, entity, actionDescriptor)">
|
||||
(click)="onActionButtonClick($event, row, actionDescriptor)">
|
||||
<mat-icon>{{actionDescriptor.icon}}</mat-icon>
|
||||
</button>
|
||||
</ng-container>
|
||||
</div>
|
||||
<div fxHide [fxShow.lt-lg]="showCellActionsMenu && source.timeseriesDatasource.countCellButtonAction !== 1" *ngIf="entity.hasActions">
|
||||
<div fxHide [fxShow.lt-lg]="showCellActionsMenu && source.timeseriesDatasource.countCellButtonAction !== 1" *ngIf="row.hasActions">
|
||||
<button mat-icon-button
|
||||
class="tb-mat-40"
|
||||
(click)="$event.stopPropagation(); ctx.detectChanges();"
|
||||
[matMenuTriggerFor]="cellActionsMenu">
|
||||
<mat-icon class="material-icons">more_vert</mat-icon>
|
||||
</button>
|
||||
<mat-menu #cellActionsMenu="matMenu" xPosition="before">
|
||||
<ng-container *ngFor="let actionDescriptor of entity.actionCellButtons; trackBy: trackByActionCellDescriptionId">
|
||||
<ng-container *ngFor="let actionDescriptor of row.actionCellButtons; trackBy: trackByActionCellDescriptionId">
|
||||
<button mat-menu-item *ngIf="actionDescriptor.icon"
|
||||
[disabled]="isLoading$ | async"
|
||||
(click)="onActionButtonClick($event, entity, actionDescriptor)">
|
||||
(click)="onActionButtonClick($event, row, actionDescriptor)">
|
||||
<mat-icon>{{actionDescriptor.icon}}</mat-icon>
|
||||
<span>{{ actionDescriptor.displayName }}</span>
|
||||
</button>
|
||||
|
||||
@ -870,7 +870,7 @@ class TimeseriesDatasource implements DataSource<TimeseriesRow> {
|
||||
const rowsMap: {[timestamp: number]: TimeseriesRow} = {};
|
||||
for (let d = 0; d < data.length; d++) {
|
||||
const columnData = data[d].data;
|
||||
columnData.forEach((cellData, index) => {
|
||||
columnData.forEach((cellData) => {
|
||||
const timestamp = cellData[0];
|
||||
let row = rowsMap[timestamp];
|
||||
if (!row) {
|
||||
@ -879,7 +879,7 @@ class TimeseriesDatasource implements DataSource<TimeseriesRow> {
|
||||
};
|
||||
if (this.cellButtonActions.length) {
|
||||
if (this.usedShowCellActionFunction) {
|
||||
const parsedData = formattedDataFormDatasourceData(data, index);
|
||||
const parsedData = formattedDataFormDatasourceData(data, undefined, timestamp);
|
||||
row.actionCellButtons = prepareTableCellButtonActions(this.widgetContext, this.cellButtonActions,
|
||||
parsedData[0], this.reserveSpaceForHiddenAction);
|
||||
row.hasActions = checkHasActions(row.actionCellButtons);
|
||||
|
||||
@ -342,7 +342,7 @@
|
||||
<span fxFlex></span>
|
||||
<button mat-button
|
||||
[disabled]="(isLoading$ | async)"
|
||||
(click)="close()">{{ closeButtonLabel | translate }}</button>
|
||||
(click)="close()">{{ 'action.close' | translate }}</button>
|
||||
</div>
|
||||
<ng-template #loadingCommand>
|
||||
<div class="tb-loader">
|
||||
|
||||
@ -74,7 +74,6 @@ export class DeviceCheckConnectivityDialogComponent extends
|
||||
|
||||
showDontShowAgain: boolean;
|
||||
dialogTitle: string;
|
||||
closeButtonLabel: string;
|
||||
|
||||
notShowAgain = false;
|
||||
|
||||
@ -99,11 +98,9 @@ export class DeviceCheckConnectivityDialogComponent extends
|
||||
|
||||
if (this.data.afterAdd) {
|
||||
this.dialogTitle = 'device.connectivity.device-created-check-connectivity';
|
||||
this.closeButtonLabel = 'action.skip';
|
||||
this.showDontShowAgain = true;
|
||||
} else {
|
||||
this.dialogTitle = 'device.connectivity.check-connectivity';
|
||||
this.closeButtonLabel = 'action.close';
|
||||
this.showDontShowAgain = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -467,12 +467,13 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev
|
||||
}).afterClosed().subscribe(
|
||||
(res) => {
|
||||
if (res) {
|
||||
this.config.updateData();
|
||||
this.store.pipe(select(selectUserSettingsProperty( 'notDisplayConnectivityAfterAddDevice'))).pipe(
|
||||
take(1)
|
||||
).subscribe((settings: boolean) => {
|
||||
if(!settings) {
|
||||
this.checkConnectivity(null, res.id, true);
|
||||
} else {
|
||||
this.config.updateData();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -734,6 +735,10 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev
|
||||
}
|
||||
})
|
||||
.afterClosed()
|
||||
.subscribe(() => {});
|
||||
.subscribe(() => {
|
||||
if (afterAdd ) {
|
||||
this.config.updateData();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
<div class="tb-image-preview-text" *ngIf="!safeImageUrl && disabled; else elseBlock">{{ 'dashboard.empty-image' | translate }}</div>
|
||||
<ng-template #elseBlock><img class="tb-image-preview" [src]="safeImageUrl" /></ng-template>
|
||||
</div>
|
||||
<button *ngIf="safeImageUrl && !disabled"
|
||||
<button *ngIf="safeImageUrl && showClearButton && !disabled"
|
||||
mat-icon-button color="primary"
|
||||
class="tb-mat-24"
|
||||
type="button"
|
||||
@ -52,7 +52,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button *ngIf="!showPreview && safeImageUrl && !disabled"
|
||||
<button *ngIf="!showPreview && safeImageUrl && showClearButton && !disabled"
|
||||
mat-icon-button color="primary"
|
||||
class="tb-mat-24"
|
||||
type="button"
|
||||
|
||||
@ -65,6 +65,9 @@ export class ImageInputComponent extends PageComponent implements AfterViewInit,
|
||||
@Input()
|
||||
disabled: boolean;
|
||||
|
||||
@Input()
|
||||
showClearButton = true;
|
||||
|
||||
@Input()
|
||||
showPreview = true;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -694,6 +694,10 @@ mat-label {
|
||||
|
||||
.tb-table-widget {
|
||||
.mat-mdc-table {
|
||||
.mat-mdc-row {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.mat-mdc-cell {
|
||||
background: inherit;
|
||||
color: inherit;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user