|
|
1
|
+{
|
|
|
2
|
+ "title": "Firmware",
|
|
|
3
|
+ "image": null,
|
|
|
4
|
+ "mobileHide": false,
|
|
|
5
|
+ "mobileOrder": null,
|
|
|
6
|
+ "configuration": {
|
|
|
7
|
+ "description": "",
|
|
|
8
|
+ "widgets": {
|
|
|
9
|
+ "cd03188e-cd9d-9601-fd57-da4cb95fc016": {
|
|
|
10
|
+ "type": "latest",
|
|
|
11
|
+ "sizeX": 7.5,
|
|
|
12
|
+ "sizeY": 6.5,
|
|
|
13
|
+ "config": {
|
|
|
14
|
+ "timewindow": {
|
|
|
15
|
+ "displayValue": "",
|
|
|
16
|
+ "selectedTab": 0,
|
|
|
17
|
+ "realtime": {
|
|
|
18
|
+ "realtimeType": 1,
|
|
|
19
|
+ "interval": 1000,
|
|
|
20
|
+ "timewindowMs": 86400000,
|
|
|
21
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
22
|
+ },
|
|
|
23
|
+ "history": {
|
|
|
24
|
+ "historyType": 0,
|
|
|
25
|
+ "interval": 1000,
|
|
|
26
|
+ "timewindowMs": 60000,
|
|
|
27
|
+ "fixedTimewindow": {
|
|
|
28
|
+ "startTimeMs": 1694085363133,
|
|
|
29
|
+ "endTimeMs": 1694171763133
|
|
|
30
|
+ },
|
|
|
31
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
32
|
+ },
|
|
|
33
|
+ "aggregation": {
|
|
|
34
|
+ "type": "NONE",
|
|
|
35
|
+ "limit": 200
|
|
|
36
|
+ }
|
|
|
37
|
+ },
|
|
|
38
|
+ "showTitle": true,
|
|
|
39
|
+ "backgroundColor": "rgb(255, 255, 255)",
|
|
|
40
|
+ "color": "rgba(0, 0, 0, 0.87)",
|
|
|
41
|
+ "padding": "4px",
|
|
|
42
|
+ "settings": {
|
|
|
43
|
+ "enableSearch": true,
|
|
|
44
|
+ "displayPagination": true,
|
|
|
45
|
+ "defaultPageSize": 10,
|
|
|
46
|
+ "defaultSortOrder": "entityName",
|
|
|
47
|
+ "displayEntityName": true,
|
|
|
48
|
+ "displayEntityType": false,
|
|
|
49
|
+ "enableSelectColumnDisplay": false,
|
|
|
50
|
+ "enableStickyHeader": true,
|
|
|
51
|
+ "enableStickyAction": false,
|
|
|
52
|
+ "entitiesTitle": "Devices",
|
|
|
53
|
+ "displayEntityLabel": false,
|
|
|
54
|
+ "entityNameColumnTitle": "Device"
|
|
|
55
|
+ },
|
|
|
56
|
+ "title": "New Entities table",
|
|
|
57
|
+ "dropShadow": true,
|
|
|
58
|
+ "enableFullscreen": true,
|
|
|
59
|
+ "titleStyle": {
|
|
|
60
|
+ "fontSize": "16px",
|
|
|
61
|
+ "fontWeight": 400,
|
|
|
62
|
+ "padding": "5px 10px 5px 10px"
|
|
|
63
|
+ },
|
|
|
64
|
+ "useDashboardTimewindow": false,
|
|
|
65
|
+ "showLegend": false,
|
|
|
66
|
+ "datasources": [
|
|
|
67
|
+ {
|
|
|
68
|
+ "type": "entity",
|
|
|
69
|
+ "name": null,
|
|
|
70
|
+ "entityAliasId": "639da5b4-31f0-0151-6282-c37a3897b7e8",
|
|
|
71
|
+ "filterId": "8fdb88d0-50ac-2232-fdb7-69c30c16544e",
|
|
|
72
|
+ "dataKeys": [
|
|
|
73
|
+ {
|
|
|
74
|
+ "name": "current_fw_title",
|
|
|
75
|
+ "type": "timeseries",
|
|
|
76
|
+ "label": "Current FW title",
|
|
|
77
|
+ "color": "#2196f3",
|
|
|
78
|
+ "settings": {
|
|
|
79
|
+ "columnWidth": "0px",
|
|
|
80
|
+ "useCellStyleFunction": false,
|
|
|
81
|
+ "cellStyleFunction": "",
|
|
|
82
|
+ "useCellContentFunction": false,
|
|
|
83
|
+ "defaultColumnVisibility": "visible",
|
|
|
84
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
85
|
+ },
|
|
|
86
|
+ "_hash": 0.09545533885166413,
|
|
|
87
|
+ "units": null,
|
|
|
88
|
+ "decimals": null,
|
|
|
89
|
+ "funcBody": null,
|
|
|
90
|
+ "usePostProcessing": null,
|
|
|
91
|
+ "postFuncBody": null
|
|
|
92
|
+ },
|
|
|
93
|
+ {
|
|
|
94
|
+ "name": "current_fw_version",
|
|
|
95
|
+ "type": "timeseries",
|
|
|
96
|
+ "label": "Current FW version",
|
|
|
97
|
+ "color": "#4caf50",
|
|
|
98
|
+ "settings": {
|
|
|
99
|
+ "columnWidth": "0px",
|
|
|
100
|
+ "useCellStyleFunction": false,
|
|
|
101
|
+ "cellStyleFunction": "",
|
|
|
102
|
+ "useCellContentFunction": false,
|
|
|
103
|
+ "defaultColumnVisibility": "visible",
|
|
|
104
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
105
|
+ },
|
|
|
106
|
+ "_hash": 0.7206056602328659,
|
|
|
107
|
+ "units": null,
|
|
|
108
|
+ "decimals": null,
|
|
|
109
|
+ "funcBody": null,
|
|
|
110
|
+ "usePostProcessing": null,
|
|
|
111
|
+ "postFuncBody": null
|
|
|
112
|
+ },
|
|
|
113
|
+ {
|
|
|
114
|
+ "name": "target_fw_title",
|
|
|
115
|
+ "type": "timeseries",
|
|
|
116
|
+ "label": "Target FW title",
|
|
|
117
|
+ "color": "#ffc107",
|
|
|
118
|
+ "settings": {
|
|
|
119
|
+ "columnWidth": "0px",
|
|
|
120
|
+ "useCellStyleFunction": false,
|
|
|
121
|
+ "cellStyleFunction": "",
|
|
|
122
|
+ "useCellContentFunction": false,
|
|
|
123
|
+ "defaultColumnVisibility": "visible",
|
|
|
124
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
125
|
+ },
|
|
|
126
|
+ "_hash": 0.9934225682766313,
|
|
|
127
|
+ "units": null,
|
|
|
128
|
+ "decimals": null,
|
|
|
129
|
+ "funcBody": null,
|
|
|
130
|
+ "usePostProcessing": null,
|
|
|
131
|
+ "postFuncBody": null
|
|
|
132
|
+ },
|
|
|
133
|
+ {
|
|
|
134
|
+ "name": "target_fw_version",
|
|
|
135
|
+ "type": "timeseries",
|
|
|
136
|
+ "label": "Target FW version",
|
|
|
137
|
+ "color": "#607d8b",
|
|
|
138
|
+ "settings": {
|
|
|
139
|
+ "columnWidth": "0px",
|
|
|
140
|
+ "useCellStyleFunction": false,
|
|
|
141
|
+ "cellStyleFunction": "",
|
|
|
142
|
+ "useCellContentFunction": false,
|
|
|
143
|
+ "cellContentFunction": "",
|
|
|
144
|
+ "defaultColumnVisibility": "visible",
|
|
|
145
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
146
|
+ },
|
|
|
147
|
+ "_hash": 0.5251724416842531,
|
|
|
148
|
+ "units": null,
|
|
|
149
|
+ "decimals": null,
|
|
|
150
|
+ "funcBody": null,
|
|
|
151
|
+ "usePostProcessing": null,
|
|
|
152
|
+ "postFuncBody": null
|
|
|
153
|
+ },
|
|
|
154
|
+ {
|
|
|
155
|
+ "name": "target_fw_ts",
|
|
|
156
|
+ "type": "timeseries",
|
|
|
157
|
+ "label": "Target FW set time",
|
|
|
158
|
+ "color": "#e91e63",
|
|
|
159
|
+ "settings": {
|
|
|
160
|
+ "columnWidth": "0px",
|
|
|
161
|
+ "useCellStyleFunction": false,
|
|
|
162
|
+ "cellStyleFunction": "",
|
|
|
163
|
+ "useCellContentFunction": true,
|
|
|
164
|
+ "defaultColumnVisibility": "visible",
|
|
|
165
|
+ "columnSelectionToDisplay": "enabled",
|
|
|
166
|
+ "cellContentFunction": "if (value !== '') {\n return ctx.date.transform(value, 'yyyy-MM-dd HH:mm:ss');\n}\nreturn '';"
|
|
|
167
|
+ },
|
|
|
168
|
+ "_hash": 0.31823244858578237,
|
|
|
169
|
+ "units": null,
|
|
|
170
|
+ "decimals": null,
|
|
|
171
|
+ "funcBody": null,
|
|
|
172
|
+ "usePostProcessing": null,
|
|
|
173
|
+ "postFuncBody": null
|
|
|
174
|
+ },
|
|
|
175
|
+ {
|
|
|
176
|
+ "name": "fw_state",
|
|
|
177
|
+ "type": "timeseries",
|
|
|
178
|
+ "label": "Progress",
|
|
|
179
|
+ "color": "#9c27b0",
|
|
|
180
|
+ "settings": {
|
|
|
181
|
+ "columnWidth": "30%",
|
|
|
182
|
+ "useCellStyleFunction": true,
|
|
|
183
|
+ "useCellContentFunction": true,
|
|
|
184
|
+ "defaultColumnVisibility": "visible",
|
|
|
185
|
+ "columnSelectionToDisplay": "enabled",
|
|
|
186
|
+ "cellStyleFunction": "return {\n 'padding-right': '30px'\n}",
|
|
|
187
|
+ "cellContentFunction": "if (value !== '') {\n var mapProgress = {\n 'QUEUED': 0,\n 'INITIATED': 5,\n 'DOWNLOADING': 10,\n 'DOWNLOADED': 55,\n 'VERIFIED': 60,\n 'UPDATING': 70,\n 'FAILED': 99,\n 'UPDATED': 100\n }\n var color = 'mat-primary';\n var progress = mapProgress[value];\n if (value == 'FAILED') {\n color = 'mat-accent';\n }\n return `<mat-progress-bar style=\"height: 8px\" role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\" tabindex=\"-1\" mode=\"determinate\" value=\"${progress}\" class=\"mat-progress-bar ${color}\" aria-valuenow=\"${progress}\"><div aria-hidden=\"true\"><svg width=\"100%\" height=\"8\" focusable=\"false\" class=\"mat-progress-bar-background mat-progress-bar-element\"><defs><pattern x=\"4\" y=\"0\" width=\"8\" height=\"4\" patternUnits=\"userSpaceOnUse\" id=\"mat-progress-bar-0\"><circle cx=\"2\" cy=\"2\" r=\"2\"></circle></pattern></defs><rect width=\"100%\" height=\"100%\" fill=\"url(\"/components/progress-bar/overview#mat-progress-bar-0\")\"></rect></svg><div class=\"mat-progress-bar-buffer mat-progress-bar-element\"></div><div class=\"mat-progress-bar-primary mat-progress-bar-fill mat-progress-bar-element\" style=\"transform: scale3d(${progress / 100}, 1, 1);\"></div><div class=\"mat-progress-bar-secondary mat-progress-bar-fill mat-progress-bar-element\"></div></div></mat-progress-bar>`;\n}"
|
|
|
188
|
+ },
|
|
|
189
|
+ "_hash": 0.8174211757846257,
|
|
|
190
|
+ "units": null,
|
|
|
191
|
+ "decimals": null,
|
|
|
192
|
+ "funcBody": null,
|
|
|
193
|
+ "usePostProcessing": null,
|
|
|
194
|
+ "postFuncBody": null
|
|
|
195
|
+ },
|
|
|
196
|
+ {
|
|
|
197
|
+ "name": "fw_state",
|
|
|
198
|
+ "type": "timeseries",
|
|
|
199
|
+ "label": "Status",
|
|
|
200
|
+ "color": "#f44336",
|
|
|
201
|
+ "settings": {
|
|
|
202
|
+ "columnWidth": "130px",
|
|
|
203
|
+ "useCellStyleFunction": true,
|
|
|
204
|
+ "useCellContentFunction": true,
|
|
|
205
|
+ "defaultColumnVisibility": "visible",
|
|
|
206
|
+ "columnSelectionToDisplay": "enabled",
|
|
|
207
|
+ "cellStyleFunction": "if (value == 'FAILED') {\n return {'color' : '#D93025'};\n}\nreturn {};",
|
|
|
208
|
+ "cellContentFunction": "function icon(value) {\n if (value == 'QUEUED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000;\"><svg style=\"width:24px;height:24px\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M6,2V8H6V8L10,12L6,16V16H6V22H18V16H18V16L14,12L18,8V8H18V2H6M16,16.5V20H8V16.5L12,12.5L16,16.5M12,11.5L8,7.5V4H16V7.5L12,11.5Z\" /></svg></mat-icon>';\n }\n if (value == 'INITIATED' || value == 'DOWNLOADING' || value == 'DOWNLOADED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000\"><svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.74 2.1951C11.63 1.2876 10.2575 0.687598 8.75 0.537598V2.0526C9.845 2.1876 10.8425 2.6226 11.675 3.2676L12.74 2.1951ZM13.9475 7.2501H15.4625C15.3125 5.7426 14.7125 4.3701 13.805 3.2601L12.7325 4.3251C13.3775 5.1576 13.8125 6.1551 13.9475 7.2501ZM12.7325 11.6751L13.805 12.7476C14.7125 11.6376 15.3125 10.2576 15.4625 8.7576H13.9475C13.8125 9.8451 13.3775 10.8426 12.7325 11.6751ZM8.75 13.9476V15.4626C10.2575 15.3126 11.63 14.7126 12.74 13.8051L11.6675 12.7326C10.8425 13.3776 9.845 13.8126 8.75 13.9476ZM8.75 8.0001V4.2501H7.25V8.0001H4.25L8 11.7501L11.75 8.0001H8.75ZM7.25 13.9476V15.4626C3.4625 15.0876 0.5 11.8926 0.5 8.0001C0.5 4.1076 3.4625 0.912598 7.25 0.537598V2.0526C4.2875 2.4201 2 4.9401 2 8.0001C2 11.0601 4.2875 13.5801 7.25 13.9476Z\" fill=\"black\"/></svg></mat-icon>';\n }\n if (value == 'VERIFIED' || value == 'UPDATING' ) {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000\">update</mat-icon>';\n }\n if (value == 'UPDATED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000\"><svg style=\"width:22px;height:22px\" viewBox=\"0 0 34 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M33.26 2.82L30.44 0L12.06 18.38L3.55999 9.9L0.73999 12.72L12.06 24.04L33.26 2.82Z\" fill=\"black\"/><path d=\"M31 28H3V32H31V28Z\" fill=\"black\"/></svg></mat-icon>';\n }\n if (value == 'FAILED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #D93025\">warning</mat-icon>';\n }\n return '';\n}\nfunction capitalize (s) {\n if (typeof s !== 'string') return '';\n return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nreturn icon(value) + '<span style=\"vertical-align: super;padding-left: 8px;\">' + capitalize(value) + '</span>';"
|
|
|
209
|
+ },
|
|
|
210
|
+ "_hash": 0.7764426948615217,
|
|
|
211
|
+ "units": null,
|
|
|
212
|
+ "decimals": null,
|
|
|
213
|
+ "funcBody": null,
|
|
|
214
|
+ "usePostProcessing": null,
|
|
|
215
|
+ "postFuncBody": null
|
|
|
216
|
+ },
|
|
|
217
|
+ {
|
|
|
218
|
+ "name": "fw_checksum",
|
|
|
219
|
+ "type": "attribute",
|
|
|
220
|
+ "label": "fw_checksum",
|
|
|
221
|
+ "color": "#3f51b5",
|
|
|
222
|
+ "settings": {
|
|
|
223
|
+ "columnWidth": "0px",
|
|
|
224
|
+ "useCellStyleFunction": false,
|
|
|
225
|
+ "cellStyleFunction": "",
|
|
|
226
|
+ "useCellContentFunction": false,
|
|
|
227
|
+ "defaultColumnVisibility": "hidden",
|
|
|
228
|
+ "columnSelectionToDisplay": "disabled"
|
|
|
229
|
+ },
|
|
|
230
|
+ "_hash": 0.5594087842471693,
|
|
|
231
|
+ "units": null,
|
|
|
232
|
+ "decimals": null,
|
|
|
233
|
+ "funcBody": null,
|
|
|
234
|
+ "usePostProcessing": null,
|
|
|
235
|
+ "postFuncBody": null
|
|
|
236
|
+ },
|
|
|
237
|
+ {
|
|
|
238
|
+ "name": "fw_url",
|
|
|
239
|
+ "type": "attribute",
|
|
|
240
|
+ "label": "fw_url",
|
|
|
241
|
+ "color": "#e91e63",
|
|
|
242
|
+ "settings": {
|
|
|
243
|
+ "columnWidth": "0px",
|
|
|
244
|
+ "useCellStyleFunction": false,
|
|
|
245
|
+ "cellStyleFunction": "",
|
|
|
246
|
+ "useCellContentFunction": false,
|
|
|
247
|
+ "cellContentFunction": "",
|
|
|
248
|
+ "defaultColumnVisibility": "hidden",
|
|
|
249
|
+ "columnSelectionToDisplay": "disabled"
|
|
|
250
|
+ },
|
|
|
251
|
+ "_hash": 0.4204673738685043,
|
|
|
252
|
+ "units": null,
|
|
|
253
|
+ "decimals": null,
|
|
|
254
|
+ "funcBody": null,
|
|
|
255
|
+ "usePostProcessing": null,
|
|
|
256
|
+ "postFuncBody": null
|
|
|
257
|
+ }
|
|
|
258
|
+ ]
|
|
|
259
|
+ }
|
|
|
260
|
+ ],
|
|
|
261
|
+ "actions": {
|
|
|
262
|
+ "actionCellButton": [
|
|
|
263
|
+ {
|
|
|
264
|
+ "name": "History firmware update",
|
|
|
265
|
+ "icon": "history",
|
|
|
266
|
+ "type": "openDashboardState",
|
|
|
267
|
+ "targetDashboardStateId": "device_firmware_history",
|
|
|
268
|
+ "setEntityId": true,
|
|
|
269
|
+ "stateEntityParamName": null,
|
|
|
270
|
+ "openInSeparateDialog": false,
|
|
|
271
|
+ "dialogTitle": "",
|
|
|
272
|
+ "dialogHideDashboardToolbar": true,
|
|
|
273
|
+ "dialogWidth": null,
|
|
|
274
|
+ "dialogHeight": null,
|
|
|
275
|
+ "openRightLayout": false,
|
|
|
276
|
+ "id": "98a1406c-3301-bc2f-2c5d-d637ce3b663b"
|
|
|
277
|
+ },
|
|
|
278
|
+ {
|
|
|
279
|
+ "name": "Edit firmware",
|
|
|
280
|
+ "icon": "edit",
|
|
|
281
|
+ "type": "customPretty",
|
|
|
282
|
+ "customHtml": "<form #editEntityForm=\"ngForm\" [formGroup]=\"editEntityFormGroup\"\n (ngSubmit)=\"save()\" class=\"edit-entity-form\">\n <mat-toolbar fxLayout=\"row\" color=\"primary\">\n <h2>Edit firmware {{entityName}}</h2>\n <span fxFlex></span>\n <button mat-icon-button (click)=\"cancel()\" type=\"button\">\n <mat-icon class=\"material-icons\">close</mat-icon>\n </button>\n </mat-toolbar>\n <mat-progress-bar color=\"warn\" mode=\"indeterminate\" *ngIf=\"isLoading$ | async\">\n </mat-progress-bar>\n <div style=\"height: 4px;\" *ngIf=\"!(isLoading$ | async)\"></div>\n <div *ngIf=\"entity.deviceProfileId\" mat-dialog-content fxLayout=\"column\">\n <tb-ota-package-autocomplete\n [useFullEntityId]=\"true\"\n [deviceProfileId]=\"entity.deviceProfileId.id\"\n formControlName=\"firmwareId\">\n </tb-ota-package-autocomplete>\n </div>\n <div mat-dialog-actions fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button mat-button color=\"primary\"\n type=\"button\"\n [disabled]=\"(isLoading$ | async)\"\n (click)=\"cancel()\" cdkFocusInitial>\n Cancel\n </button>\n <button mat-button mat-raised-button color=\"primary\"\n type=\"submit\"\n [disabled]=\"(isLoading$ | async) || editEntityForm.invalid || !editEntityForm.dirty\">\n Save\n </button>\n </div>\n</form>",
|
|
|
283
|
+ "customCss": "form {\n min-width: 300px !important;\n}",
|
|
|
284
|
+ "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\n\nopenEditEntityDialog();\n\nfunction openEditEntityDialog() {\n customDialog.customDialog(htmlTemplate, EditEntityDialogController).subscribe();\n}\n\nfunction EditEntityDialogController(instance) {\n let vm = instance;\n\n vm.entityName = entityName;\n vm.entity = {};\n\n vm.editEntityFormGroup = vm.fb.group({\n firmwareId: [null]\n });\n\n getEntityInfo();\n\n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n\n vm.save = function() {\n vm.editEntityFormGroup.markAsPristine();\n saveEntity().subscribe(\n function () {\n // widgetContext.updateAliases();\n vm.dialogRef.close(null);\n }\n );\n };\n\n\n function getEntityInfo() {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n vm.entity = data;\n vm.editEntityFormGroup.patchValue({\n firmwareId: vm.entity.firmwareId\n }, {emitEvent: false});\n }\n );\n }\n\n function saveEntity() {\n const formValues = vm.editEntityFormGroup.value;\n vm.entity.firmwareId = formValues.firmwareId;\n return deviceService.saveDevice(vm.entity);\n }\n}",
|
|
|
285
|
+ "customResources": [],
|
|
|
286
|
+ "id": "23099c1d-454b-25dc-8bc0-7cf33c21c5d5"
|
|
|
287
|
+ },
|
|
|
288
|
+ {
|
|
|
289
|
+ "name": "Download firmware",
|
|
|
290
|
+ "icon": "file_download",
|
|
|
291
|
+ "type": "custom",
|
|
|
292
|
+ "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet otaPackageService = $injector.get(widgetContext.servicesMap.get('otaPackageService'));\nlet deviceProfileService = $injector.get(widgetContext.servicesMap.get('deviceProfileService'));\n\ngetDeviceFirmware();\n\nfunction getDeviceFirmware() {\n var entityIdValue = entityId.id;\n var data = widgetContext.data.find((el) => el.datasource.entityId === entityIdValue && el.dataKey.name === 'fw_url');\n var url = data.data[0][1];\n if (url === '') {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n if (data.firmwareId !== null) {\n otaPackageService.downloadOtaPackage(data.firmwareId.id).subscribe(); \n } else {\n deviceProfileService.getDeviceProfile(data.deviceProfileId.id).subscribe(\n function (deviceProfile) {\n if (deviceProfile.firmwareId !== null) {\n otaPackageService.downloadOtaPackage(deviceProfile.firmwareId.id).subscribe();\n } else {\n widgetContext.showToast('warn', 'Device ' + entityName +' has not firmware set.', 2000, 'top');\n }\n });\n }\n }\n );\n } else {\n widgetContext.showToast('warn', 'Device ' + entityName +' has not firmware set.', 2000, 'top');\n }\n}",
|
|
|
293
|
+ "id": "12533058-42f6-e75f-620c-219c48d01ec0"
|
|
|
294
|
+ },
|
|
|
295
|
+ {
|
|
|
296
|
+ "name": "Copy checksum/URL",
|
|
|
297
|
+ "icon": "content_copy",
|
|
|
298
|
+ "type": "custom",
|
|
|
299
|
+ "customFunction": "function copyToClipboard(text) {\n if (window.clipboardData && window.clipboardData.setData) {\n return window.clipboardData.setData(\"Text\", text);\n\n }\n else if (document.queryCommandSupported && document.queryCommandSupported(\"copy\")) {\n var textarea = document.createElement(\"textarea\");\n textarea.textContent = text;\n textarea.style.position = \"fixed\";\n document.body.appendChild(textarea);\n textarea.select();\n try {\n return document.execCommand(\"copy\");\n }\n catch (ex) {\n console.warn(\"Copy to clipboard failed.\", ex);\n return false;\n }\n document.body.removeChild(textarea);\n }\n}\nvar entityIdValue = entityId.id;\nvar data = widgetContext.data.find((el) => el.datasource.entityId === entityIdValue && el.dataKey.name === 'fw_checksum');\nvar checksum = data.data[0][1];\nif (checksum !== '') {\n copyToClipboard(checksum);\n widgetContext.showSuccessToast('Firmware checksum has been copied to clipboard', 2000, 'top');\n} else {\n data = widgetContext.data.find((el) => el.datasource.entityId === entityIdValue && el.dataKey.name === 'fw_url');\n var url = data.data[0][1];\n if (url !== '') {\n copyToClipboard(url);\n widgetContext.showSuccessToast('Firmware direct URL has been copied to clipboard', 2000, 'top');\n } else {\n widgetContext.showToast('warn', 'Device ' + entityName +' has not firmware set.', 2000, 'top');\n }\n}",
|
|
|
300
|
+ "id": "09323079-7111-87f7-90d1-c62cd7d85dc7"
|
|
|
301
|
+ }
|
|
|
302
|
+ ]
|
|
|
303
|
+ },
|
|
|
304
|
+ "showTitleIcon": false,
|
|
|
305
|
+ "iconColor": "rgba(0, 0, 0, 0.87)",
|
|
|
306
|
+ "iconSize": "24px",
|
|
|
307
|
+ "titleTooltip": "",
|
|
|
308
|
+ "widgetStyle": {}
|
|
|
309
|
+ },
|
|
|
310
|
+ "row": 0,
|
|
|
311
|
+ "col": 0,
|
|
|
312
|
+ "id": "cd03188e-cd9d-9601-fd57-da4cb95fc016",
|
|
|
313
|
+ "typeFullFqn": "system.cards.entities_table"
|
|
|
314
|
+ },
|
|
|
315
|
+ "100b756c-0082-6505-3ae1-3603e6deea48": {
|
|
|
316
|
+ "type": "timeseries",
|
|
|
317
|
+ "sizeX": 8,
|
|
|
318
|
+ "sizeY": 6.5,
|
|
|
319
|
+ "config": {
|
|
|
320
|
+ "datasources": [
|
|
|
321
|
+ {
|
|
|
322
|
+ "type": "entity",
|
|
|
323
|
+ "name": null,
|
|
|
324
|
+ "entityAliasId": "19f41c21-d9af-e666-8f50-e1748778f955",
|
|
|
325
|
+ "filterId": null,
|
|
|
326
|
+ "dataKeys": [
|
|
|
327
|
+ {
|
|
|
328
|
+ "name": "current_fw_title",
|
|
|
329
|
+ "type": "timeseries",
|
|
|
330
|
+ "label": "Current firmware title",
|
|
|
331
|
+ "color": "#2196f3",
|
|
|
332
|
+ "settings": {
|
|
|
333
|
+ "useCellStyleFunction": false,
|
|
|
334
|
+ "cellStyleFunction": "",
|
|
|
335
|
+ "useCellContentFunction": false,
|
|
|
336
|
+ "cellContentFunction": ""
|
|
|
337
|
+ },
|
|
|
338
|
+ "_hash": 0.5978079905579401,
|
|
|
339
|
+ "units": null,
|
|
|
340
|
+ "decimals": null,
|
|
|
341
|
+ "funcBody": null,
|
|
|
342
|
+ "usePostProcessing": null,
|
|
|
343
|
+ "postFuncBody": null
|
|
|
344
|
+ },
|
|
|
345
|
+ {
|
|
|
346
|
+ "name": "current_fw_version",
|
|
|
347
|
+ "type": "timeseries",
|
|
|
348
|
+ "label": "Current firmware version",
|
|
|
349
|
+ "color": "#4caf50",
|
|
|
350
|
+ "settings": {
|
|
|
351
|
+ "useCellStyleFunction": false,
|
|
|
352
|
+ "cellStyleFunction": "",
|
|
|
353
|
+ "useCellContentFunction": false,
|
|
|
354
|
+ "cellContentFunction": ""
|
|
|
355
|
+ },
|
|
|
356
|
+ "_hash": 0.027392025058568192,
|
|
|
357
|
+ "units": null,
|
|
|
358
|
+ "decimals": null,
|
|
|
359
|
+ "funcBody": null,
|
|
|
360
|
+ "usePostProcessing": null,
|
|
|
361
|
+ "postFuncBody": null
|
|
|
362
|
+ },
|
|
|
363
|
+ {
|
|
|
364
|
+ "name": "target_fw_title",
|
|
|
365
|
+ "type": "timeseries",
|
|
|
366
|
+ "label": "Target firmware title",
|
|
|
367
|
+ "color": "#f44336",
|
|
|
368
|
+ "settings": {
|
|
|
369
|
+ "useCellStyleFunction": false,
|
|
|
370
|
+ "cellStyleFunction": "",
|
|
|
371
|
+ "useCellContentFunction": false,
|
|
|
372
|
+ "cellContentFunction": ""
|
|
|
373
|
+ },
|
|
|
374
|
+ "_hash": 0.9496350796287059,
|
|
|
375
|
+ "units": null,
|
|
|
376
|
+ "decimals": null,
|
|
|
377
|
+ "funcBody": null,
|
|
|
378
|
+ "usePostProcessing": null,
|
|
|
379
|
+ "postFuncBody": null
|
|
|
380
|
+ },
|
|
|
381
|
+ {
|
|
|
382
|
+ "name": "target_fw_version",
|
|
|
383
|
+ "type": "timeseries",
|
|
|
384
|
+ "label": "Target firmware version",
|
|
|
385
|
+ "color": "#ffc107",
|
|
|
386
|
+ "settings": {
|
|
|
387
|
+ "useCellStyleFunction": false,
|
|
|
388
|
+ "cellStyleFunction": "",
|
|
|
389
|
+ "useCellContentFunction": false,
|
|
|
390
|
+ "cellContentFunction": ""
|
|
|
391
|
+ },
|
|
|
392
|
+ "_hash": 0.6734152252264187,
|
|
|
393
|
+ "units": null,
|
|
|
394
|
+ "decimals": null,
|
|
|
395
|
+ "funcBody": null,
|
|
|
396
|
+ "usePostProcessing": null,
|
|
|
397
|
+ "postFuncBody": null
|
|
|
398
|
+ },
|
|
|
399
|
+ {
|
|
|
400
|
+ "name": "fw_state",
|
|
|
401
|
+ "type": "timeseries",
|
|
|
402
|
+ "label": "Status",
|
|
|
403
|
+ "color": "#607d8b",
|
|
|
404
|
+ "settings": {
|
|
|
405
|
+ "useCellStyleFunction": false,
|
|
|
406
|
+ "cellStyleFunction": "",
|
|
|
407
|
+ "useCellContentFunction": false,
|
|
|
408
|
+ "cellContentFunction": ""
|
|
|
409
|
+ },
|
|
|
410
|
+ "_hash": 0.2983399718643074,
|
|
|
411
|
+ "units": null,
|
|
|
412
|
+ "decimals": null,
|
|
|
413
|
+ "funcBody": null,
|
|
|
414
|
+ "usePostProcessing": true,
|
|
|
415
|
+ "postFuncBody": "function capitalize (s) {\n if (typeof s !== 'string') return '';\n return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\nif (value !== '') {\n return capitalize(value);\n}\nreturn value;"
|
|
|
416
|
+ }
|
|
|
417
|
+ ]
|
|
|
418
|
+ }
|
|
|
419
|
+ ],
|
|
|
420
|
+ "timewindow": {
|
|
|
421
|
+ "hideInterval": false,
|
|
|
422
|
+ "hideAggregation": false,
|
|
|
423
|
+ "hideAggInterval": false,
|
|
|
424
|
+ "hideTimezone": false,
|
|
|
425
|
+ "selectedTab": 0,
|
|
|
426
|
+ "realtime": {
|
|
|
427
|
+ "realtimeType": 0,
|
|
|
428
|
+ "timewindowMs": 2592000000,
|
|
|
429
|
+ "quickInterval": "CURRENT_DAY",
|
|
|
430
|
+ "interval": 1000
|
|
|
431
|
+ },
|
|
|
432
|
+ "aggregation": {
|
|
|
433
|
+ "type": "NONE",
|
|
|
434
|
+ "limit": 200
|
|
|
435
|
+ }
|
|
|
436
|
+ },
|
|
|
437
|
+ "showTitle": false,
|
|
|
438
|
+ "backgroundColor": "rgb(255, 255, 255)",
|
|
|
439
|
+ "color": "rgba(0, 0, 0, 0.87)",
|
|
|
440
|
+ "padding": "8px",
|
|
|
441
|
+ "settings": {
|
|
|
442
|
+ "showTimestamp": true,
|
|
|
443
|
+ "displayPagination": true,
|
|
|
444
|
+ "defaultPageSize": 10,
|
|
|
445
|
+ "enableSearch": true,
|
|
|
446
|
+ "enableStickyHeader": true,
|
|
|
447
|
+ "enableStickyAction": true
|
|
|
448
|
+ },
|
|
|
449
|
+ "title": "Firmware history",
|
|
|
450
|
+ "dropShadow": false,
|
|
|
451
|
+ "enableFullscreen": false,
|
|
|
452
|
+ "titleStyle": {
|
|
|
453
|
+ "fontSize": "16px",
|
|
|
454
|
+ "fontWeight": 400,
|
|
|
455
|
+ "padding": "5px 10px 5px 10px"
|
|
|
456
|
+ },
|
|
|
457
|
+ "useDashboardTimewindow": false,
|
|
|
458
|
+ "showLegend": false,
|
|
|
459
|
+ "widgetStyle": {},
|
|
|
460
|
+ "actions": {},
|
|
|
461
|
+ "showTitleIcon": false,
|
|
|
462
|
+ "iconColor": "rgba(0, 0, 0, 0.87)",
|
|
|
463
|
+ "iconSize": "24px",
|
|
|
464
|
+ "displayTimewindow": true,
|
|
|
465
|
+ "titleTooltip": ""
|
|
|
466
|
+ },
|
|
|
467
|
+ "row": 0,
|
|
|
468
|
+ "col": 0,
|
|
|
469
|
+ "id": "100b756c-0082-6505-3ae1-3603e6deea48",
|
|
|
470
|
+ "typeFullFqn": "system.cards.timeseries_table"
|
|
|
471
|
+ },
|
|
|
472
|
+ "17543c57-af4a-2c1e-bf12-53a7b46791e6": {
|
|
|
473
|
+ "type": "latest",
|
|
|
474
|
+ "sizeX": 8,
|
|
|
475
|
+ "sizeY": 3,
|
|
|
476
|
+ "config": {
|
|
|
477
|
+ "datasources": [
|
|
|
478
|
+ {
|
|
|
479
|
+ "type": "entityCount",
|
|
|
480
|
+ "name": "",
|
|
|
481
|
+ "entityAliasId": "639da5b4-31f0-0151-6282-c37a3897b7e8",
|
|
|
482
|
+ "filterId": "19a0ad1c-b31d-4a29-9d7b-5d87e2a8ea6e",
|
|
|
483
|
+ "dataKeys": [
|
|
|
484
|
+ {
|
|
|
485
|
+ "name": "count",
|
|
|
486
|
+ "type": "count",
|
|
|
487
|
+ "label": "waitingDevicesNumber",
|
|
|
488
|
+ "color": "#4caf50",
|
|
|
489
|
+ "settings": {},
|
|
|
490
|
+ "_hash": 0.7404827038869322,
|
|
|
491
|
+ "units": null,
|
|
|
492
|
+ "decimals": null,
|
|
|
493
|
+ "funcBody": null,
|
|
|
494
|
+ "usePostProcessing": null,
|
|
|
495
|
+ "postFuncBody": null
|
|
|
496
|
+ }
|
|
|
497
|
+ ]
|
|
|
498
|
+ }
|
|
|
499
|
+ ],
|
|
|
500
|
+ "timewindow": {
|
|
|
501
|
+ "displayValue": "",
|
|
|
502
|
+ "selectedTab": 0,
|
|
|
503
|
+ "realtime": {
|
|
|
504
|
+ "realtimeType": 1,
|
|
|
505
|
+ "interval": 1000,
|
|
|
506
|
+ "timewindowMs": 60000,
|
|
|
507
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
508
|
+ },
|
|
|
509
|
+ "history": {
|
|
|
510
|
+ "historyType": 0,
|
|
|
511
|
+ "interval": 1000,
|
|
|
512
|
+ "timewindowMs": 60000,
|
|
|
513
|
+ "fixedTimewindow": {
|
|
|
514
|
+ "startTimeMs": 1694085363133,
|
|
|
515
|
+ "endTimeMs": 1694171763133
|
|
|
516
|
+ },
|
|
|
517
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
518
|
+ },
|
|
|
519
|
+ "aggregation": {
|
|
|
520
|
+ "type": "AVG",
|
|
|
521
|
+ "limit": 25000
|
|
|
522
|
+ }
|
|
|
523
|
+ },
|
|
|
524
|
+ "showTitle": false,
|
|
|
525
|
+ "backgroundColor": "#fff",
|
|
|
526
|
+ "color": "rgba(0, 0, 0, 0.87)",
|
|
|
527
|
+ "padding": "0px",
|
|
|
528
|
+ "settings": {
|
|
|
529
|
+ "cardHtml": "<div class='card' id=\"activeDevices\">\n <div class='content' id=\"activeDevices\">\n <img id=\"activeDevices\" src='data:image/svg+xml;utf8,<svg width=\"24\" height=\"40\" viewBox=\"0 0 24 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M0 0V12H0.0200005L0 12.02L8 20L0 28L0.0200005 28.02H0V40H24V28.02H23.98L24 28L16 20L24 12.02L23.98 12H24V0H0ZM20 29V36H4V29L12 21L20 29ZM12 19L4 11V4H20V11L12 19Z\" fill=\"black\"/>\n</svg>\n'>\n <div class='value' id=\"activeDevices\">\n ${waitingDevicesNumber:0}\n </div> \n <div class='description' id=\"activeDevices\">\n Device Waiting\n </div>\n </div>\n</div>",
|
|
|
530
|
+ "cardCss": ".card {\n width: 100%;\n height: 100%;\n border: 1px solid #E0E0E0;\n box-sizing: border-box;\n}\n\n.card .content {\n padding: 20px 10px;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n box-sizing: border-box;\n}\n\n.card .value {\n margin: 18px 0 5px;\n font-weight: 500;\n font-size: 3em;\n line-height: 1.1em;\n text-align: center;\n letter-spacing: -0.02em;\n color: #333333;\n}\n\n.card .description {\n font-size: 1em;\n line-height: 1.1em;\n color: #000000;\n opacity: 0.6;\n text-align: center;\n letter-spacing: -0.02em;\n}\n\n@media (min-width: 960px) and (max-width: 1200px) {\n .card .content img {\n height: 28px; \n }\n \n .card .value {\n margin: 12px 0 5px;\n font-size: 2em;\n line-height: 1;\n }\n \n .card .description {\n font-size: 0.8em;\n line-height: 1;\n }\n}"
|
|
|
531
|
+ },
|
|
|
532
|
+ "title": "New HTML Value Card",
|
|
|
533
|
+ "dropShadow": true,
|
|
|
534
|
+ "enableFullscreen": false,
|
|
|
535
|
+ "widgetStyle": {},
|
|
|
536
|
+ "titleStyle": {
|
|
|
537
|
+ "fontSize": "16px",
|
|
|
538
|
+ "fontWeight": 400
|
|
|
539
|
+ },
|
|
|
540
|
+ "useDashboardTimewindow": true,
|
|
|
541
|
+ "showLegend": false,
|
|
|
542
|
+ "actions": {
|
|
|
543
|
+ "elementClick": [
|
|
|
544
|
+ {
|
|
|
545
|
+ "name": "activeDevices",
|
|
|
546
|
+ "icon": "more_horiz",
|
|
|
547
|
+ "type": "openDashboardState",
|
|
|
548
|
+ "targetDashboardStateId": "device_waiting",
|
|
|
549
|
+ "setEntityId": false,
|
|
|
550
|
+ "stateEntityParamName": null,
|
|
|
551
|
+ "openInSeparateDialog": false,
|
|
|
552
|
+ "dialogTitle": "",
|
|
|
553
|
+ "dialogHideDashboardToolbar": true,
|
|
|
554
|
+ "dialogWidth": null,
|
|
|
555
|
+ "dialogHeight": null,
|
|
|
556
|
+ "openRightLayout": false,
|
|
|
557
|
+ "id": "4d9a77a2-f0a5-690c-a83b-b0e940be788c"
|
|
|
558
|
+ }
|
|
|
559
|
+ ]
|
|
|
560
|
+ },
|
|
|
561
|
+ "showTitleIcon": false,
|
|
|
562
|
+ "titleIcon": null,
|
|
|
563
|
+ "iconColor": "rgba(0, 0, 0, 0.87)",
|
|
|
564
|
+ "iconSize": "24px",
|
|
|
565
|
+ "titleTooltip": "",
|
|
|
566
|
+ "enableDataExport": false,
|
|
|
567
|
+ "displayTimewindow": true
|
|
|
568
|
+ },
|
|
|
569
|
+ "id": "17543c57-af4a-2c1e-bf12-53a7b46791e6",
|
|
|
570
|
+ "typeFullFqn": "system.cards.html_value_card"
|
|
|
571
|
+ },
|
|
|
572
|
+ "6c1c4e1a-bce0-f5ad-ff8b-ba1dfc5a4ec6": {
|
|
|
573
|
+ "type": "latest",
|
|
|
574
|
+ "sizeX": 8,
|
|
|
575
|
+ "sizeY": 3,
|
|
|
576
|
+ "config": {
|
|
|
577
|
+ "datasources": [
|
|
|
578
|
+ {
|
|
|
579
|
+ "type": "entityCount",
|
|
|
580
|
+ "name": "",
|
|
|
581
|
+ "entityAliasId": "639da5b4-31f0-0151-6282-c37a3897b7e8",
|
|
|
582
|
+ "filterId": "579f0468-9ce9-7e3e-b34c-88dd3de59897",
|
|
|
583
|
+ "dataKeys": [
|
|
|
584
|
+ {
|
|
|
585
|
+ "name": "count",
|
|
|
586
|
+ "type": "count",
|
|
|
587
|
+ "label": "updatingDevicesNumber",
|
|
|
588
|
+ "color": "#4caf50",
|
|
|
589
|
+ "settings": {},
|
|
|
590
|
+ "_hash": 0.7404827038869322,
|
|
|
591
|
+ "units": null,
|
|
|
592
|
+ "decimals": null,
|
|
|
593
|
+ "funcBody": null,
|
|
|
594
|
+ "usePostProcessing": null,
|
|
|
595
|
+ "postFuncBody": null
|
|
|
596
|
+ }
|
|
|
597
|
+ ]
|
|
|
598
|
+ }
|
|
|
599
|
+ ],
|
|
|
600
|
+ "timewindow": {
|
|
|
601
|
+ "displayValue": "",
|
|
|
602
|
+ "selectedTab": 0,
|
|
|
603
|
+ "realtime": {
|
|
|
604
|
+ "realtimeType": 1,
|
|
|
605
|
+ "interval": 1000,
|
|
|
606
|
+ "timewindowMs": 60000,
|
|
|
607
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
608
|
+ },
|
|
|
609
|
+ "history": {
|
|
|
610
|
+ "historyType": 0,
|
|
|
611
|
+ "interval": 1000,
|
|
|
612
|
+ "timewindowMs": 60000,
|
|
|
613
|
+ "fixedTimewindow": {
|
|
|
614
|
+ "startTimeMs": 1694085363133,
|
|
|
615
|
+ "endTimeMs": 1694171763133
|
|
|
616
|
+ },
|
|
|
617
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
618
|
+ },
|
|
|
619
|
+ "aggregation": {
|
|
|
620
|
+ "type": "AVG",
|
|
|
621
|
+ "limit": 25000
|
|
|
622
|
+ }
|
|
|
623
|
+ },
|
|
|
624
|
+ "showTitle": false,
|
|
|
625
|
+ "backgroundColor": "#fff",
|
|
|
626
|
+ "color": "rgba(0, 0, 0, 0.87)",
|
|
|
627
|
+ "padding": "0px",
|
|
|
628
|
+ "settings": {
|
|
|
629
|
+ "cardHtml": "<div class='card' id=\"activeDevices\">\n <div class='content' id=\"activeDevices\">\n <img id=\"activeDevices\" src='data:image/svg+xml;utf8,<svg width=\"36\" height=\"36\" viewBox=\"0 0 36 36\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M36 14.24H22.44L27.92 8.6C22.46 3.2 13.62 3 8.16001 8.4C2.70001 13.82 2.70001 22.56 8.16001 27.98C13.62 33.4 22.46 33.4 27.92 27.98C30.64 25.3 32 22.16 32 18.2H36C36 22.16 34.24 27.3 30.72 30.78C23.7 37.74 12.3 37.74 5.28001 30.78C-1.71999 23.84 -1.77999 12.56 5.24001 5.62C12.26 -1.32 23.52 -1.32 30.54 5.62L36 0V14.24ZM19 10V18.5L26 22.66L24.56 25.08L16 20V10H19Z\" fill=\"black\"/>\n</svg>'>\n <div class='value' id=\"activeDevices\">\n ${updatingDevicesNumber:0}\n </div> \n <div class='description' id=\"activeDevices\">\n Device Updating\n </div>\n </div>\n</div>",
|
|
|
630
|
+ "cardCss": ".card {\n width: 100%;\n height: 100%;\n border: 1px solid #E0E0E0;\n box-sizing: border-box;\n}\n\n.card .content {\n padding: 20px 10px;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n box-sizing: border-box;\n}\n\n.card .value {\n margin: 18px 0 5px;\n font-weight: 500;\n font-size: 3em;\n line-height: 1.1em;\n text-align: center;\n letter-spacing: -0.02em;\n color: #333333;\n}\n\n.card .description {\n font-size: 1em;\n line-height: 1.1em;\n color: #000000;\n opacity: 0.6;\n text-align: center;\n letter-spacing: -0.02em;\n}\n\n@media (min-width: 960px) and (max-width: 1200px) {\n .card .content img {\n height: 28px; \n }\n \n .card .value {\n margin: 12px 0 5px;\n font-size: 2em;\n line-height: 1;\n }\n \n .card .description {\n font-size: 0.8em;\n line-height: 1;\n }\n}"
|
|
|
631
|
+ },
|
|
|
632
|
+ "title": "New HTML Value Card",
|
|
|
633
|
+ "dropShadow": true,
|
|
|
634
|
+ "enableFullscreen": false,
|
|
|
635
|
+ "widgetStyle": {},
|
|
|
636
|
+ "titleStyle": {
|
|
|
637
|
+ "fontSize": "16px",
|
|
|
638
|
+ "fontWeight": 400
|
|
|
639
|
+ },
|
|
|
640
|
+ "useDashboardTimewindow": true,
|
|
|
641
|
+ "showLegend": false,
|
|
|
642
|
+ "actions": {
|
|
|
643
|
+ "elementClick": [
|
|
|
644
|
+ {
|
|
|
645
|
+ "name": "activeDevices",
|
|
|
646
|
+ "icon": "more_horiz",
|
|
|
647
|
+ "type": "openDashboardState",
|
|
|
648
|
+ "targetDashboardStateId": "device_updating",
|
|
|
649
|
+ "setEntityId": false,
|
|
|
650
|
+ "stateEntityParamName": null,
|
|
|
651
|
+ "openInSeparateDialog": false,
|
|
|
652
|
+ "dialogTitle": "",
|
|
|
653
|
+ "dialogHideDashboardToolbar": true,
|
|
|
654
|
+ "dialogWidth": null,
|
|
|
655
|
+ "dialogHeight": null,
|
|
|
656
|
+ "openRightLayout": false,
|
|
|
657
|
+ "id": "57d39904-2350-b29b-78ed-56b8268814cb"
|
|
|
658
|
+ }
|
|
|
659
|
+ ]
|
|
|
660
|
+ },
|
|
|
661
|
+ "showTitleIcon": false,
|
|
|
662
|
+ "titleIcon": null,
|
|
|
663
|
+ "iconColor": "rgba(0, 0, 0, 0.87)",
|
|
|
664
|
+ "iconSize": "24px",
|
|
|
665
|
+ "titleTooltip": "",
|
|
|
666
|
+ "enableDataExport": false,
|
|
|
667
|
+ "displayTimewindow": true
|
|
|
668
|
+ },
|
|
|
669
|
+ "id": "6c1c4e1a-bce0-f5ad-ff8b-ba1dfc5a4ec6",
|
|
|
670
|
+ "typeFullFqn": "system.cards.html_value_card"
|
|
|
671
|
+ },
|
|
|
672
|
+ "e6674227-9cf3-a2f6-ecac-5ccfc38a3c81": {
|
|
|
673
|
+ "type": "latest",
|
|
|
674
|
+ "sizeX": 8,
|
|
|
675
|
+ "sizeY": 3,
|
|
|
676
|
+ "config": {
|
|
|
677
|
+ "datasources": [
|
|
|
678
|
+ {
|
|
|
679
|
+ "type": "entityCount",
|
|
|
680
|
+ "name": "",
|
|
|
681
|
+ "entityAliasId": "639da5b4-31f0-0151-6282-c37a3897b7e8",
|
|
|
682
|
+ "filterId": "6044e198-df64-cd76-f339-696f220c4943",
|
|
|
683
|
+ "dataKeys": [
|
|
|
684
|
+ {
|
|
|
685
|
+ "name": "count",
|
|
|
686
|
+ "type": "count",
|
|
|
687
|
+ "label": "updatedDevicesNumber",
|
|
|
688
|
+ "color": "#4caf50",
|
|
|
689
|
+ "settings": {},
|
|
|
690
|
+ "_hash": 0.7404827038869322,
|
|
|
691
|
+ "units": null,
|
|
|
692
|
+ "decimals": null,
|
|
|
693
|
+ "funcBody": null,
|
|
|
694
|
+ "usePostProcessing": null,
|
|
|
695
|
+ "postFuncBody": null
|
|
|
696
|
+ }
|
|
|
697
|
+ ]
|
|
|
698
|
+ }
|
|
|
699
|
+ ],
|
|
|
700
|
+ "timewindow": {
|
|
|
701
|
+ "displayValue": "",
|
|
|
702
|
+ "selectedTab": 0,
|
|
|
703
|
+ "realtime": {
|
|
|
704
|
+ "realtimeType": 1,
|
|
|
705
|
+ "interval": 1000,
|
|
|
706
|
+ "timewindowMs": 60000,
|
|
|
707
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
708
|
+ },
|
|
|
709
|
+ "history": {
|
|
|
710
|
+ "historyType": 0,
|
|
|
711
|
+ "interval": 1000,
|
|
|
712
|
+ "timewindowMs": 60000,
|
|
|
713
|
+ "fixedTimewindow": {
|
|
|
714
|
+ "startTimeMs": 1694085363133,
|
|
|
715
|
+ "endTimeMs": 1694171763133
|
|
|
716
|
+ },
|
|
|
717
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
718
|
+ },
|
|
|
719
|
+ "aggregation": {
|
|
|
720
|
+ "type": "AVG",
|
|
|
721
|
+ "limit": 25000
|
|
|
722
|
+ }
|
|
|
723
|
+ },
|
|
|
724
|
+ "showTitle": false,
|
|
|
725
|
+ "backgroundColor": "#fff",
|
|
|
726
|
+ "color": "rgba(0, 0, 0, 0.87)",
|
|
|
727
|
+ "padding": "0px",
|
|
|
728
|
+ "settings": {
|
|
|
729
|
+ "cardHtml": "<div class='card' id=\"activeDevices\">\n <div class='content' id=\"activeDevices\">\n <img id=\"activeDevices\" src='data:image/svg+xml;utf8,<svg width=\"34\" height=\"32\" viewBox=\"0 0 34 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M33.26 2.82L30.44 0L12.06 18.38L3.55999 9.9L0.73999 12.72L12.06 24.04L33.26 2.82Z\" fill=\"black\"/>\n<path d=\"M31 28H3V32H31V28Z\" fill=\"black\"/>\n</svg>'>\n <div class='value' id=\"activeDevices\">\n ${updatedDevicesNumber:0}\n </div> \n <div class='description' id=\"activeDevices\">\n Device Updated\n </div>\n </div>\n</div>",
|
|
|
730
|
+ "cardCss": ".card {\n width: 100%;\n height: 100%;\n border: 1px solid #E0E0E0;\n box-sizing: border-box;\n}\n\n.card .content {\n padding: 20px 10px;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n box-sizing: border-box;\n}\n\n.card .value {\n margin: 18px 0 5px;\n font-weight: 500;\n font-size: 3em;\n line-height: 1.1em;\n text-align: center;\n letter-spacing: -0.02em;\n color: #333333;\n}\n\n.card .description {\n font-size: 1em;\n line-height: 1.1em;\n color: #000000;\n opacity: 0.6;\n text-align: center;\n letter-spacing: -0.02em;\n}\n\n@media (min-width: 960px) and (max-width: 1200px) {\n .card .content img {\n height: 28px; \n }\n \n .card .value {\n margin: 12px 0 5px;\n font-size: 2em;\n line-height: 1;\n }\n \n .card .description {\n font-size: 0.8em;\n line-height: 1;\n }\n}"
|
|
|
731
|
+ },
|
|
|
732
|
+ "title": "New HTML Value Card",
|
|
|
733
|
+ "dropShadow": true,
|
|
|
734
|
+ "enableFullscreen": false,
|
|
|
735
|
+ "widgetStyle": {},
|
|
|
736
|
+ "titleStyle": {
|
|
|
737
|
+ "fontSize": "16px",
|
|
|
738
|
+ "fontWeight": 400
|
|
|
739
|
+ },
|
|
|
740
|
+ "useDashboardTimewindow": true,
|
|
|
741
|
+ "showLegend": false,
|
|
|
742
|
+ "actions": {
|
|
|
743
|
+ "elementClick": [
|
|
|
744
|
+ {
|
|
|
745
|
+ "name": "activeDevices",
|
|
|
746
|
+ "icon": "more_horiz",
|
|
|
747
|
+ "type": "openDashboardState",
|
|
|
748
|
+ "targetDashboardStateId": "device_updated",
|
|
|
749
|
+ "setEntityId": false,
|
|
|
750
|
+ "stateEntityParamName": null,
|
|
|
751
|
+ "openInSeparateDialog": false,
|
|
|
752
|
+ "dialogTitle": "",
|
|
|
753
|
+ "dialogHideDashboardToolbar": true,
|
|
|
754
|
+ "dialogWidth": null,
|
|
|
755
|
+ "dialogHeight": null,
|
|
|
756
|
+ "openRightLayout": false,
|
|
|
757
|
+ "id": "d787c212-8c56-34f0-349a-5aae2ffd1eae"
|
|
|
758
|
+ }
|
|
|
759
|
+ ]
|
|
|
760
|
+ },
|
|
|
761
|
+ "showTitleIcon": false,
|
|
|
762
|
+ "titleIcon": null,
|
|
|
763
|
+ "iconColor": "rgba(0, 0, 0, 0.87)",
|
|
|
764
|
+ "iconSize": "24px",
|
|
|
765
|
+ "titleTooltip": "",
|
|
|
766
|
+ "enableDataExport": false,
|
|
|
767
|
+ "displayTimewindow": true
|
|
|
768
|
+ },
|
|
|
769
|
+ "id": "e6674227-9cf3-a2f6-ecac-5ccfc38a3c81",
|
|
|
770
|
+ "typeFullFqn": "system.cards.html_value_card"
|
|
|
771
|
+ },
|
|
|
772
|
+ "77b10144-b904-edd5-8c7c-8fb75616c6d8": {
|
|
|
773
|
+ "type": "latest",
|
|
|
774
|
+ "sizeX": 8,
|
|
|
775
|
+ "sizeY": 3,
|
|
|
776
|
+ "config": {
|
|
|
777
|
+ "datasources": [
|
|
|
778
|
+ {
|
|
|
779
|
+ "type": "entityCount",
|
|
|
780
|
+ "name": "",
|
|
|
781
|
+ "entityAliasId": "639da5b4-31f0-0151-6282-c37a3897b7e8",
|
|
|
782
|
+ "filterId": "bdbc6ea1-95a7-3912-341a-58dc7704a00f",
|
|
|
783
|
+ "dataKeys": [
|
|
|
784
|
+ {
|
|
|
785
|
+ "name": "count",
|
|
|
786
|
+ "type": "count",
|
|
|
787
|
+ "label": "updatingDevicesNumber",
|
|
|
788
|
+ "color": "#4caf50",
|
|
|
789
|
+ "settings": {},
|
|
|
790
|
+ "_hash": 0.7404827038869322,
|
|
|
791
|
+ "units": null,
|
|
|
792
|
+ "decimals": null,
|
|
|
793
|
+ "funcBody": null,
|
|
|
794
|
+ "usePostProcessing": null,
|
|
|
795
|
+ "postFuncBody": null
|
|
|
796
|
+ }
|
|
|
797
|
+ ]
|
|
|
798
|
+ }
|
|
|
799
|
+ ],
|
|
|
800
|
+ "timewindow": {
|
|
|
801
|
+ "displayValue": "",
|
|
|
802
|
+ "selectedTab": 0,
|
|
|
803
|
+ "realtime": {
|
|
|
804
|
+ "realtimeType": 1,
|
|
|
805
|
+ "interval": 1000,
|
|
|
806
|
+ "timewindowMs": 60000,
|
|
|
807
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
808
|
+ },
|
|
|
809
|
+ "history": {
|
|
|
810
|
+ "historyType": 0,
|
|
|
811
|
+ "interval": 1000,
|
|
|
812
|
+ "timewindowMs": 60000,
|
|
|
813
|
+ "fixedTimewindow": {
|
|
|
814
|
+ "startTimeMs": 1694085363133,
|
|
|
815
|
+ "endTimeMs": 1694171763133
|
|
|
816
|
+ },
|
|
|
817
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
818
|
+ },
|
|
|
819
|
+ "aggregation": {
|
|
|
820
|
+ "type": "AVG",
|
|
|
821
|
+ "limit": 25000
|
|
|
822
|
+ }
|
|
|
823
|
+ },
|
|
|
824
|
+ "showTitle": false,
|
|
|
825
|
+ "backgroundColor": "#fff",
|
|
|
826
|
+ "color": "rgba(0, 0, 0, 0.87)",
|
|
|
827
|
+ "padding": "0px",
|
|
|
828
|
+ "settings": {
|
|
|
829
|
+ "cardHtml": "<div class='card' id=\"activeDevices\">\n <div class='content' id=\"activeDevices\">\n <div class=\"container-svg\" id=\"activeDevices\">\n <svg viewBox=\"0 0 24 24\" id=\"activeDevices\">\n <path id=\"activeDevices\" fill=\"currentColor\" d=\"M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z\" />\n </svg>\n </div>\n <div class='value error_firmware_failed_count' id=\"activeDevices\">\n ${updatingDevicesNumber:0}\n </div> \n <script type=\"text/javascript\">\n function init() {\n var counter = $('.error_firmware_failed_count');\n var value = +counter.text();\n if(value) {\n counter.css('color', '#D93025');\n }\n };\n init();\n </script>\n <div class='description' id=\"activeDevices\">\n Device Failed\n </div>\n </div>\n</div>",
|
|
|
830
|
+ "cardCss": ".card {\n width: 100%;\n height: 100%;\n border: 1px solid #E0E0E0;\n box-sizing: border-box;\n}\n\n.card .content {\n padding: 20px 10px;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n box-sizing: border-box;\n}\n\n.card .container-svg {\n height: 40px;\n width: 40px;\n}\n\n.card .value {\n margin: 18px 0 5px;\n font-weight: 500;\n font-size: 3em;\n line-height: 1.1em;\n text-align: center;\n letter-spacing: -0.02em;\n color: #333333;\n}\n\n.card .description {\n font-size: 1em;\n line-height: 1.1em;\n color: #000000;\n opacity: 0.6;\n text-align: center;\n letter-spacing: -0.02em;\n}\n\n@media (min-width: 960px) and (max-width: 1200px) {\n .card .container-svg {\n height: 28px;\n width: 28px;\n }\n \n .card .value {\n margin: 12px 0 5px;\n font-size: 2em;\n line-height: 1;\n }\n \n .card .description {\n font-size: 0.8em;\n line-height: 1;\n }\n}"
|
|
|
831
|
+ },
|
|
|
832
|
+ "title": "New HTML Value Card",
|
|
|
833
|
+ "dropShadow": true,
|
|
|
834
|
+ "enableFullscreen": false,
|
|
|
835
|
+ "widgetStyle": {},
|
|
|
836
|
+ "titleStyle": {
|
|
|
837
|
+ "fontSize": "16px",
|
|
|
838
|
+ "fontWeight": 400
|
|
|
839
|
+ },
|
|
|
840
|
+ "useDashboardTimewindow": true,
|
|
|
841
|
+ "showLegend": false,
|
|
|
842
|
+ "actions": {
|
|
|
843
|
+ "elementClick": [
|
|
|
844
|
+ {
|
|
|
845
|
+ "name": "activeDevices",
|
|
|
846
|
+ "icon": "more_horiz",
|
|
|
847
|
+ "type": "openDashboardState",
|
|
|
848
|
+ "targetDashboardStateId": "device_error",
|
|
|
849
|
+ "setEntityId": false,
|
|
|
850
|
+ "stateEntityParamName": null,
|
|
|
851
|
+ "openInSeparateDialog": false,
|
|
|
852
|
+ "dialogTitle": "",
|
|
|
853
|
+ "dialogHideDashboardToolbar": true,
|
|
|
854
|
+ "dialogWidth": null,
|
|
|
855
|
+ "dialogHeight": null,
|
|
|
856
|
+ "openRightLayout": false,
|
|
|
857
|
+ "id": "0b3d2887-9929-84d5-3795-0763dca15cba"
|
|
|
858
|
+ }
|
|
|
859
|
+ ]
|
|
|
860
|
+ },
|
|
|
861
|
+ "showTitleIcon": false,
|
|
|
862
|
+ "titleIcon": null,
|
|
|
863
|
+ "iconColor": "rgba(0, 0, 0, 0.87)",
|
|
|
864
|
+ "iconSize": "24px",
|
|
|
865
|
+ "titleTooltip": "",
|
|
|
866
|
+ "enableDataExport": false,
|
|
|
867
|
+ "displayTimewindow": true
|
|
|
868
|
+ },
|
|
|
869
|
+ "id": "77b10144-b904-edd5-8c7c-8fb75616c6d8",
|
|
|
870
|
+ "typeFullFqn": "system.cards.html_value_card"
|
|
|
871
|
+ },
|
|
|
872
|
+ "21be08bb-ec90-f760-ad6f-e7678f12c401": {
|
|
|
873
|
+ "type": "latest",
|
|
|
874
|
+ "sizeX": 7.5,
|
|
|
875
|
+ "sizeY": 6.5,
|
|
|
876
|
+ "config": {
|
|
|
877
|
+ "timewindow": {
|
|
|
878
|
+ "displayValue": "",
|
|
|
879
|
+ "selectedTab": 0,
|
|
|
880
|
+ "realtime": {
|
|
|
881
|
+ "realtimeType": 1,
|
|
|
882
|
+ "interval": 1000,
|
|
|
883
|
+ "timewindowMs": 86400000,
|
|
|
884
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
885
|
+ },
|
|
|
886
|
+ "history": {
|
|
|
887
|
+ "historyType": 0,
|
|
|
888
|
+ "interval": 1000,
|
|
|
889
|
+ "timewindowMs": 60000,
|
|
|
890
|
+ "fixedTimewindow": {
|
|
|
891
|
+ "startTimeMs": 1694085363133,
|
|
|
892
|
+ "endTimeMs": 1694171763133
|
|
|
893
|
+ },
|
|
|
894
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
895
|
+ },
|
|
|
896
|
+ "aggregation": {
|
|
|
897
|
+ "type": "NONE",
|
|
|
898
|
+ "limit": 200
|
|
|
899
|
+ }
|
|
|
900
|
+ },
|
|
|
901
|
+ "showTitle": true,
|
|
|
902
|
+ "backgroundColor": "rgb(255, 255, 255)",
|
|
|
903
|
+ "color": "rgba(0, 0, 0, 0.87)",
|
|
|
904
|
+ "padding": "4px",
|
|
|
905
|
+ "settings": {
|
|
|
906
|
+ "enableSearch": true,
|
|
|
907
|
+ "displayPagination": true,
|
|
|
908
|
+ "defaultPageSize": 10,
|
|
|
909
|
+ "defaultSortOrder": "entityName",
|
|
|
910
|
+ "displayEntityName": true,
|
|
|
911
|
+ "displayEntityType": false,
|
|
|
912
|
+ "enableSelectColumnDisplay": false,
|
|
|
913
|
+ "enableStickyHeader": true,
|
|
|
914
|
+ "enableStickyAction": true,
|
|
|
915
|
+ "entitiesTitle": "Devices",
|
|
|
916
|
+ "displayEntityLabel": false,
|
|
|
917
|
+ "entityNameColumnTitle": "Device"
|
|
|
918
|
+ },
|
|
|
919
|
+ "title": "New Entities table",
|
|
|
920
|
+ "dropShadow": true,
|
|
|
921
|
+ "enableFullscreen": true,
|
|
|
922
|
+ "titleStyle": {
|
|
|
923
|
+ "fontSize": "16px",
|
|
|
924
|
+ "fontWeight": 400,
|
|
|
925
|
+ "padding": "5px 10px 5px 10px"
|
|
|
926
|
+ },
|
|
|
927
|
+ "useDashboardTimewindow": false,
|
|
|
928
|
+ "showLegend": false,
|
|
|
929
|
+ "datasources": [
|
|
|
930
|
+ {
|
|
|
931
|
+ "type": "entity",
|
|
|
932
|
+ "name": null,
|
|
|
933
|
+ "entityAliasId": "639da5b4-31f0-0151-6282-c37a3897b7e8",
|
|
|
934
|
+ "filterId": "19a0ad1c-b31d-4a29-9d7b-5d87e2a8ea6e",
|
|
|
935
|
+ "dataKeys": [
|
|
|
936
|
+ {
|
|
|
937
|
+ "name": "current_fw_title",
|
|
|
938
|
+ "type": "timeseries",
|
|
|
939
|
+ "label": "Current FW title",
|
|
|
940
|
+ "color": "#2196f3",
|
|
|
941
|
+ "settings": {
|
|
|
942
|
+ "columnWidth": "0px",
|
|
|
943
|
+ "useCellStyleFunction": false,
|
|
|
944
|
+ "cellStyleFunction": "",
|
|
|
945
|
+ "useCellContentFunction": false,
|
|
|
946
|
+ "defaultColumnVisibility": "visible",
|
|
|
947
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
948
|
+ },
|
|
|
949
|
+ "_hash": 0.09545533885166413,
|
|
|
950
|
+ "units": null,
|
|
|
951
|
+ "decimals": null,
|
|
|
952
|
+ "funcBody": null,
|
|
|
953
|
+ "usePostProcessing": null,
|
|
|
954
|
+ "postFuncBody": null
|
|
|
955
|
+ },
|
|
|
956
|
+ {
|
|
|
957
|
+ "name": "current_fw_version",
|
|
|
958
|
+ "type": "timeseries",
|
|
|
959
|
+ "label": "Current FW version",
|
|
|
960
|
+ "color": "#4caf50",
|
|
|
961
|
+ "settings": {
|
|
|
962
|
+ "columnWidth": "0px",
|
|
|
963
|
+ "useCellStyleFunction": false,
|
|
|
964
|
+ "cellStyleFunction": "",
|
|
|
965
|
+ "useCellContentFunction": false,
|
|
|
966
|
+ "defaultColumnVisibility": "visible",
|
|
|
967
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
968
|
+ },
|
|
|
969
|
+ "_hash": 0.7206056602328659,
|
|
|
970
|
+ "units": null,
|
|
|
971
|
+ "decimals": null,
|
|
|
972
|
+ "funcBody": null,
|
|
|
973
|
+ "usePostProcessing": null,
|
|
|
974
|
+ "postFuncBody": null
|
|
|
975
|
+ },
|
|
|
976
|
+ {
|
|
|
977
|
+ "name": "target_fw_title",
|
|
|
978
|
+ "type": "timeseries",
|
|
|
979
|
+ "label": "Target FW title",
|
|
|
980
|
+ "color": "#ffc107",
|
|
|
981
|
+ "settings": {
|
|
|
982
|
+ "columnWidth": "0px",
|
|
|
983
|
+ "useCellStyleFunction": false,
|
|
|
984
|
+ "cellStyleFunction": "",
|
|
|
985
|
+ "useCellContentFunction": false,
|
|
|
986
|
+ "defaultColumnVisibility": "visible",
|
|
|
987
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
988
|
+ },
|
|
|
989
|
+ "_hash": 0.9934225682766313,
|
|
|
990
|
+ "units": null,
|
|
|
991
|
+ "decimals": null,
|
|
|
992
|
+ "funcBody": null,
|
|
|
993
|
+ "usePostProcessing": null,
|
|
|
994
|
+ "postFuncBody": null
|
|
|
995
|
+ },
|
|
|
996
|
+ {
|
|
|
997
|
+ "name": "target_fw_version",
|
|
|
998
|
+ "type": "timeseries",
|
|
|
999
|
+ "label": "Target FW version",
|
|
|
1000
|
+ "color": "#607d8b",
|
|
|
1001
|
+ "settings": {
|
|
|
1002
|
+ "columnWidth": "0px",
|
|
|
1003
|
+ "useCellStyleFunction": false,
|
|
|
1004
|
+ "cellStyleFunction": "",
|
|
|
1005
|
+ "useCellContentFunction": false,
|
|
|
1006
|
+ "cellContentFunction": "",
|
|
|
1007
|
+ "defaultColumnVisibility": "visible",
|
|
|
1008
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
1009
|
+ },
|
|
|
1010
|
+ "_hash": 0.5251724416842531,
|
|
|
1011
|
+ "units": null,
|
|
|
1012
|
+ "decimals": null,
|
|
|
1013
|
+ "funcBody": null,
|
|
|
1014
|
+ "usePostProcessing": null,
|
|
|
1015
|
+ "postFuncBody": null
|
|
|
1016
|
+ },
|
|
|
1017
|
+ {
|
|
|
1018
|
+ "name": "target_fw_ts",
|
|
|
1019
|
+ "type": "timeseries",
|
|
|
1020
|
+ "label": "Target FW set time",
|
|
|
1021
|
+ "color": "#e91e63",
|
|
|
1022
|
+ "settings": {
|
|
|
1023
|
+ "columnWidth": "0px",
|
|
|
1024
|
+ "useCellStyleFunction": false,
|
|
|
1025
|
+ "cellStyleFunction": "",
|
|
|
1026
|
+ "useCellContentFunction": true,
|
|
|
1027
|
+ "defaultColumnVisibility": "visible",
|
|
|
1028
|
+ "columnSelectionToDisplay": "enabled",
|
|
|
1029
|
+ "cellContentFunction": "if (value !== '') {\n return ctx.date.transform(value, 'yyyy-MM-dd HH:mm:ss');\n}\nreturn '';"
|
|
|
1030
|
+ },
|
|
|
1031
|
+ "_hash": 0.31823244858578237,
|
|
|
1032
|
+ "units": null,
|
|
|
1033
|
+ "decimals": null,
|
|
|
1034
|
+ "funcBody": null,
|
|
|
1035
|
+ "usePostProcessing": null,
|
|
|
1036
|
+ "postFuncBody": null
|
|
|
1037
|
+ },
|
|
|
1038
|
+ {
|
|
|
1039
|
+ "name": "fw_state",
|
|
|
1040
|
+ "type": "timeseries",
|
|
|
1041
|
+ "label": "Progress",
|
|
|
1042
|
+ "color": "#9c27b0",
|
|
|
1043
|
+ "settings": {
|
|
|
1044
|
+ "columnWidth": "30%",
|
|
|
1045
|
+ "useCellStyleFunction": true,
|
|
|
1046
|
+ "useCellContentFunction": true,
|
|
|
1047
|
+ "defaultColumnVisibility": "visible",
|
|
|
1048
|
+ "columnSelectionToDisplay": "enabled",
|
|
|
1049
|
+ "cellStyleFunction": "return {\n 'padding-right': '30px'\n}",
|
|
|
1050
|
+ "cellContentFunction": "if (value !== '') {\n var mapProgress = {\n 'QUEUED': 0,\n 'INITIATED': 5,\n 'DOWNLOADING': 10,\n 'DOWNLOADED': 55,\n 'VERIFIED': 60,\n 'UPDATING': 70,\n 'FAILED': 99,\n 'UPDATED': 100\n }\n var color = 'mat-primary';\n var progress = mapProgress[value];\n if (value == 'FAILED') {\n color = 'mat-accent';\n }\n return `<mat-progress-bar style=\"height: 8px\" role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\" tabindex=\"-1\" mode=\"determinate\" value=\"${progress}\" class=\"mat-progress-bar ${color}\" aria-valuenow=\"${progress}\"><div aria-hidden=\"true\"><svg width=\"100%\" height=\"8\" focusable=\"false\" class=\"mat-progress-bar-background mat-progress-bar-element\"><defs><pattern x=\"4\" y=\"0\" width=\"8\" height=\"4\" patternUnits=\"userSpaceOnUse\" id=\"mat-progress-bar-0\"><circle cx=\"2\" cy=\"2\" r=\"2\"></circle></pattern></defs><rect width=\"100%\" height=\"100%\" fill=\"url(\"/components/progress-bar/overview#mat-progress-bar-0\")\"></rect></svg><div class=\"mat-progress-bar-buffer mat-progress-bar-element\"></div><div class=\"mat-progress-bar-primary mat-progress-bar-fill mat-progress-bar-element\" style=\"transform: scale3d(${progress / 100}, 1, 1);\"></div><div class=\"mat-progress-bar-secondary mat-progress-bar-fill mat-progress-bar-element\"></div></div></mat-progress-bar>`;\n}"
|
|
|
1051
|
+ },
|
|
|
1052
|
+ "_hash": 0.8174211757846257,
|
|
|
1053
|
+ "units": null,
|
|
|
1054
|
+ "decimals": null,
|
|
|
1055
|
+ "funcBody": null,
|
|
|
1056
|
+ "usePostProcessing": null,
|
|
|
1057
|
+ "postFuncBody": null
|
|
|
1058
|
+ },
|
|
|
1059
|
+ {
|
|
|
1060
|
+ "name": "fw_state",
|
|
|
1061
|
+ "type": "timeseries",
|
|
|
1062
|
+ "label": "Status",
|
|
|
1063
|
+ "color": "#f44336",
|
|
|
1064
|
+ "settings": {
|
|
|
1065
|
+ "columnWidth": "130px",
|
|
|
1066
|
+ "useCellStyleFunction": true,
|
|
|
1067
|
+ "useCellContentFunction": true,
|
|
|
1068
|
+ "defaultColumnVisibility": "visible",
|
|
|
1069
|
+ "columnSelectionToDisplay": "enabled",
|
|
|
1070
|
+ "cellStyleFunction": "if (value == 'FAILED') {\n return {'color' : '#D93025'};\n}\nreturn {};",
|
|
|
1071
|
+ "cellContentFunction": "function icon(value) {\n if (value == 'QUEUED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000;\"><svg style=\"width:24px;height:24px\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M6,2V8H6V8L10,12L6,16V16H6V22H18V16H18V16L14,12L18,8V8H18V2H6M16,16.5V20H8V16.5L12,12.5L16,16.5M12,11.5L8,7.5V4H16V7.5L12,11.5Z\" /></svg></mat-icon>';\n }\n if (value == 'INITIATED' || value == 'DOWNLOADING' || value == 'DOWNLOADED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000\"><svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.74 2.1951C11.63 1.2876 10.2575 0.687598 8.75 0.537598V2.0526C9.845 2.1876 10.8425 2.6226 11.675 3.2676L12.74 2.1951ZM13.9475 7.2501H15.4625C15.3125 5.7426 14.7125 4.3701 13.805 3.2601L12.7325 4.3251C13.3775 5.1576 13.8125 6.1551 13.9475 7.2501ZM12.7325 11.6751L13.805 12.7476C14.7125 11.6376 15.3125 10.2576 15.4625 8.7576H13.9475C13.8125 9.8451 13.3775 10.8426 12.7325 11.6751ZM8.75 13.9476V15.4626C10.2575 15.3126 11.63 14.7126 12.74 13.8051L11.6675 12.7326C10.8425 13.3776 9.845 13.8126 8.75 13.9476ZM8.75 8.0001V4.2501H7.25V8.0001H4.25L8 11.7501L11.75 8.0001H8.75ZM7.25 13.9476V15.4626C3.4625 15.0876 0.5 11.8926 0.5 8.0001C0.5 4.1076 3.4625 0.912598 7.25 0.537598V2.0526C4.2875 2.4201 2 4.9401 2 8.0001C2 11.0601 4.2875 13.5801 7.25 13.9476Z\" fill=\"black\"/></svg></mat-icon>';\n }\n if (value == 'VERIFIED' || value == 'UPDATING' ) {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000\">update</mat-icon>';\n }\n if (value == 'UPDATED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000\"><svg style=\"width:22px;height:22px\" viewBox=\"0 0 34 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M33.26 2.82L30.44 0L12.06 18.38L3.55999 9.9L0.73999 12.72L12.06 24.04L33.26 2.82Z\" fill=\"black\"/><path d=\"M31 28H3V32H31V28Z\" fill=\"black\"/></svg></mat-icon>';\n }\n if (value == 'FAILED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #D93025\">warning</mat-icon>';\n }\n return '';\n}\nfunction capitalize (s) {\n if (typeof s !== 'string') return '';\n return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nreturn icon(value) + '<span style=\"vertical-align: super;padding-left: 8px;\">' + capitalize(value) + '</span>';"
|
|
|
1072
|
+ },
|
|
|
1073
|
+ "_hash": 0.7764426948615217,
|
|
|
1074
|
+ "units": null,
|
|
|
1075
|
+ "decimals": null,
|
|
|
1076
|
+ "funcBody": null,
|
|
|
1077
|
+ "usePostProcessing": null,
|
|
|
1078
|
+ "postFuncBody": null
|
|
|
1079
|
+ },
|
|
|
1080
|
+ {
|
|
|
1081
|
+ "name": "fw_checksum",
|
|
|
1082
|
+ "type": "attribute",
|
|
|
1083
|
+ "label": "fw_checksum",
|
|
|
1084
|
+ "color": "#3f51b5",
|
|
|
1085
|
+ "settings": {
|
|
|
1086
|
+ "columnWidth": "0px",
|
|
|
1087
|
+ "useCellStyleFunction": false,
|
|
|
1088
|
+ "cellStyleFunction": "",
|
|
|
1089
|
+ "useCellContentFunction": false,
|
|
|
1090
|
+ "defaultColumnVisibility": "hidden",
|
|
|
1091
|
+ "columnSelectionToDisplay": "disabled"
|
|
|
1092
|
+ },
|
|
|
1093
|
+ "_hash": 0.5594087842471693,
|
|
|
1094
|
+ "units": null,
|
|
|
1095
|
+ "decimals": null,
|
|
|
1096
|
+ "funcBody": null,
|
|
|
1097
|
+ "usePostProcessing": null,
|
|
|
1098
|
+ "postFuncBody": null
|
|
|
1099
|
+ },
|
|
|
1100
|
+ {
|
|
|
1101
|
+ "name": "fw_url",
|
|
|
1102
|
+ "type": "attribute",
|
|
|
1103
|
+ "label": "fw_url",
|
|
|
1104
|
+ "color": "#e91e63",
|
|
|
1105
|
+ "settings": {
|
|
|
1106
|
+ "columnWidth": "0px",
|
|
|
1107
|
+ "useCellStyleFunction": false,
|
|
|
1108
|
+ "cellStyleFunction": "",
|
|
|
1109
|
+ "useCellContentFunction": false,
|
|
|
1110
|
+ "cellContentFunction": "",
|
|
|
1111
|
+ "defaultColumnVisibility": "hidden",
|
|
|
1112
|
+ "columnSelectionToDisplay": "disabled"
|
|
|
1113
|
+ },
|
|
|
1114
|
+ "_hash": 0.4204673738685043,
|
|
|
1115
|
+ "units": null,
|
|
|
1116
|
+ "decimals": null,
|
|
|
1117
|
+ "funcBody": null,
|
|
|
1118
|
+ "usePostProcessing": null,
|
|
|
1119
|
+ "postFuncBody": null
|
|
|
1120
|
+ }
|
|
|
1121
|
+ ]
|
|
|
1122
|
+ }
|
|
|
1123
|
+ ],
|
|
|
1124
|
+ "actions": {
|
|
|
1125
|
+ "actionCellButton": [
|
|
|
1126
|
+ {
|
|
|
1127
|
+ "name": "History firmware update",
|
|
|
1128
|
+ "icon": "history",
|
|
|
1129
|
+ "type": "openDashboardState",
|
|
|
1130
|
+ "targetDashboardStateId": "device_firmware_history",
|
|
|
1131
|
+ "setEntityId": true,
|
|
|
1132
|
+ "stateEntityParamName": null,
|
|
|
1133
|
+ "openInSeparateDialog": false,
|
|
|
1134
|
+ "dialogTitle": "",
|
|
|
1135
|
+ "dialogHideDashboardToolbar": true,
|
|
|
1136
|
+ "dialogWidth": null,
|
|
|
1137
|
+ "dialogHeight": null,
|
|
|
1138
|
+ "openRightLayout": false,
|
|
|
1139
|
+ "id": "98a1406c-3301-bc2f-2c5d-d637ce3b663b"
|
|
|
1140
|
+ },
|
|
|
1141
|
+ {
|
|
|
1142
|
+ "name": "Edit firmware",
|
|
|
1143
|
+ "icon": "edit",
|
|
|
1144
|
+ "type": "customPretty",
|
|
|
1145
|
+ "customHtml": "<form #editEntityForm=\"ngForm\" [formGroup]=\"editEntityFormGroup\"\n (ngSubmit)=\"save()\" class=\"edit-entity-form\">\n <mat-toolbar fxLayout=\"row\" color=\"primary\">\n <h2>Edit firmware {{entityName}}</h2>\n <span fxFlex></span>\n <button mat-icon-button (click)=\"cancel()\" type=\"button\">\n <mat-icon class=\"material-icons\">close</mat-icon>\n </button>\n </mat-toolbar>\n <mat-progress-bar color=\"warn\" mode=\"indeterminate\" *ngIf=\"isLoading$ | async\">\n </mat-progress-bar>\n <div style=\"height: 4px;\" *ngIf=\"!(isLoading$ | async)\"></div>\n <div *ngIf=\"entity.deviceProfileId\" mat-dialog-content fxLayout=\"column\">\n <tb-ota-package-autocomplete\n [useFullEntityId]=\"true\"\n [deviceProfileId]=\"entity.deviceProfileId.id\"\n formControlName=\"firmwareId\">\n </tb-ota-package-autocomplete>\n </div>\n <div mat-dialog-actions fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button mat-button color=\"primary\"\n type=\"button\"\n [disabled]=\"(isLoading$ | async)\"\n (click)=\"cancel()\" cdkFocusInitial>\n Cancel\n </button>\n <button mat-button mat-raised-button color=\"primary\"\n type=\"submit\"\n [disabled]=\"(isLoading$ | async) || editEntityForm.invalid || !editEntityForm.dirty\">\n Save\n </button>\n </div>\n</form>",
|
|
|
1146
|
+ "customCss": "form {\n min-width: 300px !important;\n}",
|
|
|
1147
|
+ "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\n\nopenEditEntityDialog();\n\nfunction openEditEntityDialog() {\n customDialog.customDialog(htmlTemplate, EditEntityDialogController).subscribe();\n}\n\nfunction EditEntityDialogController(instance) {\n let vm = instance;\n\n vm.entityName = entityName;\n vm.entity = {};\n\n vm.editEntityFormGroup = vm.fb.group({\n firmwareId: [null]\n });\n\n getEntityInfo();\n\n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n\n vm.save = function() {\n vm.editEntityFormGroup.markAsPristine();\n saveEntity().subscribe(\n function () {\n // widgetContext.updateAliases();\n vm.dialogRef.close(null);\n }\n );\n };\n\n\n function getEntityInfo() {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n vm.entity = data;\n vm.editEntityFormGroup.patchValue({\n firmwareId: vm.entity.firmwareId\n }, {emitEvent: false});\n }\n );\n }\n\n function saveEntity() {\n const formValues = vm.editEntityFormGroup.value;\n vm.entity.firmwareId = formValues.firmwareId;\n return deviceService.saveDevice(vm.entity);\n }\n}",
|
|
|
1148
|
+ "customResources": [],
|
|
|
1149
|
+ "id": "23099c1d-454b-25dc-8bc0-7cf33c21c5d5"
|
|
|
1150
|
+ },
|
|
|
1151
|
+ {
|
|
|
1152
|
+ "name": "Download firmware",
|
|
|
1153
|
+ "icon": "file_download",
|
|
|
1154
|
+ "type": "custom",
|
|
|
1155
|
+ "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet otaPackageService = $injector.get(widgetContext.servicesMap.get('otaPackageService'));\nlet deviceProfileService = $injector.get(widgetContext.servicesMap.get('deviceProfileService'));\n\ngetDeviceFirmware();\n\nfunction getDeviceFirmware() {\n var entityIdValue = entityId.id;\n var data = widgetContext.data.find((el) => el.datasource.entityId === entityIdValue && el.dataKey.name === 'fw_url');\n var url = data.data[0][1];\n if (url === '') {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n if (data.firmwareId !== null) {\n otaPackageService.downloadOtaPackage(data.firmwareId.id).subscribe(); \n } else {\n deviceProfileService.getDeviceProfile(data.deviceProfileId.id).subscribe(\n function (deviceProfile) {\n if (deviceProfile.firmwareId !== null) {\n otaPackageService.downloadOtaPackage(deviceProfile.firmwareId.id).subscribe();\n } else {\n widgetContext.showToast('warn', 'Device ' + entityName +' has not firmware set.', 2000, 'top');\n }\n });\n }\n }\n );\n } else {\n widgetContext.showToast('warn', 'Device ' + entityName +' has not firmware set.', 2000, 'top');\n }\n}",
|
|
|
1156
|
+ "id": "12533058-42f6-e75f-620c-219c48d01ec0"
|
|
|
1157
|
+ },
|
|
|
1158
|
+ {
|
|
|
1159
|
+ "name": "Copy checksum/URL",
|
|
|
1160
|
+ "icon": "content_copy",
|
|
|
1161
|
+ "type": "custom",
|
|
|
1162
|
+ "customFunction": "function copyToClipboard(text) {\n if (window.clipboardData && window.clipboardData.setData) {\n return window.clipboardData.setData(\"Text\", text);\n\n }\n else if (document.queryCommandSupported && document.queryCommandSupported(\"copy\")) {\n var textarea = document.createElement(\"textarea\");\n textarea.textContent = text;\n textarea.style.position = \"fixed\";\n document.body.appendChild(textarea);\n textarea.select();\n try {\n return document.execCommand(\"copy\");\n }\n catch (ex) {\n console.warn(\"Copy to clipboard failed.\", ex);\n return false;\n }\n document.body.removeChild(textarea);\n }\n}\nvar entityIdValue = entityId.id;\nvar data = widgetContext.data.find((el) => el.datasource.entityId === entityIdValue && el.dataKey.name === 'fw_checksum');\nvar checksum = data.data[0][1];\nif (checksum !== '') {\n copyToClipboard(checksum);\n widgetContext.showSuccessToast('Firmware checksum has been copied to clipboard', 2000, 'top');\n} else {\n data = widgetContext.data.find((el) => el.datasource.entityId === entityIdValue && el.dataKey.name === 'fw_url');\n var url = data.data[0][1];\n if (url !== '') {\n copyToClipboard(url);\n widgetContext.showSuccessToast('Firmware direct URL has been copied to clipboard', 2000, 'top');\n } else {\n widgetContext.showToast('warn', 'Device ' + entityName +' has not firmware set.', 2000, 'top');\n }\n}",
|
|
|
1163
|
+ "id": "09323079-7111-87f7-90d1-c62cd7d85dc7"
|
|
|
1164
|
+ }
|
|
|
1165
|
+ ]
|
|
|
1166
|
+ },
|
|
|
1167
|
+ "showTitleIcon": false,
|
|
|
1168
|
+ "iconColor": "rgba(0, 0, 0, 0.87)",
|
|
|
1169
|
+ "iconSize": "24px",
|
|
|
1170
|
+ "titleTooltip": "",
|
|
|
1171
|
+ "widgetStyle": {}
|
|
|
1172
|
+ },
|
|
|
1173
|
+ "row": 0,
|
|
|
1174
|
+ "col": 0,
|
|
|
1175
|
+ "id": "21be08bb-ec90-f760-ad6f-e7678f12c401",
|
|
|
1176
|
+ "typeFullFqn": "system.cards.entities_table"
|
|
|
1177
|
+ },
|
|
|
1178
|
+ "e8280043-d3dc-7acb-c2ff-a4522972ff91": {
|
|
|
1179
|
+ "type": "latest",
|
|
|
1180
|
+ "sizeX": 7.5,
|
|
|
1181
|
+ "sizeY": 6.5,
|
|
|
1182
|
+ "config": {
|
|
|
1183
|
+ "timewindow": {
|
|
|
1184
|
+ "displayValue": "",
|
|
|
1185
|
+ "selectedTab": 0,
|
|
|
1186
|
+ "realtime": {
|
|
|
1187
|
+ "realtimeType": 1,
|
|
|
1188
|
+ "interval": 1000,
|
|
|
1189
|
+ "timewindowMs": 86400000,
|
|
|
1190
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
1191
|
+ },
|
|
|
1192
|
+ "history": {
|
|
|
1193
|
+ "historyType": 0,
|
|
|
1194
|
+ "interval": 1000,
|
|
|
1195
|
+ "timewindowMs": 60000,
|
|
|
1196
|
+ "fixedTimewindow": {
|
|
|
1197
|
+ "startTimeMs": 1694085363133,
|
|
|
1198
|
+ "endTimeMs": 1694171763133
|
|
|
1199
|
+ },
|
|
|
1200
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
1201
|
+ },
|
|
|
1202
|
+ "aggregation": {
|
|
|
1203
|
+ "type": "NONE",
|
|
|
1204
|
+ "limit": 200
|
|
|
1205
|
+ }
|
|
|
1206
|
+ },
|
|
|
1207
|
+ "showTitle": true,
|
|
|
1208
|
+ "backgroundColor": "rgb(255, 255, 255)",
|
|
|
1209
|
+ "color": "rgba(0, 0, 0, 0.87)",
|
|
|
1210
|
+ "padding": "4px",
|
|
|
1211
|
+ "settings": {
|
|
|
1212
|
+ "enableSearch": true,
|
|
|
1213
|
+ "displayPagination": true,
|
|
|
1214
|
+ "defaultPageSize": 10,
|
|
|
1215
|
+ "defaultSortOrder": "entityName",
|
|
|
1216
|
+ "displayEntityName": true,
|
|
|
1217
|
+ "displayEntityType": false,
|
|
|
1218
|
+ "enableSelectColumnDisplay": false,
|
|
|
1219
|
+ "enableStickyHeader": true,
|
|
|
1220
|
+ "enableStickyAction": true,
|
|
|
1221
|
+ "entitiesTitle": "Devices",
|
|
|
1222
|
+ "displayEntityLabel": false,
|
|
|
1223
|
+ "entityNameColumnTitle": "Device"
|
|
|
1224
|
+ },
|
|
|
1225
|
+ "title": "New Entities table",
|
|
|
1226
|
+ "dropShadow": true,
|
|
|
1227
|
+ "enableFullscreen": true,
|
|
|
1228
|
+ "titleStyle": {
|
|
|
1229
|
+ "fontSize": "16px",
|
|
|
1230
|
+ "fontWeight": 400,
|
|
|
1231
|
+ "padding": "5px 10px 5px 10px"
|
|
|
1232
|
+ },
|
|
|
1233
|
+ "useDashboardTimewindow": false,
|
|
|
1234
|
+ "showLegend": false,
|
|
|
1235
|
+ "datasources": [
|
|
|
1236
|
+ {
|
|
|
1237
|
+ "type": "entity",
|
|
|
1238
|
+ "name": null,
|
|
|
1239
|
+ "entityAliasId": "639da5b4-31f0-0151-6282-c37a3897b7e8",
|
|
|
1240
|
+ "filterId": "579f0468-9ce9-7e3e-b34c-88dd3de59897",
|
|
|
1241
|
+ "dataKeys": [
|
|
|
1242
|
+ {
|
|
|
1243
|
+ "name": "current_fw_title",
|
|
|
1244
|
+ "type": "timeseries",
|
|
|
1245
|
+ "label": "Current FW title",
|
|
|
1246
|
+ "color": "#2196f3",
|
|
|
1247
|
+ "settings": {
|
|
|
1248
|
+ "columnWidth": "0px",
|
|
|
1249
|
+ "useCellStyleFunction": false,
|
|
|
1250
|
+ "cellStyleFunction": "",
|
|
|
1251
|
+ "useCellContentFunction": false,
|
|
|
1252
|
+ "defaultColumnVisibility": "visible",
|
|
|
1253
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
1254
|
+ },
|
|
|
1255
|
+ "_hash": 0.09545533885166413,
|
|
|
1256
|
+ "units": null,
|
|
|
1257
|
+ "decimals": null,
|
|
|
1258
|
+ "funcBody": null,
|
|
|
1259
|
+ "usePostProcessing": null,
|
|
|
1260
|
+ "postFuncBody": null
|
|
|
1261
|
+ },
|
|
|
1262
|
+ {
|
|
|
1263
|
+ "name": "current_fw_version",
|
|
|
1264
|
+ "type": "timeseries",
|
|
|
1265
|
+ "label": "Current FW version",
|
|
|
1266
|
+ "color": "#4caf50",
|
|
|
1267
|
+ "settings": {
|
|
|
1268
|
+ "columnWidth": "0px",
|
|
|
1269
|
+ "useCellStyleFunction": false,
|
|
|
1270
|
+ "cellStyleFunction": "",
|
|
|
1271
|
+ "useCellContentFunction": false,
|
|
|
1272
|
+ "defaultColumnVisibility": "visible",
|
|
|
1273
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
1274
|
+ },
|
|
|
1275
|
+ "_hash": 0.7206056602328659,
|
|
|
1276
|
+ "units": null,
|
|
|
1277
|
+ "decimals": null,
|
|
|
1278
|
+ "funcBody": null,
|
|
|
1279
|
+ "usePostProcessing": null,
|
|
|
1280
|
+ "postFuncBody": null
|
|
|
1281
|
+ },
|
|
|
1282
|
+ {
|
|
|
1283
|
+ "name": "target_fw_title",
|
|
|
1284
|
+ "type": "timeseries",
|
|
|
1285
|
+ "label": "Target FW title",
|
|
|
1286
|
+ "color": "#ffc107",
|
|
|
1287
|
+ "settings": {
|
|
|
1288
|
+ "columnWidth": "0px",
|
|
|
1289
|
+ "useCellStyleFunction": false,
|
|
|
1290
|
+ "cellStyleFunction": "",
|
|
|
1291
|
+ "useCellContentFunction": false,
|
|
|
1292
|
+ "defaultColumnVisibility": "visible",
|
|
|
1293
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
1294
|
+ },
|
|
|
1295
|
+ "_hash": 0.9934225682766313,
|
|
|
1296
|
+ "units": null,
|
|
|
1297
|
+ "decimals": null,
|
|
|
1298
|
+ "funcBody": null,
|
|
|
1299
|
+ "usePostProcessing": null,
|
|
|
1300
|
+ "postFuncBody": null
|
|
|
1301
|
+ },
|
|
|
1302
|
+ {
|
|
|
1303
|
+ "name": "target_fw_version",
|
|
|
1304
|
+ "type": "timeseries",
|
|
|
1305
|
+ "label": "Target FW version",
|
|
|
1306
|
+ "color": "#607d8b",
|
|
|
1307
|
+ "settings": {
|
|
|
1308
|
+ "columnWidth": "0px",
|
|
|
1309
|
+ "useCellStyleFunction": false,
|
|
|
1310
|
+ "cellStyleFunction": "",
|
|
|
1311
|
+ "useCellContentFunction": false,
|
|
|
1312
|
+ "cellContentFunction": "",
|
|
|
1313
|
+ "defaultColumnVisibility": "visible",
|
|
|
1314
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
1315
|
+ },
|
|
|
1316
|
+ "_hash": 0.5251724416842531,
|
|
|
1317
|
+ "units": null,
|
|
|
1318
|
+ "decimals": null,
|
|
|
1319
|
+ "funcBody": null,
|
|
|
1320
|
+ "usePostProcessing": null,
|
|
|
1321
|
+ "postFuncBody": null
|
|
|
1322
|
+ },
|
|
|
1323
|
+ {
|
|
|
1324
|
+ "name": "target_fw_ts",
|
|
|
1325
|
+ "type": "timeseries",
|
|
|
1326
|
+ "label": "Target FW set time",
|
|
|
1327
|
+ "color": "#e91e63",
|
|
|
1328
|
+ "settings": {
|
|
|
1329
|
+ "columnWidth": "0px",
|
|
|
1330
|
+ "useCellStyleFunction": false,
|
|
|
1331
|
+ "cellStyleFunction": "",
|
|
|
1332
|
+ "useCellContentFunction": true,
|
|
|
1333
|
+ "defaultColumnVisibility": "visible",
|
|
|
1334
|
+ "columnSelectionToDisplay": "enabled",
|
|
|
1335
|
+ "cellContentFunction": "if (value !== '') {\n return ctx.date.transform(value, 'yyyy-MM-dd HH:mm:ss');\n}\nreturn '';"
|
|
|
1336
|
+ },
|
|
|
1337
|
+ "_hash": 0.31823244858578237,
|
|
|
1338
|
+ "units": null,
|
|
|
1339
|
+ "decimals": null,
|
|
|
1340
|
+ "funcBody": null,
|
|
|
1341
|
+ "usePostProcessing": null,
|
|
|
1342
|
+ "postFuncBody": null
|
|
|
1343
|
+ },
|
|
|
1344
|
+ {
|
|
|
1345
|
+ "name": "fw_state",
|
|
|
1346
|
+ "type": "timeseries",
|
|
|
1347
|
+ "label": "Progress",
|
|
|
1348
|
+ "color": "#9c27b0",
|
|
|
1349
|
+ "settings": {
|
|
|
1350
|
+ "columnWidth": "30%",
|
|
|
1351
|
+ "useCellStyleFunction": true,
|
|
|
1352
|
+ "useCellContentFunction": true,
|
|
|
1353
|
+ "defaultColumnVisibility": "visible",
|
|
|
1354
|
+ "columnSelectionToDisplay": "enabled",
|
|
|
1355
|
+ "cellStyleFunction": "return {\n 'padding-right': '30px'\n}",
|
|
|
1356
|
+ "cellContentFunction": "if (value !== '') {\n var mapProgress = {\n 'QUEUED': 0,\n 'INITIATED': 5,\n 'DOWNLOADING': 10,\n 'DOWNLOADED': 55,\n 'VERIFIED': 60,\n 'UPDATING': 70,\n 'FAILED': 99,\n 'UPDATED': 100\n }\n var color = 'mat-primary';\n var progress = mapProgress[value];\n if (value == 'FAILED') {\n color = 'mat-accent';\n }\n return `<mat-progress-bar style=\"height: 8px\" role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\" tabindex=\"-1\" mode=\"determinate\" value=\"${progress}\" class=\"mat-progress-bar ${color}\" aria-valuenow=\"${progress}\"><div aria-hidden=\"true\"><svg width=\"100%\" height=\"8\" focusable=\"false\" class=\"mat-progress-bar-background mat-progress-bar-element\"><defs><pattern x=\"4\" y=\"0\" width=\"8\" height=\"4\" patternUnits=\"userSpaceOnUse\" id=\"mat-progress-bar-0\"><circle cx=\"2\" cy=\"2\" r=\"2\"></circle></pattern></defs><rect width=\"100%\" height=\"100%\" fill=\"url(\"/components/progress-bar/overview#mat-progress-bar-0\")\"></rect></svg><div class=\"mat-progress-bar-buffer mat-progress-bar-element\"></div><div class=\"mat-progress-bar-primary mat-progress-bar-fill mat-progress-bar-element\" style=\"transform: scale3d(${progress / 100}, 1, 1);\"></div><div class=\"mat-progress-bar-secondary mat-progress-bar-fill mat-progress-bar-element\"></div></div></mat-progress-bar>`;\n}"
|
|
|
1357
|
+ },
|
|
|
1358
|
+ "_hash": 0.8174211757846257,
|
|
|
1359
|
+ "units": null,
|
|
|
1360
|
+ "decimals": null,
|
|
|
1361
|
+ "funcBody": null,
|
|
|
1362
|
+ "usePostProcessing": null,
|
|
|
1363
|
+ "postFuncBody": null
|
|
|
1364
|
+ },
|
|
|
1365
|
+ {
|
|
|
1366
|
+ "name": "fw_state",
|
|
|
1367
|
+ "type": "timeseries",
|
|
|
1368
|
+ "label": "Status",
|
|
|
1369
|
+ "color": "#f44336",
|
|
|
1370
|
+ "settings": {
|
|
|
1371
|
+ "columnWidth": "130px",
|
|
|
1372
|
+ "useCellStyleFunction": true,
|
|
|
1373
|
+ "useCellContentFunction": true,
|
|
|
1374
|
+ "defaultColumnVisibility": "visible",
|
|
|
1375
|
+ "columnSelectionToDisplay": "enabled",
|
|
|
1376
|
+ "cellStyleFunction": "if (value == 'FAILED') {\n return {'color' : '#D93025'};\n}\nreturn {};",
|
|
|
1377
|
+ "cellContentFunction": "function icon(value) {\n if (value == 'QUEUED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000;\"><svg style=\"width:24px;height:24px\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M6,2V8H6V8L10,12L6,16V16H6V22H18V16H18V16L14,12L18,8V8H18V2H6M16,16.5V20H8V16.5L12,12.5L16,16.5M12,11.5L8,7.5V4H16V7.5L12,11.5Z\" /></svg></mat-icon>';\n }\n if (value == 'INITIATED' || value == 'DOWNLOADING' || value == 'DOWNLOADED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000\"><svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.74 2.1951C11.63 1.2876 10.2575 0.687598 8.75 0.537598V2.0526C9.845 2.1876 10.8425 2.6226 11.675 3.2676L12.74 2.1951ZM13.9475 7.2501H15.4625C15.3125 5.7426 14.7125 4.3701 13.805 3.2601L12.7325 4.3251C13.3775 5.1576 13.8125 6.1551 13.9475 7.2501ZM12.7325 11.6751L13.805 12.7476C14.7125 11.6376 15.3125 10.2576 15.4625 8.7576H13.9475C13.8125 9.8451 13.3775 10.8426 12.7325 11.6751ZM8.75 13.9476V15.4626C10.2575 15.3126 11.63 14.7126 12.74 13.8051L11.6675 12.7326C10.8425 13.3776 9.845 13.8126 8.75 13.9476ZM8.75 8.0001V4.2501H7.25V8.0001H4.25L8 11.7501L11.75 8.0001H8.75ZM7.25 13.9476V15.4626C3.4625 15.0876 0.5 11.8926 0.5 8.0001C0.5 4.1076 3.4625 0.912598 7.25 0.537598V2.0526C4.2875 2.4201 2 4.9401 2 8.0001C2 11.0601 4.2875 13.5801 7.25 13.9476Z\" fill=\"black\"/></svg></mat-icon>';\n }\n if (value == 'VERIFIED' || value == 'UPDATING' ) {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000\">update</mat-icon>';\n }\n if (value == 'UPDATED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000\"><svg style=\"width:22px;height:22px\" viewBox=\"0 0 34 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M33.26 2.82L30.44 0L12.06 18.38L3.55999 9.9L0.73999 12.72L12.06 24.04L33.26 2.82Z\" fill=\"black\"/><path d=\"M31 28H3V32H31V28Z\" fill=\"black\"/></svg></mat-icon>';\n }\n if (value == 'FAILED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #D93025\">warning</mat-icon>';\n }\n return '';\n}\nfunction capitalize (s) {\n if (typeof s !== 'string') return '';\n return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nreturn icon(value) + '<span style=\"vertical-align: super;padding-left: 8px;\">' + capitalize(value) + '</span>';"
|
|
|
1378
|
+ },
|
|
|
1379
|
+ "_hash": 0.7764426948615217,
|
|
|
1380
|
+ "units": null,
|
|
|
1381
|
+ "decimals": null,
|
|
|
1382
|
+ "funcBody": null,
|
|
|
1383
|
+ "usePostProcessing": null,
|
|
|
1384
|
+ "postFuncBody": null
|
|
|
1385
|
+ },
|
|
|
1386
|
+ {
|
|
|
1387
|
+ "name": "fw_checksum",
|
|
|
1388
|
+ "type": "attribute",
|
|
|
1389
|
+ "label": "fw_checksum",
|
|
|
1390
|
+ "color": "#3f51b5",
|
|
|
1391
|
+ "settings": {
|
|
|
1392
|
+ "columnWidth": "0px",
|
|
|
1393
|
+ "useCellStyleFunction": false,
|
|
|
1394
|
+ "cellStyleFunction": "",
|
|
|
1395
|
+ "useCellContentFunction": false,
|
|
|
1396
|
+ "defaultColumnVisibility": "hidden",
|
|
|
1397
|
+ "columnSelectionToDisplay": "disabled"
|
|
|
1398
|
+ },
|
|
|
1399
|
+ "_hash": 0.5594087842471693,
|
|
|
1400
|
+ "units": null,
|
|
|
1401
|
+ "decimals": null,
|
|
|
1402
|
+ "funcBody": null,
|
|
|
1403
|
+ "usePostProcessing": null,
|
|
|
1404
|
+ "postFuncBody": null
|
|
|
1405
|
+ },
|
|
|
1406
|
+ {
|
|
|
1407
|
+ "name": "fw_url",
|
|
|
1408
|
+ "type": "attribute",
|
|
|
1409
|
+ "label": "fw_url",
|
|
|
1410
|
+ "color": "#e91e63",
|
|
|
1411
|
+ "settings": {
|
|
|
1412
|
+ "columnWidth": "0px",
|
|
|
1413
|
+ "useCellStyleFunction": false,
|
|
|
1414
|
+ "cellStyleFunction": "",
|
|
|
1415
|
+ "useCellContentFunction": false,
|
|
|
1416
|
+ "cellContentFunction": "",
|
|
|
1417
|
+ "defaultColumnVisibility": "hidden",
|
|
|
1418
|
+ "columnSelectionToDisplay": "disabled"
|
|
|
1419
|
+ },
|
|
|
1420
|
+ "_hash": 0.4204673738685043,
|
|
|
1421
|
+ "units": null,
|
|
|
1422
|
+ "decimals": null,
|
|
|
1423
|
+ "funcBody": null,
|
|
|
1424
|
+ "usePostProcessing": null,
|
|
|
1425
|
+ "postFuncBody": null
|
|
|
1426
|
+ }
|
|
|
1427
|
+ ]
|
|
|
1428
|
+ }
|
|
|
1429
|
+ ],
|
|
|
1430
|
+ "actions": {
|
|
|
1431
|
+ "actionCellButton": [
|
|
|
1432
|
+ {
|
|
|
1433
|
+ "name": "History firmware update",
|
|
|
1434
|
+ "icon": "history",
|
|
|
1435
|
+ "type": "openDashboardState",
|
|
|
1436
|
+ "targetDashboardStateId": "device_firmware_history",
|
|
|
1437
|
+ "setEntityId": true,
|
|
|
1438
|
+ "stateEntityParamName": null,
|
|
|
1439
|
+ "openInSeparateDialog": false,
|
|
|
1440
|
+ "dialogTitle": "",
|
|
|
1441
|
+ "dialogHideDashboardToolbar": true,
|
|
|
1442
|
+ "dialogWidth": null,
|
|
|
1443
|
+ "dialogHeight": null,
|
|
|
1444
|
+ "openRightLayout": false,
|
|
|
1445
|
+ "id": "98a1406c-3301-bc2f-2c5d-d637ce3b663b"
|
|
|
1446
|
+ },
|
|
|
1447
|
+ {
|
|
|
1448
|
+ "name": "Edit firmware",
|
|
|
1449
|
+ "icon": "edit",
|
|
|
1450
|
+ "type": "customPretty",
|
|
|
1451
|
+ "customHtml": "<form #editEntityForm=\"ngForm\" [formGroup]=\"editEntityFormGroup\"\n (ngSubmit)=\"save()\" class=\"edit-entity-form\">\n <mat-toolbar fxLayout=\"row\" color=\"primary\">\n <h2>Edit firmware {{entityName}}</h2>\n <span fxFlex></span>\n <button mat-icon-button (click)=\"cancel()\" type=\"button\">\n <mat-icon class=\"material-icons\">close</mat-icon>\n </button>\n </mat-toolbar>\n <mat-progress-bar color=\"warn\" mode=\"indeterminate\" *ngIf=\"isLoading$ | async\">\n </mat-progress-bar>\n <div style=\"height: 4px;\" *ngIf=\"!(isLoading$ | async)\"></div>\n <div *ngIf=\"entity.deviceProfileId\" mat-dialog-content fxLayout=\"column\">\n <tb-ota-package-autocomplete\n [useFullEntityId]=\"true\"\n [deviceProfileId]=\"entity.deviceProfileId.id\"\n formControlName=\"firmwareId\">\n </tb-ota-package-autocomplete>\n </div>\n <div mat-dialog-actions fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button mat-button color=\"primary\"\n type=\"button\"\n [disabled]=\"(isLoading$ | async)\"\n (click)=\"cancel()\" cdkFocusInitial>\n Cancel\n </button>\n <button mat-button mat-raised-button color=\"primary\"\n type=\"submit\"\n [disabled]=\"(isLoading$ | async) || editEntityForm.invalid || !editEntityForm.dirty\">\n Save\n </button>\n </div>\n</form>",
|
|
|
1452
|
+ "customCss": "form {\n min-width: 300px !important;\n}",
|
|
|
1453
|
+ "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\n\nopenEditEntityDialog();\n\nfunction openEditEntityDialog() {\n customDialog.customDialog(htmlTemplate, EditEntityDialogController).subscribe();\n}\n\nfunction EditEntityDialogController(instance) {\n let vm = instance;\n\n vm.entityName = entityName;\n vm.entity = {};\n\n vm.editEntityFormGroup = vm.fb.group({\n firmwareId: [null]\n });\n\n getEntityInfo();\n\n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n\n vm.save = function() {\n vm.editEntityFormGroup.markAsPristine();\n saveEntity().subscribe(\n function () {\n // widgetContext.updateAliases();\n vm.dialogRef.close(null);\n }\n );\n };\n\n\n function getEntityInfo() {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n vm.entity = data;\n vm.editEntityFormGroup.patchValue({\n firmwareId: vm.entity.firmwareId\n }, {emitEvent: false});\n }\n );\n }\n\n function saveEntity() {\n const formValues = vm.editEntityFormGroup.value;\n vm.entity.firmwareId = formValues.firmwareId;\n return deviceService.saveDevice(vm.entity);\n }\n}",
|
|
|
1454
|
+ "customResources": [],
|
|
|
1455
|
+ "id": "23099c1d-454b-25dc-8bc0-7cf33c21c5d5"
|
|
|
1456
|
+ },
|
|
|
1457
|
+ {
|
|
|
1458
|
+ "name": "Download firmware",
|
|
|
1459
|
+ "icon": "file_download",
|
|
|
1460
|
+ "type": "custom",
|
|
|
1461
|
+ "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet otaPackageService = $injector.get(widgetContext.servicesMap.get('otaPackageService'));\nlet deviceProfileService = $injector.get(widgetContext.servicesMap.get('deviceProfileService'));\n\ngetDeviceFirmware();\n\nfunction getDeviceFirmware() {\n var entityIdValue = entityId.id;\n var data = widgetContext.data.find((el) => el.datasource.entityId === entityIdValue && el.dataKey.name === 'fw_url');\n var url = data.data[0][1];\n if (url === '') {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n if (data.firmwareId !== null) {\n otaPackageService.downloadOtaPackage(data.firmwareId.id).subscribe(); \n } else {\n deviceProfileService.getDeviceProfile(data.deviceProfileId.id).subscribe(\n function (deviceProfile) {\n if (deviceProfile.firmwareId !== null) {\n otaPackageService.downloadOtaPackage(deviceProfile.firmwareId.id).subscribe();\n } else {\n widgetContext.showToast('warn', 'Device ' + entityName +' has not firmware set.', 2000, 'top');\n }\n });\n }\n }\n );\n } else {\n widgetContext.showToast('warn', 'Device ' + entityName +' has not firmware set.', 2000, 'top');\n }\n}",
|
|
|
1462
|
+ "id": "12533058-42f6-e75f-620c-219c48d01ec0"
|
|
|
1463
|
+ },
|
|
|
1464
|
+ {
|
|
|
1465
|
+ "name": "Copy checksum/URL",
|
|
|
1466
|
+ "icon": "content_copy",
|
|
|
1467
|
+ "type": "custom",
|
|
|
1468
|
+ "customFunction": "function copyToClipboard(text) {\n if (window.clipboardData && window.clipboardData.setData) {\n return window.clipboardData.setData(\"Text\", text);\n\n }\n else if (document.queryCommandSupported && document.queryCommandSupported(\"copy\")) {\n var textarea = document.createElement(\"textarea\");\n textarea.textContent = text;\n textarea.style.position = \"fixed\";\n document.body.appendChild(textarea);\n textarea.select();\n try {\n return document.execCommand(\"copy\");\n }\n catch (ex) {\n console.warn(\"Copy to clipboard failed.\", ex);\n return false;\n }\n document.body.removeChild(textarea);\n }\n}\nvar entityIdValue = entityId.id;\nvar data = widgetContext.data.find((el) => el.datasource.entityId === entityIdValue && el.dataKey.name === 'fw_checksum');\nvar checksum = data.data[0][1];\nif (checksum !== '') {\n copyToClipboard(checksum);\n widgetContext.showSuccessToast('Firmware checksum has been copied to clipboard', 2000, 'top');\n} else {\n data = widgetContext.data.find((el) => el.datasource.entityId === entityIdValue && el.dataKey.name === 'fw_url');\n var url = data.data[0][1];\n if (url !== '') {\n copyToClipboard(url);\n widgetContext.showSuccessToast('Firmware direct URL has been copied to clipboard', 2000, 'top');\n } else {\n widgetContext.showToast('warn', 'Device ' + entityName +' has not firmware set.', 2000, 'top');\n }\n}",
|
|
|
1469
|
+ "id": "09323079-7111-87f7-90d1-c62cd7d85dc7"
|
|
|
1470
|
+ }
|
|
|
1471
|
+ ]
|
|
|
1472
|
+ },
|
|
|
1473
|
+ "showTitleIcon": false,
|
|
|
1474
|
+ "iconColor": "rgba(0, 0, 0, 0.87)",
|
|
|
1475
|
+ "iconSize": "24px",
|
|
|
1476
|
+ "titleTooltip": "",
|
|
|
1477
|
+ "widgetStyle": {}
|
|
|
1478
|
+ },
|
|
|
1479
|
+ "row": 0,
|
|
|
1480
|
+ "col": 0,
|
|
|
1481
|
+ "id": "e8280043-d3dc-7acb-c2ff-a4522972ff91",
|
|
|
1482
|
+ "typeFullFqn": "system.cards.entities_table"
|
|
|
1483
|
+ },
|
|
|
1484
|
+ "3624013b-378c-f110-5eba-ae95c25a4dcc": {
|
|
|
1485
|
+ "type": "latest",
|
|
|
1486
|
+ "sizeX": 7.5,
|
|
|
1487
|
+ "sizeY": 6.5,
|
|
|
1488
|
+ "config": {
|
|
|
1489
|
+ "timewindow": {
|
|
|
1490
|
+ "displayValue": "",
|
|
|
1491
|
+ "selectedTab": 0,
|
|
|
1492
|
+ "realtime": {
|
|
|
1493
|
+ "realtimeType": 1,
|
|
|
1494
|
+ "interval": 1000,
|
|
|
1495
|
+ "timewindowMs": 86400000,
|
|
|
1496
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
1497
|
+ },
|
|
|
1498
|
+ "history": {
|
|
|
1499
|
+ "historyType": 0,
|
|
|
1500
|
+ "interval": 1000,
|
|
|
1501
|
+ "timewindowMs": 60000,
|
|
|
1502
|
+ "fixedTimewindow": {
|
|
|
1503
|
+ "startTimeMs": 1694085363133,
|
|
|
1504
|
+ "endTimeMs": 1694171763133
|
|
|
1505
|
+ },
|
|
|
1506
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
1507
|
+ },
|
|
|
1508
|
+ "aggregation": {
|
|
|
1509
|
+ "type": "NONE",
|
|
|
1510
|
+ "limit": 200
|
|
|
1511
|
+ }
|
|
|
1512
|
+ },
|
|
|
1513
|
+ "showTitle": true,
|
|
|
1514
|
+ "backgroundColor": "rgb(255, 255, 255)",
|
|
|
1515
|
+ "color": "rgba(0, 0, 0, 0.87)",
|
|
|
1516
|
+ "padding": "4px",
|
|
|
1517
|
+ "settings": {
|
|
|
1518
|
+ "enableSearch": true,
|
|
|
1519
|
+ "displayPagination": true,
|
|
|
1520
|
+ "defaultPageSize": 10,
|
|
|
1521
|
+ "defaultSortOrder": "entityName",
|
|
|
1522
|
+ "displayEntityName": true,
|
|
|
1523
|
+ "displayEntityType": false,
|
|
|
1524
|
+ "enableSelectColumnDisplay": false,
|
|
|
1525
|
+ "enableStickyHeader": true,
|
|
|
1526
|
+ "enableStickyAction": true,
|
|
|
1527
|
+ "entitiesTitle": "Devices",
|
|
|
1528
|
+ "displayEntityLabel": false,
|
|
|
1529
|
+ "entityNameColumnTitle": "Device"
|
|
|
1530
|
+ },
|
|
|
1531
|
+ "title": "New Entities table",
|
|
|
1532
|
+ "dropShadow": true,
|
|
|
1533
|
+ "enableFullscreen": true,
|
|
|
1534
|
+ "titleStyle": {
|
|
|
1535
|
+ "fontSize": "16px",
|
|
|
1536
|
+ "fontWeight": 400,
|
|
|
1537
|
+ "padding": "5px 10px 5px 10px"
|
|
|
1538
|
+ },
|
|
|
1539
|
+ "useDashboardTimewindow": false,
|
|
|
1540
|
+ "showLegend": false,
|
|
|
1541
|
+ "datasources": [
|
|
|
1542
|
+ {
|
|
|
1543
|
+ "type": "entity",
|
|
|
1544
|
+ "name": null,
|
|
|
1545
|
+ "entityAliasId": "639da5b4-31f0-0151-6282-c37a3897b7e8",
|
|
|
1546
|
+ "filterId": "bdbc6ea1-95a7-3912-341a-58dc7704a00f",
|
|
|
1547
|
+ "dataKeys": [
|
|
|
1548
|
+ {
|
|
|
1549
|
+ "name": "current_fw_title",
|
|
|
1550
|
+ "type": "timeseries",
|
|
|
1551
|
+ "label": "Current FW title",
|
|
|
1552
|
+ "color": "#2196f3",
|
|
|
1553
|
+ "settings": {
|
|
|
1554
|
+ "columnWidth": "0px",
|
|
|
1555
|
+ "useCellStyleFunction": false,
|
|
|
1556
|
+ "cellStyleFunction": "",
|
|
|
1557
|
+ "useCellContentFunction": false,
|
|
|
1558
|
+ "defaultColumnVisibility": "visible",
|
|
|
1559
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
1560
|
+ },
|
|
|
1561
|
+ "_hash": 0.09545533885166413,
|
|
|
1562
|
+ "units": null,
|
|
|
1563
|
+ "decimals": null,
|
|
|
1564
|
+ "funcBody": null,
|
|
|
1565
|
+ "usePostProcessing": null,
|
|
|
1566
|
+ "postFuncBody": null
|
|
|
1567
|
+ },
|
|
|
1568
|
+ {
|
|
|
1569
|
+ "name": "current_fw_version",
|
|
|
1570
|
+ "type": "timeseries",
|
|
|
1571
|
+ "label": "Current FW version",
|
|
|
1572
|
+ "color": "#4caf50",
|
|
|
1573
|
+ "settings": {
|
|
|
1574
|
+ "columnWidth": "0px",
|
|
|
1575
|
+ "useCellStyleFunction": false,
|
|
|
1576
|
+ "cellStyleFunction": "",
|
|
|
1577
|
+ "useCellContentFunction": false,
|
|
|
1578
|
+ "defaultColumnVisibility": "visible",
|
|
|
1579
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
1580
|
+ },
|
|
|
1581
|
+ "_hash": 0.7206056602328659,
|
|
|
1582
|
+ "units": null,
|
|
|
1583
|
+ "decimals": null,
|
|
|
1584
|
+ "funcBody": null,
|
|
|
1585
|
+ "usePostProcessing": null,
|
|
|
1586
|
+ "postFuncBody": null
|
|
|
1587
|
+ },
|
|
|
1588
|
+ {
|
|
|
1589
|
+ "name": "target_fw_title",
|
|
|
1590
|
+ "type": "timeseries",
|
|
|
1591
|
+ "label": "Target FW title",
|
|
|
1592
|
+ "color": "#ffc107",
|
|
|
1593
|
+ "settings": {
|
|
|
1594
|
+ "columnWidth": "0px",
|
|
|
1595
|
+ "useCellStyleFunction": false,
|
|
|
1596
|
+ "cellStyleFunction": "",
|
|
|
1597
|
+ "useCellContentFunction": false,
|
|
|
1598
|
+ "defaultColumnVisibility": "visible",
|
|
|
1599
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
1600
|
+ },
|
|
|
1601
|
+ "_hash": 0.9934225682766313,
|
|
|
1602
|
+ "units": null,
|
|
|
1603
|
+ "decimals": null,
|
|
|
1604
|
+ "funcBody": null,
|
|
|
1605
|
+ "usePostProcessing": null,
|
|
|
1606
|
+ "postFuncBody": null
|
|
|
1607
|
+ },
|
|
|
1608
|
+ {
|
|
|
1609
|
+ "name": "target_fw_version",
|
|
|
1610
|
+ "type": "timeseries",
|
|
|
1611
|
+ "label": "Target FW version",
|
|
|
1612
|
+ "color": "#607d8b",
|
|
|
1613
|
+ "settings": {
|
|
|
1614
|
+ "columnWidth": "0px",
|
|
|
1615
|
+ "useCellStyleFunction": false,
|
|
|
1616
|
+ "cellStyleFunction": "",
|
|
|
1617
|
+ "useCellContentFunction": false,
|
|
|
1618
|
+ "cellContentFunction": "",
|
|
|
1619
|
+ "defaultColumnVisibility": "visible",
|
|
|
1620
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
1621
|
+ },
|
|
|
1622
|
+ "_hash": 0.5251724416842531,
|
|
|
1623
|
+ "units": null,
|
|
|
1624
|
+ "decimals": null,
|
|
|
1625
|
+ "funcBody": null,
|
|
|
1626
|
+ "usePostProcessing": null,
|
|
|
1627
|
+ "postFuncBody": null
|
|
|
1628
|
+ },
|
|
|
1629
|
+ {
|
|
|
1630
|
+ "name": "target_fw_ts",
|
|
|
1631
|
+ "type": "timeseries",
|
|
|
1632
|
+ "label": "Target FW set time",
|
|
|
1633
|
+ "color": "#e91e63",
|
|
|
1634
|
+ "settings": {
|
|
|
1635
|
+ "columnWidth": "0px",
|
|
|
1636
|
+ "useCellStyleFunction": false,
|
|
|
1637
|
+ "cellStyleFunction": "",
|
|
|
1638
|
+ "useCellContentFunction": true,
|
|
|
1639
|
+ "defaultColumnVisibility": "visible",
|
|
|
1640
|
+ "columnSelectionToDisplay": "enabled",
|
|
|
1641
|
+ "cellContentFunction": "if (value !== '') {\n return ctx.date.transform(value, 'yyyy-MM-dd HH:mm:ss');\n}\nreturn '';"
|
|
|
1642
|
+ },
|
|
|
1643
|
+ "_hash": 0.31823244858578237,
|
|
|
1644
|
+ "units": null,
|
|
|
1645
|
+ "decimals": null,
|
|
|
1646
|
+ "funcBody": null,
|
|
|
1647
|
+ "usePostProcessing": null,
|
|
|
1648
|
+ "postFuncBody": null
|
|
|
1649
|
+ },
|
|
|
1650
|
+ {
|
|
|
1651
|
+ "name": "fw_state",
|
|
|
1652
|
+ "type": "timeseries",
|
|
|
1653
|
+ "label": "Progress",
|
|
|
1654
|
+ "color": "#9c27b0",
|
|
|
1655
|
+ "settings": {
|
|
|
1656
|
+ "columnWidth": "30%",
|
|
|
1657
|
+ "useCellStyleFunction": true,
|
|
|
1658
|
+ "useCellContentFunction": true,
|
|
|
1659
|
+ "defaultColumnVisibility": "visible",
|
|
|
1660
|
+ "columnSelectionToDisplay": "enabled",
|
|
|
1661
|
+ "cellStyleFunction": "return {\n 'padding-right': '30px'\n}",
|
|
|
1662
|
+ "cellContentFunction": "if (value !== '') {\n var mapProgress = {\n 'QUEUED': 0,\n 'INITIATED': 5,\n 'DOWNLOADING': 10,\n 'DOWNLOADED': 55,\n 'VERIFIED': 60,\n 'UPDATING': 70,\n 'FAILED': 99,\n 'UPDATED': 100\n }\n var color = 'mat-primary';\n var progress = mapProgress[value];\n if (value == 'FAILED') {\n color = 'mat-accent';\n }\n return `<mat-progress-bar style=\"height: 8px\" role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\" tabindex=\"-1\" mode=\"determinate\" value=\"${progress}\" class=\"mat-progress-bar ${color}\" aria-valuenow=\"${progress}\"><div aria-hidden=\"true\"><svg width=\"100%\" height=\"8\" focusable=\"false\" class=\"mat-progress-bar-background mat-progress-bar-element\"><defs><pattern x=\"4\" y=\"0\" width=\"8\" height=\"4\" patternUnits=\"userSpaceOnUse\" id=\"mat-progress-bar-0\"><circle cx=\"2\" cy=\"2\" r=\"2\"></circle></pattern></defs><rect width=\"100%\" height=\"100%\" fill=\"url(\"/components/progress-bar/overview#mat-progress-bar-0\")\"></rect></svg><div class=\"mat-progress-bar-buffer mat-progress-bar-element\"></div><div class=\"mat-progress-bar-primary mat-progress-bar-fill mat-progress-bar-element\" style=\"transform: scale3d(${progress / 100}, 1, 1);\"></div><div class=\"mat-progress-bar-secondary mat-progress-bar-fill mat-progress-bar-element\"></div></div></mat-progress-bar>`;\n}"
|
|
|
1663
|
+ },
|
|
|
1664
|
+ "_hash": 0.8174211757846257,
|
|
|
1665
|
+ "units": null,
|
|
|
1666
|
+ "decimals": null,
|
|
|
1667
|
+ "funcBody": null,
|
|
|
1668
|
+ "usePostProcessing": null,
|
|
|
1669
|
+ "postFuncBody": null
|
|
|
1670
|
+ },
|
|
|
1671
|
+ {
|
|
|
1672
|
+ "name": "fw_state",
|
|
|
1673
|
+ "type": "timeseries",
|
|
|
1674
|
+ "label": "Status",
|
|
|
1675
|
+ "color": "#f44336",
|
|
|
1676
|
+ "settings": {
|
|
|
1677
|
+ "columnWidth": "130px",
|
|
|
1678
|
+ "useCellStyleFunction": true,
|
|
|
1679
|
+ "useCellContentFunction": true,
|
|
|
1680
|
+ "defaultColumnVisibility": "visible",
|
|
|
1681
|
+ "columnSelectionToDisplay": "enabled",
|
|
|
1682
|
+ "cellStyleFunction": "if (value == 'FAILED') {\n return {'color' : '#D93025'};\n}\nreturn {};",
|
|
|
1683
|
+ "cellContentFunction": "function icon(value) {\n if (value == 'QUEUED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000;\"><svg style=\"width:24px;height:24px\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M6,2V8H6V8L10,12L6,16V16H6V22H18V16H18V16L14,12L18,8V8H18V2H6M16,16.5V20H8V16.5L12,12.5L16,16.5M12,11.5L8,7.5V4H16V7.5L12,11.5Z\" /></svg></mat-icon>';\n }\n if (value == 'INITIATED' || value == 'DOWNLOADING' || value == 'DOWNLOADED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000\"><svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.74 2.1951C11.63 1.2876 10.2575 0.687598 8.75 0.537598V2.0526C9.845 2.1876 10.8425 2.6226 11.675 3.2676L12.74 2.1951ZM13.9475 7.2501H15.4625C15.3125 5.7426 14.7125 4.3701 13.805 3.2601L12.7325 4.3251C13.3775 5.1576 13.8125 6.1551 13.9475 7.2501ZM12.7325 11.6751L13.805 12.7476C14.7125 11.6376 15.3125 10.2576 15.4625 8.7576H13.9475C13.8125 9.8451 13.3775 10.8426 12.7325 11.6751ZM8.75 13.9476V15.4626C10.2575 15.3126 11.63 14.7126 12.74 13.8051L11.6675 12.7326C10.8425 13.3776 9.845 13.8126 8.75 13.9476ZM8.75 8.0001V4.2501H7.25V8.0001H4.25L8 11.7501L11.75 8.0001H8.75ZM7.25 13.9476V15.4626C3.4625 15.0876 0.5 11.8926 0.5 8.0001C0.5 4.1076 3.4625 0.912598 7.25 0.537598V2.0526C4.2875 2.4201 2 4.9401 2 8.0001C2 11.0601 4.2875 13.5801 7.25 13.9476Z\" fill=\"black\"/></svg></mat-icon>';\n }\n if (value == 'VERIFIED' || value == 'UPDATING' ) {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000\">update</mat-icon>';\n }\n if (value == 'UPDATED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000\"><svg style=\"width:22px;height:22px\" viewBox=\"0 0 34 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M33.26 2.82L30.44 0L12.06 18.38L3.55999 9.9L0.73999 12.72L12.06 24.04L33.26 2.82Z\" fill=\"black\"/><path d=\"M31 28H3V32H31V28Z\" fill=\"black\"/></svg></mat-icon>';\n }\n if (value == 'FAILED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #D93025\">warning</mat-icon>';\n }\n return '';\n}\nfunction capitalize (s) {\n if (typeof s !== 'string') return '';\n return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nreturn icon(value) + '<span style=\"vertical-align: super;padding-left: 8px;\">' + capitalize(value) + '</span>';"
|
|
|
1684
|
+ },
|
|
|
1685
|
+ "_hash": 0.7764426948615217,
|
|
|
1686
|
+ "units": null,
|
|
|
1687
|
+ "decimals": null,
|
|
|
1688
|
+ "funcBody": null,
|
|
|
1689
|
+ "usePostProcessing": null,
|
|
|
1690
|
+ "postFuncBody": null
|
|
|
1691
|
+ },
|
|
|
1692
|
+ {
|
|
|
1693
|
+ "name": "fw_checksum",
|
|
|
1694
|
+ "type": "attribute",
|
|
|
1695
|
+ "label": "fw_checksum",
|
|
|
1696
|
+ "color": "#3f51b5",
|
|
|
1697
|
+ "settings": {
|
|
|
1698
|
+ "columnWidth": "0px",
|
|
|
1699
|
+ "useCellStyleFunction": false,
|
|
|
1700
|
+ "cellStyleFunction": "",
|
|
|
1701
|
+ "useCellContentFunction": false,
|
|
|
1702
|
+ "defaultColumnVisibility": "hidden",
|
|
|
1703
|
+ "columnSelectionToDisplay": "disabled"
|
|
|
1704
|
+ },
|
|
|
1705
|
+ "_hash": 0.5594087842471693,
|
|
|
1706
|
+ "units": null,
|
|
|
1707
|
+ "decimals": null,
|
|
|
1708
|
+ "funcBody": null,
|
|
|
1709
|
+ "usePostProcessing": null,
|
|
|
1710
|
+ "postFuncBody": null
|
|
|
1711
|
+ },
|
|
|
1712
|
+ {
|
|
|
1713
|
+ "name": "fw_url",
|
|
|
1714
|
+ "type": "attribute",
|
|
|
1715
|
+ "label": "fw_url",
|
|
|
1716
|
+ "color": "#e91e63",
|
|
|
1717
|
+ "settings": {
|
|
|
1718
|
+ "columnWidth": "0px",
|
|
|
1719
|
+ "useCellStyleFunction": false,
|
|
|
1720
|
+ "cellStyleFunction": "",
|
|
|
1721
|
+ "useCellContentFunction": false,
|
|
|
1722
|
+ "cellContentFunction": "",
|
|
|
1723
|
+ "defaultColumnVisibility": "hidden",
|
|
|
1724
|
+ "columnSelectionToDisplay": "disabled"
|
|
|
1725
|
+ },
|
|
|
1726
|
+ "_hash": 0.4204673738685043,
|
|
|
1727
|
+ "units": null,
|
|
|
1728
|
+ "decimals": null,
|
|
|
1729
|
+ "funcBody": null,
|
|
|
1730
|
+ "usePostProcessing": null,
|
|
|
1731
|
+ "postFuncBody": null
|
|
|
1732
|
+ }
|
|
|
1733
|
+ ]
|
|
|
1734
|
+ }
|
|
|
1735
|
+ ],
|
|
|
1736
|
+ "actions": {
|
|
|
1737
|
+ "actionCellButton": [
|
|
|
1738
|
+ {
|
|
|
1739
|
+ "name": "History firmware update",
|
|
|
1740
|
+ "icon": "history",
|
|
|
1741
|
+ "type": "openDashboardState",
|
|
|
1742
|
+ "targetDashboardStateId": "device_firmware_history",
|
|
|
1743
|
+ "setEntityId": true,
|
|
|
1744
|
+ "stateEntityParamName": null,
|
|
|
1745
|
+ "openInSeparateDialog": false,
|
|
|
1746
|
+ "dialogTitle": "",
|
|
|
1747
|
+ "dialogHideDashboardToolbar": true,
|
|
|
1748
|
+ "dialogWidth": null,
|
|
|
1749
|
+ "dialogHeight": null,
|
|
|
1750
|
+ "openRightLayout": false,
|
|
|
1751
|
+ "id": "98a1406c-3301-bc2f-2c5d-d637ce3b663b"
|
|
|
1752
|
+ },
|
|
|
1753
|
+ {
|
|
|
1754
|
+ "name": "Edit firmware",
|
|
|
1755
|
+ "icon": "edit",
|
|
|
1756
|
+ "type": "customPretty",
|
|
|
1757
|
+ "customHtml": "<form #editEntityForm=\"ngForm\" [formGroup]=\"editEntityFormGroup\"\n (ngSubmit)=\"save()\" class=\"edit-entity-form\">\n <mat-toolbar fxLayout=\"row\" color=\"primary\">\n <h2>Edit firmware {{entityName}}</h2>\n <span fxFlex></span>\n <button mat-icon-button (click)=\"cancel()\" type=\"button\">\n <mat-icon class=\"material-icons\">close</mat-icon>\n </button>\n </mat-toolbar>\n <mat-progress-bar color=\"warn\" mode=\"indeterminate\" *ngIf=\"isLoading$ | async\">\n </mat-progress-bar>\n <div style=\"height: 4px;\" *ngIf=\"!(isLoading$ | async)\"></div>\n <div *ngIf=\"entity.deviceProfileId\" mat-dialog-content fxLayout=\"column\">\n <tb-ota-package-autocomplete\n [useFullEntityId]=\"true\"\n [deviceProfileId]=\"entity.deviceProfileId.id\"\n formControlName=\"firmwareId\">\n </tb-ota-package-autocomplete>\n </div>\n <div mat-dialog-actions fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button mat-button color=\"primary\"\n type=\"button\"\n [disabled]=\"(isLoading$ | async)\"\n (click)=\"cancel()\" cdkFocusInitial>\n Cancel\n </button>\n <button mat-button mat-raised-button color=\"primary\"\n type=\"submit\"\n [disabled]=\"(isLoading$ | async) || editEntityForm.invalid || !editEntityForm.dirty\">\n Save\n </button>\n </div>\n</form>",
|
|
|
1758
|
+ "customCss": "form {\n min-width: 300px !important;\n}",
|
|
|
1759
|
+ "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\n\nopenEditEntityDialog();\n\nfunction openEditEntityDialog() {\n customDialog.customDialog(htmlTemplate, EditEntityDialogController).subscribe();\n}\n\nfunction EditEntityDialogController(instance) {\n let vm = instance;\n\n vm.entityName = entityName;\n vm.entity = {};\n\n vm.editEntityFormGroup = vm.fb.group({\n firmwareId: [null]\n });\n\n getEntityInfo();\n\n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n\n vm.save = function() {\n vm.editEntityFormGroup.markAsPristine();\n saveEntity().subscribe(\n function () {\n // widgetContext.updateAliases();\n vm.dialogRef.close(null);\n }\n );\n };\n\n\n function getEntityInfo() {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n vm.entity = data;\n vm.editEntityFormGroup.patchValue({\n firmwareId: vm.entity.firmwareId\n }, {emitEvent: false});\n }\n );\n }\n\n function saveEntity() {\n const formValues = vm.editEntityFormGroup.value;\n vm.entity.firmwareId = formValues.firmwareId;\n return deviceService.saveDevice(vm.entity);\n }\n}",
|
|
|
1760
|
+ "customResources": [],
|
|
|
1761
|
+ "id": "23099c1d-454b-25dc-8bc0-7cf33c21c5d5"
|
|
|
1762
|
+ },
|
|
|
1763
|
+ {
|
|
|
1764
|
+ "name": "Download firmware",
|
|
|
1765
|
+ "icon": "file_download",
|
|
|
1766
|
+ "type": "custom",
|
|
|
1767
|
+ "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet otaPackageService = $injector.get(widgetContext.servicesMap.get('otaPackageService'));\nlet deviceProfileService = $injector.get(widgetContext.servicesMap.get('deviceProfileService'));\n\ngetDeviceFirmware();\n\nfunction getDeviceFirmware() {\n var entityIdValue = entityId.id;\n var data = widgetContext.data.find((el) => el.datasource.entityId === entityIdValue && el.dataKey.name === 'fw_url');\n var url = data.data[0][1];\n if (url === '') {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n if (data.firmwareId !== null) {\n otaPackageService.downloadOtaPackage(data.firmwareId.id).subscribe(); \n } else {\n deviceProfileService.getDeviceProfile(data.deviceProfileId.id).subscribe(\n function (deviceProfile) {\n if (deviceProfile.firmwareId !== null) {\n otaPackageService.downloadOtaPackage(deviceProfile.firmwareId.id).subscribe();\n } else {\n widgetContext.showToast('warn', 'Device ' + entityName +' has not firmware set.', 2000, 'top');\n }\n });\n }\n }\n );\n } else {\n widgetContext.showToast('warn', 'Device ' + entityName +' has not firmware set.', 2000, 'top');\n }\n}",
|
|
|
1768
|
+ "id": "12533058-42f6-e75f-620c-219c48d01ec0"
|
|
|
1769
|
+ },
|
|
|
1770
|
+ {
|
|
|
1771
|
+ "name": "Copy checksum/URL",
|
|
|
1772
|
+ "icon": "content_copy",
|
|
|
1773
|
+ "type": "custom",
|
|
|
1774
|
+ "customFunction": "function copyToClipboard(text) {\n if (window.clipboardData && window.clipboardData.setData) {\n return window.clipboardData.setData(\"Text\", text);\n\n }\n else if (document.queryCommandSupported && document.queryCommandSupported(\"copy\")) {\n var textarea = document.createElement(\"textarea\");\n textarea.textContent = text;\n textarea.style.position = \"fixed\";\n document.body.appendChild(textarea);\n textarea.select();\n try {\n return document.execCommand(\"copy\");\n }\n catch (ex) {\n console.warn(\"Copy to clipboard failed.\", ex);\n return false;\n }\n document.body.removeChild(textarea);\n }\n}\nvar entityIdValue = entityId.id;\nvar data = widgetContext.data.find((el) => el.datasource.entityId === entityIdValue && el.dataKey.name === 'fw_checksum');\nvar checksum = data.data[0][1];\nif (checksum !== '') {\n copyToClipboard(checksum);\n widgetContext.showSuccessToast('Firmware checksum has been copied to clipboard', 2000, 'top');\n} else {\n data = widgetContext.data.find((el) => el.datasource.entityId === entityIdValue && el.dataKey.name === 'fw_url');\n var url = data.data[0][1];\n if (url !== '') {\n copyToClipboard(url);\n widgetContext.showSuccessToast('Firmware direct URL has been copied to clipboard', 2000, 'top');\n } else {\n widgetContext.showToast('warn', 'Device ' + entityName +' has not firmware set.', 2000, 'top');\n }\n}",
|
|
|
1775
|
+ "id": "09323079-7111-87f7-90d1-c62cd7d85dc7"
|
|
|
1776
|
+ }
|
|
|
1777
|
+ ]
|
|
|
1778
|
+ },
|
|
|
1779
|
+ "showTitleIcon": false,
|
|
|
1780
|
+ "iconColor": "rgba(0, 0, 0, 0.87)",
|
|
|
1781
|
+ "iconSize": "24px",
|
|
|
1782
|
+ "titleTooltip": "",
|
|
|
1783
|
+ "widgetStyle": {}
|
|
|
1784
|
+ },
|
|
|
1785
|
+ "row": 0,
|
|
|
1786
|
+ "col": 0,
|
|
|
1787
|
+ "id": "3624013b-378c-f110-5eba-ae95c25a4dcc",
|
|
|
1788
|
+ "typeFullFqn": "system.cards.entities_table"
|
|
|
1789
|
+ },
|
|
|
1790
|
+ "d2d13e0d-4e71-889f-9343-ad2f0af9f176": {
|
|
|
1791
|
+ "type": "latest",
|
|
|
1792
|
+ "sizeX": 7.5,
|
|
|
1793
|
+ "sizeY": 6.5,
|
|
|
1794
|
+ "config": {
|
|
|
1795
|
+ "timewindow": {
|
|
|
1796
|
+ "displayValue": "",
|
|
|
1797
|
+ "selectedTab": 0,
|
|
|
1798
|
+ "realtime": {
|
|
|
1799
|
+ "realtimeType": 1,
|
|
|
1800
|
+ "interval": 1000,
|
|
|
1801
|
+ "timewindowMs": 86400000,
|
|
|
1802
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
1803
|
+ },
|
|
|
1804
|
+ "history": {
|
|
|
1805
|
+ "historyType": 0,
|
|
|
1806
|
+ "interval": 1000,
|
|
|
1807
|
+ "timewindowMs": 60000,
|
|
|
1808
|
+ "fixedTimewindow": {
|
|
|
1809
|
+ "startTimeMs": 1694085363133,
|
|
|
1810
|
+ "endTimeMs": 1694171763133
|
|
|
1811
|
+ },
|
|
|
1812
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
1813
|
+ },
|
|
|
1814
|
+ "aggregation": {
|
|
|
1815
|
+ "type": "NONE",
|
|
|
1816
|
+ "limit": 200
|
|
|
1817
|
+ }
|
|
|
1818
|
+ },
|
|
|
1819
|
+ "showTitle": true,
|
|
|
1820
|
+ "backgroundColor": "rgb(255, 255, 255)",
|
|
|
1821
|
+ "color": "rgba(0, 0, 0, 0.87)",
|
|
|
1822
|
+ "padding": "4px",
|
|
|
1823
|
+ "settings": {
|
|
|
1824
|
+ "enableSearch": true,
|
|
|
1825
|
+ "displayPagination": true,
|
|
|
1826
|
+ "defaultPageSize": 10,
|
|
|
1827
|
+ "defaultSortOrder": "entityName",
|
|
|
1828
|
+ "displayEntityName": true,
|
|
|
1829
|
+ "displayEntityType": false,
|
|
|
1830
|
+ "enableSelectColumnDisplay": false,
|
|
|
1831
|
+ "enableStickyHeader": true,
|
|
|
1832
|
+ "enableStickyAction": true,
|
|
|
1833
|
+ "entitiesTitle": "Devices",
|
|
|
1834
|
+ "displayEntityLabel": false,
|
|
|
1835
|
+ "entityNameColumnTitle": "Device"
|
|
|
1836
|
+ },
|
|
|
1837
|
+ "title": "New Entities table",
|
|
|
1838
|
+ "dropShadow": true,
|
|
|
1839
|
+ "enableFullscreen": true,
|
|
|
1840
|
+ "titleStyle": {
|
|
|
1841
|
+ "fontSize": "16px",
|
|
|
1842
|
+ "fontWeight": 400,
|
|
|
1843
|
+ "padding": "5px 10px 5px 10px"
|
|
|
1844
|
+ },
|
|
|
1845
|
+ "useDashboardTimewindow": false,
|
|
|
1846
|
+ "showLegend": false,
|
|
|
1847
|
+ "datasources": [
|
|
|
1848
|
+ {
|
|
|
1849
|
+ "type": "entity",
|
|
|
1850
|
+ "name": null,
|
|
|
1851
|
+ "entityAliasId": "639da5b4-31f0-0151-6282-c37a3897b7e8",
|
|
|
1852
|
+ "filterId": "6044e198-df64-cd76-f339-696f220c4943",
|
|
|
1853
|
+ "dataKeys": [
|
|
|
1854
|
+ {
|
|
|
1855
|
+ "name": "current_fw_title",
|
|
|
1856
|
+ "type": "timeseries",
|
|
|
1857
|
+ "label": "Current FW title",
|
|
|
1858
|
+ "color": "#2196f3",
|
|
|
1859
|
+ "settings": {
|
|
|
1860
|
+ "columnWidth": "0px",
|
|
|
1861
|
+ "useCellStyleFunction": false,
|
|
|
1862
|
+ "cellStyleFunction": "",
|
|
|
1863
|
+ "useCellContentFunction": false,
|
|
|
1864
|
+ "defaultColumnVisibility": "visible",
|
|
|
1865
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
1866
|
+ },
|
|
|
1867
|
+ "_hash": 0.09545533885166413,
|
|
|
1868
|
+ "units": null,
|
|
|
1869
|
+ "decimals": null,
|
|
|
1870
|
+ "funcBody": null,
|
|
|
1871
|
+ "usePostProcessing": null,
|
|
|
1872
|
+ "postFuncBody": null
|
|
|
1873
|
+ },
|
|
|
1874
|
+ {
|
|
|
1875
|
+ "name": "current_fw_version",
|
|
|
1876
|
+ "type": "timeseries",
|
|
|
1877
|
+ "label": "Current FW version",
|
|
|
1878
|
+ "color": "#4caf50",
|
|
|
1879
|
+ "settings": {
|
|
|
1880
|
+ "columnWidth": "0px",
|
|
|
1881
|
+ "useCellStyleFunction": false,
|
|
|
1882
|
+ "cellStyleFunction": "",
|
|
|
1883
|
+ "useCellContentFunction": false,
|
|
|
1884
|
+ "defaultColumnVisibility": "visible",
|
|
|
1885
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
1886
|
+ },
|
|
|
1887
|
+ "_hash": 0.7206056602328659,
|
|
|
1888
|
+ "units": null,
|
|
|
1889
|
+ "decimals": null,
|
|
|
1890
|
+ "funcBody": null,
|
|
|
1891
|
+ "usePostProcessing": null,
|
|
|
1892
|
+ "postFuncBody": null
|
|
|
1893
|
+ },
|
|
|
1894
|
+ {
|
|
|
1895
|
+ "name": "target_fw_title",
|
|
|
1896
|
+ "type": "timeseries",
|
|
|
1897
|
+ "label": "Target FW title",
|
|
|
1898
|
+ "color": "#ffc107",
|
|
|
1899
|
+ "settings": {
|
|
|
1900
|
+ "columnWidth": "0px",
|
|
|
1901
|
+ "useCellStyleFunction": false,
|
|
|
1902
|
+ "cellStyleFunction": "",
|
|
|
1903
|
+ "useCellContentFunction": false,
|
|
|
1904
|
+ "defaultColumnVisibility": "visible",
|
|
|
1905
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
1906
|
+ },
|
|
|
1907
|
+ "_hash": 0.9934225682766313,
|
|
|
1908
|
+ "units": null,
|
|
|
1909
|
+ "decimals": null,
|
|
|
1910
|
+ "funcBody": null,
|
|
|
1911
|
+ "usePostProcessing": null,
|
|
|
1912
|
+ "postFuncBody": null
|
|
|
1913
|
+ },
|
|
|
1914
|
+ {
|
|
|
1915
|
+ "name": "target_fw_version",
|
|
|
1916
|
+ "type": "timeseries",
|
|
|
1917
|
+ "label": "Target FW version",
|
|
|
1918
|
+ "color": "#607d8b",
|
|
|
1919
|
+ "settings": {
|
|
|
1920
|
+ "columnWidth": "0px",
|
|
|
1921
|
+ "useCellStyleFunction": false,
|
|
|
1922
|
+ "cellStyleFunction": "",
|
|
|
1923
|
+ "useCellContentFunction": false,
|
|
|
1924
|
+ "cellContentFunction": "",
|
|
|
1925
|
+ "defaultColumnVisibility": "visible",
|
|
|
1926
|
+ "columnSelectionToDisplay": "enabled"
|
|
|
1927
|
+ },
|
|
|
1928
|
+ "_hash": 0.5251724416842531,
|
|
|
1929
|
+ "units": null,
|
|
|
1930
|
+ "decimals": null,
|
|
|
1931
|
+ "funcBody": null,
|
|
|
1932
|
+ "usePostProcessing": null,
|
|
|
1933
|
+ "postFuncBody": null
|
|
|
1934
|
+ },
|
|
|
1935
|
+ {
|
|
|
1936
|
+ "name": "target_fw_ts",
|
|
|
1937
|
+ "type": "timeseries",
|
|
|
1938
|
+ "label": "Target FW set time",
|
|
|
1939
|
+ "color": "#e91e63",
|
|
|
1940
|
+ "settings": {
|
|
|
1941
|
+ "columnWidth": "0px",
|
|
|
1942
|
+ "useCellStyleFunction": false,
|
|
|
1943
|
+ "cellStyleFunction": "",
|
|
|
1944
|
+ "useCellContentFunction": true,
|
|
|
1945
|
+ "defaultColumnVisibility": "visible",
|
|
|
1946
|
+ "columnSelectionToDisplay": "enabled",
|
|
|
1947
|
+ "cellContentFunction": "if (value !== '') {\n return ctx.date.transform(value, 'yyyy-MM-dd HH:mm:ss');\n}\nreturn '';"
|
|
|
1948
|
+ },
|
|
|
1949
|
+ "_hash": 0.31823244858578237,
|
|
|
1950
|
+ "units": null,
|
|
|
1951
|
+ "decimals": null,
|
|
|
1952
|
+ "funcBody": null,
|
|
|
1953
|
+ "usePostProcessing": null,
|
|
|
1954
|
+ "postFuncBody": null
|
|
|
1955
|
+ },
|
|
|
1956
|
+ {
|
|
|
1957
|
+ "name": "fw_state",
|
|
|
1958
|
+ "type": "timeseries",
|
|
|
1959
|
+ "label": "Progress",
|
|
|
1960
|
+ "color": "#9c27b0",
|
|
|
1961
|
+ "settings": {
|
|
|
1962
|
+ "columnWidth": "30%",
|
|
|
1963
|
+ "useCellStyleFunction": true,
|
|
|
1964
|
+ "useCellContentFunction": true,
|
|
|
1965
|
+ "defaultColumnVisibility": "visible",
|
|
|
1966
|
+ "columnSelectionToDisplay": "enabled",
|
|
|
1967
|
+ "cellStyleFunction": "return {\n 'padding-right': '30px'\n}",
|
|
|
1968
|
+ "cellContentFunction": "if (value !== '') {\n var mapProgress = {\n 'QUEUED': 0,\n 'INITIATED': 5,\n 'DOWNLOADING': 10,\n 'DOWNLOADED': 55,\n 'VERIFIED': 60,\n 'UPDATING': 70,\n 'FAILED': 99,\n 'UPDATED': 100\n }\n var color = 'mat-primary';\n var progress = mapProgress[value];\n if (value == 'FAILED') {\n color = 'mat-accent';\n }\n return `<mat-progress-bar style=\"height: 8px\" role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\" tabindex=\"-1\" mode=\"determinate\" value=\"${progress}\" class=\"mat-progress-bar ${color}\" aria-valuenow=\"${progress}\"><div aria-hidden=\"true\"><svg width=\"100%\" height=\"8\" focusable=\"false\" class=\"mat-progress-bar-background mat-progress-bar-element\"><defs><pattern x=\"4\" y=\"0\" width=\"8\" height=\"4\" patternUnits=\"userSpaceOnUse\" id=\"mat-progress-bar-0\"><circle cx=\"2\" cy=\"2\" r=\"2\"></circle></pattern></defs><rect width=\"100%\" height=\"100%\" fill=\"url(\"/components/progress-bar/overview#mat-progress-bar-0\")\"></rect></svg><div class=\"mat-progress-bar-buffer mat-progress-bar-element\"></div><div class=\"mat-progress-bar-primary mat-progress-bar-fill mat-progress-bar-element\" style=\"transform: scale3d(${progress / 100}, 1, 1);\"></div><div class=\"mat-progress-bar-secondary mat-progress-bar-fill mat-progress-bar-element\"></div></div></mat-progress-bar>`;\n}"
|
|
|
1969
|
+ },
|
|
|
1970
|
+ "_hash": 0.8174211757846257,
|
|
|
1971
|
+ "units": null,
|
|
|
1972
|
+ "decimals": null,
|
|
|
1973
|
+ "funcBody": null,
|
|
|
1974
|
+ "usePostProcessing": null,
|
|
|
1975
|
+ "postFuncBody": null
|
|
|
1976
|
+ },
|
|
|
1977
|
+ {
|
|
|
1978
|
+ "name": "fw_state",
|
|
|
1979
|
+ "type": "timeseries",
|
|
|
1980
|
+ "label": "Status",
|
|
|
1981
|
+ "color": "#f44336",
|
|
|
1982
|
+ "settings": {
|
|
|
1983
|
+ "columnWidth": "130px",
|
|
|
1984
|
+ "useCellStyleFunction": true,
|
|
|
1985
|
+ "useCellContentFunction": true,
|
|
|
1986
|
+ "defaultColumnVisibility": "visible",
|
|
|
1987
|
+ "columnSelectionToDisplay": "enabled",
|
|
|
1988
|
+ "cellStyleFunction": "if (value == 'FAILED') {\n return {'color' : '#D93025'};\n}\nreturn {};",
|
|
|
1989
|
+ "cellContentFunction": "function icon(value) {\n if (value == 'QUEUED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000;\"><svg style=\"width:24px;height:24px\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M6,2V8H6V8L10,12L6,16V16H6V22H18V16H18V16L14,12L18,8V8H18V2H6M16,16.5V20H8V16.5L12,12.5L16,16.5M12,11.5L8,7.5V4H16V7.5L12,11.5Z\" /></svg></mat-icon>';\n }\n if (value == 'INITIATED' || value == 'DOWNLOADING' || value == 'DOWNLOADED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000\"><svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.74 2.1951C11.63 1.2876 10.2575 0.687598 8.75 0.537598V2.0526C9.845 2.1876 10.8425 2.6226 11.675 3.2676L12.74 2.1951ZM13.9475 7.2501H15.4625C15.3125 5.7426 14.7125 4.3701 13.805 3.2601L12.7325 4.3251C13.3775 5.1576 13.8125 6.1551 13.9475 7.2501ZM12.7325 11.6751L13.805 12.7476C14.7125 11.6376 15.3125 10.2576 15.4625 8.7576H13.9475C13.8125 9.8451 13.3775 10.8426 12.7325 11.6751ZM8.75 13.9476V15.4626C10.2575 15.3126 11.63 14.7126 12.74 13.8051L11.6675 12.7326C10.8425 13.3776 9.845 13.8126 8.75 13.9476ZM8.75 8.0001V4.2501H7.25V8.0001H4.25L8 11.7501L11.75 8.0001H8.75ZM7.25 13.9476V15.4626C3.4625 15.0876 0.5 11.8926 0.5 8.0001C0.5 4.1076 3.4625 0.912598 7.25 0.537598V2.0526C4.2875 2.4201 2 4.9401 2 8.0001C2 11.0601 4.2875 13.5801 7.25 13.9476Z\" fill=\"black\"/></svg></mat-icon>';\n }\n if (value == 'VERIFIED' || value == 'UPDATING' ) {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000\">update</mat-icon>';\n }\n if (value == 'UPDATED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #000\"><svg style=\"width:22px;height:22px\" viewBox=\"0 0 34 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M33.26 2.82L30.44 0L12.06 18.38L3.55999 9.9L0.73999 12.72L12.06 24.04L33.26 2.82Z\" fill=\"black\"/><path d=\"M31 28H3V32H31V28Z\" fill=\"black\"/></svg></mat-icon>';\n }\n if (value == 'FAILED') {\n return '<mat-icon _role=\"img\" class=\"mat-icon notranslate material-icons mat-icon-no-color\" aria-hidden=\"true\" data-mat-icon-type=\"font\" style=\"color: #D93025\">warning</mat-icon>';\n }\n return '';\n}\nfunction capitalize (s) {\n if (typeof s !== 'string') return '';\n return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nreturn icon(value) + '<span style=\"vertical-align: super;padding-left: 8px;\">' + capitalize(value) + '</span>';"
|
|
|
1990
|
+ },
|
|
|
1991
|
+ "_hash": 0.7764426948615217,
|
|
|
1992
|
+ "units": null,
|
|
|
1993
|
+ "decimals": null,
|
|
|
1994
|
+ "funcBody": null,
|
|
|
1995
|
+ "usePostProcessing": null,
|
|
|
1996
|
+ "postFuncBody": null
|
|
|
1997
|
+ },
|
|
|
1998
|
+ {
|
|
|
1999
|
+ "name": "fw_checksum",
|
|
|
2000
|
+ "type": "attribute",
|
|
|
2001
|
+ "label": "fw_checksum",
|
|
|
2002
|
+ "color": "#3f51b5",
|
|
|
2003
|
+ "settings": {
|
|
|
2004
|
+ "columnWidth": "0px",
|
|
|
2005
|
+ "useCellStyleFunction": false,
|
|
|
2006
|
+ "cellStyleFunction": "",
|
|
|
2007
|
+ "useCellContentFunction": false,
|
|
|
2008
|
+ "defaultColumnVisibility": "hidden",
|
|
|
2009
|
+ "columnSelectionToDisplay": "disabled"
|
|
|
2010
|
+ },
|
|
|
2011
|
+ "_hash": 0.5594087842471693,
|
|
|
2012
|
+ "units": null,
|
|
|
2013
|
+ "decimals": null,
|
|
|
2014
|
+ "funcBody": null,
|
|
|
2015
|
+ "usePostProcessing": null,
|
|
|
2016
|
+ "postFuncBody": null
|
|
|
2017
|
+ },
|
|
|
2018
|
+ {
|
|
|
2019
|
+ "name": "fw_url",
|
|
|
2020
|
+ "type": "attribute",
|
|
|
2021
|
+ "label": "fw_url",
|
|
|
2022
|
+ "color": "#e91e63",
|
|
|
2023
|
+ "settings": {
|
|
|
2024
|
+ "columnWidth": "0px",
|
|
|
2025
|
+ "useCellStyleFunction": false,
|
|
|
2026
|
+ "cellStyleFunction": "",
|
|
|
2027
|
+ "useCellContentFunction": false,
|
|
|
2028
|
+ "cellContentFunction": "",
|
|
|
2029
|
+ "defaultColumnVisibility": "hidden",
|
|
|
2030
|
+ "columnSelectionToDisplay": "disabled"
|
|
|
2031
|
+ },
|
|
|
2032
|
+ "_hash": 0.4204673738685043,
|
|
|
2033
|
+ "units": null,
|
|
|
2034
|
+ "decimals": null,
|
|
|
2035
|
+ "funcBody": null,
|
|
|
2036
|
+ "usePostProcessing": null,
|
|
|
2037
|
+ "postFuncBody": null
|
|
|
2038
|
+ }
|
|
|
2039
|
+ ]
|
|
|
2040
|
+ }
|
|
|
2041
|
+ ],
|
|
|
2042
|
+ "actions": {
|
|
|
2043
|
+ "actionCellButton": [
|
|
|
2044
|
+ {
|
|
|
2045
|
+ "name": "History firmware update",
|
|
|
2046
|
+ "icon": "history",
|
|
|
2047
|
+ "type": "openDashboardState",
|
|
|
2048
|
+ "targetDashboardStateId": "device_firmware_history",
|
|
|
2049
|
+ "setEntityId": true,
|
|
|
2050
|
+ "stateEntityParamName": null,
|
|
|
2051
|
+ "openInSeparateDialog": false,
|
|
|
2052
|
+ "dialogTitle": "",
|
|
|
2053
|
+ "dialogHideDashboardToolbar": true,
|
|
|
2054
|
+ "dialogWidth": null,
|
|
|
2055
|
+ "dialogHeight": null,
|
|
|
2056
|
+ "openRightLayout": false,
|
|
|
2057
|
+ "id": "98a1406c-3301-bc2f-2c5d-d637ce3b663b"
|
|
|
2058
|
+ },
|
|
|
2059
|
+ {
|
|
|
2060
|
+ "name": "Edit firmware",
|
|
|
2061
|
+ "icon": "edit",
|
|
|
2062
|
+ "type": "customPretty",
|
|
|
2063
|
+ "customHtml": "<form #editEntityForm=\"ngForm\" [formGroup]=\"editEntityFormGroup\"\n (ngSubmit)=\"save()\" class=\"edit-entity-form\">\n <mat-toolbar fxLayout=\"row\" color=\"primary\">\n <h2>Edit firmware {{entityName}}</h2>\n <span fxFlex></span>\n <button mat-icon-button (click)=\"cancel()\" type=\"button\">\n <mat-icon class=\"material-icons\">close</mat-icon>\n </button>\n </mat-toolbar>\n <mat-progress-bar color=\"warn\" mode=\"indeterminate\" *ngIf=\"isLoading$ | async\">\n </mat-progress-bar>\n <div style=\"height: 4px;\" *ngIf=\"!(isLoading$ | async)\"></div>\n <div *ngIf=\"entity.deviceProfileId\" mat-dialog-content fxLayout=\"column\">\n <tb-ota-package-autocomplete\n [useFullEntityId]=\"true\"\n [deviceProfileId]=\"entity.deviceProfileId.id\"\n formControlName=\"firmwareId\">\n </tb-ota-package-autocomplete>\n </div>\n <div mat-dialog-actions fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button mat-button color=\"primary\"\n type=\"button\"\n [disabled]=\"(isLoading$ | async)\"\n (click)=\"cancel()\" cdkFocusInitial>\n Cancel\n </button>\n <button mat-button mat-raised-button color=\"primary\"\n type=\"submit\"\n [disabled]=\"(isLoading$ | async) || editEntityForm.invalid || !editEntityForm.dirty\">\n Save\n </button>\n </div>\n</form>",
|
|
|
2064
|
+ "customCss": "form {\n min-width: 300px !important;\n}",
|
|
|
2065
|
+ "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\n\nopenEditEntityDialog();\n\nfunction openEditEntityDialog() {\n customDialog.customDialog(htmlTemplate, EditEntityDialogController).subscribe();\n}\n\nfunction EditEntityDialogController(instance) {\n let vm = instance;\n\n vm.entityName = entityName;\n vm.entity = {};\n\n vm.editEntityFormGroup = vm.fb.group({\n firmwareId: [null]\n });\n\n getEntityInfo();\n\n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n\n vm.save = function() {\n vm.editEntityFormGroup.markAsPristine();\n saveEntity().subscribe(\n function () {\n // widgetContext.updateAliases();\n vm.dialogRef.close(null);\n }\n );\n };\n\n\n function getEntityInfo() {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n vm.entity = data;\n vm.editEntityFormGroup.patchValue({\n firmwareId: vm.entity.firmwareId\n }, {emitEvent: false});\n }\n );\n }\n\n function saveEntity() {\n const formValues = vm.editEntityFormGroup.value;\n vm.entity.firmwareId = formValues.firmwareId;\n return deviceService.saveDevice(vm.entity);\n }\n}",
|
|
|
2066
|
+ "customResources": [],
|
|
|
2067
|
+ "id": "23099c1d-454b-25dc-8bc0-7cf33c21c5d5"
|
|
|
2068
|
+ },
|
|
|
2069
|
+ {
|
|
|
2070
|
+ "name": "Download firmware",
|
|
|
2071
|
+ "icon": "file_download",
|
|
|
2072
|
+ "type": "custom",
|
|
|
2073
|
+ "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet otaPackageService = $injector.get(widgetContext.servicesMap.get('otaPackageService'));\nlet deviceProfileService = $injector.get(widgetContext.servicesMap.get('deviceProfileService'));\n\ngetDeviceFirmware();\n\nfunction getDeviceFirmware() {\n var entityIdValue = entityId.id;\n var data = widgetContext.data.find((el) => el.datasource.entityId === entityIdValue && el.dataKey.name === 'fw_url');\n var url = data.data[0][1];\n if (url === '') {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n if (data.firmwareId !== null) {\n otaPackageService.downloadOtaPackage(data.firmwareId.id).subscribe(); \n } else {\n deviceProfileService.getDeviceProfile(data.deviceProfileId.id).subscribe(\n function (deviceProfile) {\n if (deviceProfile.firmwareId !== null) {\n otaPackageService.downloadOtaPackage(deviceProfile.firmwareId.id).subscribe();\n } else {\n widgetContext.showToast('warn', 'Device ' + entityName +' has not firmware set.', 2000, 'top');\n }\n });\n }\n }\n );\n } else {\n widgetContext.showToast('warn', 'Device ' + entityName +' has not firmware set.', 2000, 'top');\n }\n}",
|
|
|
2074
|
+ "id": "12533058-42f6-e75f-620c-219c48d01ec0"
|
|
|
2075
|
+ },
|
|
|
2076
|
+ {
|
|
|
2077
|
+ "name": "Copy checksum/URL",
|
|
|
2078
|
+ "icon": "content_copy",
|
|
|
2079
|
+ "type": "custom",
|
|
|
2080
|
+ "customFunction": "function copyToClipboard(text) {\n if (window.clipboardData && window.clipboardData.setData) {\n return window.clipboardData.setData(\"Text\", text);\n\n }\n else if (document.queryCommandSupported && document.queryCommandSupported(\"copy\")) {\n var textarea = document.createElement(\"textarea\");\n textarea.textContent = text;\n textarea.style.position = \"fixed\";\n document.body.appendChild(textarea);\n textarea.select();\n try {\n return document.execCommand(\"copy\");\n }\n catch (ex) {\n console.warn(\"Copy to clipboard failed.\", ex);\n return false;\n }\n document.body.removeChild(textarea);\n }\n}\nvar entityIdValue = entityId.id;\nvar data = widgetContext.data.find((el) => el.datasource.entityId === entityIdValue && el.dataKey.name === 'fw_checksum');\nvar checksum = data.data[0][1];\nif (checksum !== '') {\n copyToClipboard(checksum);\n widgetContext.showSuccessToast('Firmware checksum has been copied to clipboard', 2000, 'top');\n} else {\n data = widgetContext.data.find((el) => el.datasource.entityId === entityIdValue && el.dataKey.name === 'fw_url');\n var url = data.data[0][1];\n if (url !== '') {\n copyToClipboard(url);\n widgetContext.showSuccessToast('Firmware direct URL has been copied to clipboard', 2000, 'top');\n } else {\n widgetContext.showToast('warn', 'Device ' + entityName +' has not firmware set.', 2000, 'top');\n }\n}",
|
|
|
2081
|
+ "id": "09323079-7111-87f7-90d1-c62cd7d85dc7"
|
|
|
2082
|
+ }
|
|
|
2083
|
+ ]
|
|
|
2084
|
+ },
|
|
|
2085
|
+ "showTitleIcon": false,
|
|
|
2086
|
+ "iconColor": "rgba(0, 0, 0, 0.87)",
|
|
|
2087
|
+ "iconSize": "24px",
|
|
|
2088
|
+ "titleTooltip": "",
|
|
|
2089
|
+ "widgetStyle": {}
|
|
|
2090
|
+ },
|
|
|
2091
|
+ "row": 0,
|
|
|
2092
|
+ "col": 0,
|
|
|
2093
|
+ "id": "d2d13e0d-4e71-889f-9343-ad2f0af9f176",
|
|
|
2094
|
+ "typeFullFqn": "system.cards.entities_table"
|
|
|
2095
|
+ }
|
|
|
2096
|
+ },
|
|
|
2097
|
+ "states": {
|
|
|
2098
|
+ "default": {
|
|
|
2099
|
+ "name": "Device list",
|
|
|
2100
|
+ "root": true,
|
|
|
2101
|
+ "layouts": {
|
|
|
2102
|
+ "main": {
|
|
|
2103
|
+ "widgets": {
|
|
|
2104
|
+ "cd03188e-cd9d-9601-fd57-da4cb95fc016": {
|
|
|
2105
|
+ "sizeX": 19,
|
|
|
2106
|
+ "sizeY": 12,
|
|
|
2107
|
+ "row": 0,
|
|
|
2108
|
+ "col": 0
|
|
|
2109
|
+ },
|
|
|
2110
|
+ "17543c57-af4a-2c1e-bf12-53a7b46791e6": {
|
|
|
2111
|
+ "sizeX": 5,
|
|
|
2112
|
+ "sizeY": 3,
|
|
|
2113
|
+ "row": 0,
|
|
|
2114
|
+ "col": 19
|
|
|
2115
|
+ },
|
|
|
2116
|
+ "6c1c4e1a-bce0-f5ad-ff8b-ba1dfc5a4ec6": {
|
|
|
2117
|
+ "sizeX": 5,
|
|
|
2118
|
+ "sizeY": 3,
|
|
|
2119
|
+ "row": 3,
|
|
|
2120
|
+ "col": 19
|
|
|
2121
|
+ },
|
|
|
2122
|
+ "e6674227-9cf3-a2f6-ecac-5ccfc38a3c81": {
|
|
|
2123
|
+ "sizeX": 5,
|
|
|
2124
|
+ "sizeY": 3,
|
|
|
2125
|
+ "row": 9,
|
|
|
2126
|
+ "col": 19
|
|
|
2127
|
+ },
|
|
|
2128
|
+ "77b10144-b904-edd5-8c7c-8fb75616c6d8": {
|
|
|
2129
|
+ "sizeX": 5,
|
|
|
2130
|
+ "sizeY": 3,
|
|
|
2131
|
+ "row": 6,
|
|
|
2132
|
+ "col": 19
|
|
|
2133
|
+ }
|
|
|
2134
|
+ },
|
|
|
2135
|
+ "gridSettings": {
|
|
|
2136
|
+ "backgroundColor": "#eeeeee",
|
|
|
2137
|
+ "color": "rgba(0,0,0,0.870588)",
|
|
|
2138
|
+ "columns": 24,
|
|
|
2139
|
+ "margin": 12,
|
|
|
2140
|
+ "backgroundSizeMode": "100%",
|
|
|
2141
|
+ "autoFillHeight": true,
|
|
|
2142
|
+ "backgroundImageUrl": null,
|
|
|
2143
|
+ "mobileAutoFillHeight": true,
|
|
|
2144
|
+ "mobileRowHeight": 70,
|
|
|
2145
|
+ "outerMargin": true
|
|
|
2146
|
+ }
|
|
|
2147
|
+ }
|
|
|
2148
|
+ }
|
|
|
2149
|
+ },
|
|
|
2150
|
+ "device_firmware_history": {
|
|
|
2151
|
+ "name": "Firmware history: ${entityName}",
|
|
|
2152
|
+ "root": false,
|
|
|
2153
|
+ "layouts": {
|
|
|
2154
|
+ "main": {
|
|
|
2155
|
+ "widgets": {
|
|
|
2156
|
+ "100b756c-0082-6505-3ae1-3603e6deea48": {
|
|
|
2157
|
+ "sizeX": 24,
|
|
|
2158
|
+ "sizeY": 12,
|
|
|
2159
|
+ "row": 0,
|
|
|
2160
|
+ "col": 0
|
|
|
2161
|
+ }
|
|
|
2162
|
+ },
|
|
|
2163
|
+ "gridSettings": {
|
|
|
2164
|
+ "backgroundColor": "#eeeeee",
|
|
|
2165
|
+ "color": "rgba(0,0,0,0.870588)",
|
|
|
2166
|
+ "columns": 24,
|
|
|
2167
|
+ "margin": 10,
|
|
|
2168
|
+ "backgroundSizeMode": "100%",
|
|
|
2169
|
+ "autoFillHeight": true,
|
|
|
2170
|
+ "backgroundImageUrl": null,
|
|
|
2171
|
+ "mobileAutoFillHeight": false,
|
|
|
2172
|
+ "mobileRowHeight": 70,
|
|
|
2173
|
+ "outerMargin": true
|
|
|
2174
|
+ }
|
|
|
2175
|
+ }
|
|
|
2176
|
+ }
|
|
|
2177
|
+ },
|
|
|
2178
|
+ "device_waiting": {
|
|
|
2179
|
+ "name": "Device waiting",
|
|
|
2180
|
+ "root": false,
|
|
|
2181
|
+ "layouts": {
|
|
|
2182
|
+ "main": {
|
|
|
2183
|
+ "widgets": {
|
|
|
2184
|
+ "21be08bb-ec90-f760-ad6f-e7678f12c401": {
|
|
|
2185
|
+ "sizeX": 24,
|
|
|
2186
|
+ "sizeY": 12,
|
|
|
2187
|
+ "row": 0,
|
|
|
2188
|
+ "col": 0
|
|
|
2189
|
+ }
|
|
|
2190
|
+ },
|
|
|
2191
|
+ "gridSettings": {
|
|
|
2192
|
+ "backgroundColor": "#eeeeee",
|
|
|
2193
|
+ "color": "rgba(0,0,0,0.870588)",
|
|
|
2194
|
+ "columns": 24,
|
|
|
2195
|
+ "margin": 10,
|
|
|
2196
|
+ "backgroundSizeMode": "100%",
|
|
|
2197
|
+ "autoFillHeight": true,
|
|
|
2198
|
+ "backgroundImageUrl": null,
|
|
|
2199
|
+ "mobileAutoFillHeight": false,
|
|
|
2200
|
+ "mobileRowHeight": 70,
|
|
|
2201
|
+ "outerMargin": true
|
|
|
2202
|
+ }
|
|
|
2203
|
+ }
|
|
|
2204
|
+ }
|
|
|
2205
|
+ },
|
|
|
2206
|
+ "device_updating": {
|
|
|
2207
|
+ "name": "Device updating",
|
|
|
2208
|
+ "root": false,
|
|
|
2209
|
+ "layouts": {
|
|
|
2210
|
+ "main": {
|
|
|
2211
|
+ "widgets": {
|
|
|
2212
|
+ "e8280043-d3dc-7acb-c2ff-a4522972ff91": {
|
|
|
2213
|
+ "sizeX": 24,
|
|
|
2214
|
+ "sizeY": 12,
|
|
|
2215
|
+ "row": 0,
|
|
|
2216
|
+ "col": 0
|
|
|
2217
|
+ }
|
|
|
2218
|
+ },
|
|
|
2219
|
+ "gridSettings": {
|
|
|
2220
|
+ "backgroundColor": "#eeeeee",
|
|
|
2221
|
+ "color": "rgba(0,0,0,0.870588)",
|
|
|
2222
|
+ "columns": 24,
|
|
|
2223
|
+ "margin": 10,
|
|
|
2224
|
+ "backgroundSizeMode": "100%",
|
|
|
2225
|
+ "autoFillHeight": true,
|
|
|
2226
|
+ "backgroundImageUrl": null,
|
|
|
2227
|
+ "mobileAutoFillHeight": false,
|
|
|
2228
|
+ "mobileRowHeight": 70,
|
|
|
2229
|
+ "outerMargin": true
|
|
|
2230
|
+ }
|
|
|
2231
|
+ }
|
|
|
2232
|
+ }
|
|
|
2233
|
+ },
|
|
|
2234
|
+ "device_updated": {
|
|
|
2235
|
+ "name": "Device updated",
|
|
|
2236
|
+ "root": false,
|
|
|
2237
|
+ "layouts": {
|
|
|
2238
|
+ "main": {
|
|
|
2239
|
+ "widgets": {
|
|
|
2240
|
+ "d2d13e0d-4e71-889f-9343-ad2f0af9f176": {
|
|
|
2241
|
+ "sizeX": 27,
|
|
|
2242
|
+ "sizeY": 12,
|
|
|
2243
|
+ "row": 0,
|
|
|
2244
|
+ "col": 0
|
|
|
2245
|
+ }
|
|
|
2246
|
+ },
|
|
|
2247
|
+ "gridSettings": {
|
|
|
2248
|
+ "backgroundColor": "#eeeeee",
|
|
|
2249
|
+ "color": "rgba(0,0,0,0.870588)",
|
|
|
2250
|
+ "columns": 24,
|
|
|
2251
|
+ "margin": 10,
|
|
|
2252
|
+ "backgroundSizeMode": "100%",
|
|
|
2253
|
+ "autoFillHeight": true,
|
|
|
2254
|
+ "backgroundImageUrl": null,
|
|
|
2255
|
+ "mobileAutoFillHeight": false,
|
|
|
2256
|
+ "mobileRowHeight": 70,
|
|
|
2257
|
+ "outerMargin": true
|
|
|
2258
|
+ }
|
|
|
2259
|
+ }
|
|
|
2260
|
+ }
|
|
|
2261
|
+ },
|
|
|
2262
|
+ "device_error": {
|
|
|
2263
|
+ "name": "Device failed",
|
|
|
2264
|
+ "root": false,
|
|
|
2265
|
+ "layouts": {
|
|
|
2266
|
+ "main": {
|
|
|
2267
|
+ "widgets": {
|
|
|
2268
|
+ "3624013b-378c-f110-5eba-ae95c25a4dcc": {
|
|
|
2269
|
+ "sizeX": 24,
|
|
|
2270
|
+ "sizeY": 12,
|
|
|
2271
|
+ "row": 0,
|
|
|
2272
|
+ "col": 0
|
|
|
2273
|
+ }
|
|
|
2274
|
+ },
|
|
|
2275
|
+ "gridSettings": {
|
|
|
2276
|
+ "backgroundColor": "#eeeeee",
|
|
|
2277
|
+ "color": "rgba(0,0,0,0.870588)",
|
|
|
2278
|
+ "columns": 24,
|
|
|
2279
|
+ "margin": 10,
|
|
|
2280
|
+ "backgroundSizeMode": "100%",
|
|
|
2281
|
+ "autoFillHeight": true,
|
|
|
2282
|
+ "backgroundImageUrl": null,
|
|
|
2283
|
+ "mobileAutoFillHeight": false,
|
|
|
2284
|
+ "mobileRowHeight": 70,
|
|
|
2285
|
+ "outerMargin": true
|
|
|
2286
|
+ }
|
|
|
2287
|
+ }
|
|
|
2288
|
+ }
|
|
|
2289
|
+ }
|
|
|
2290
|
+ },
|
|
|
2291
|
+ "entityAliases": {
|
|
|
2292
|
+ "639da5b4-31f0-0151-6282-c37a3897b7e8": {
|
|
|
2293
|
+ "id": "639da5b4-31f0-0151-6282-c37a3897b7e8",
|
|
|
2294
|
+ "alias": "All devices",
|
|
|
2295
|
+ "filter": {
|
|
|
2296
|
+ "type": "entityType",
|
|
|
2297
|
+ "resolveMultiple": true,
|
|
|
2298
|
+ "entityType": "DEVICE"
|
|
|
2299
|
+ }
|
|
|
2300
|
+ },
|
|
|
2301
|
+ "19f41c21-d9af-e666-8f50-e1748778f955": {
|
|
|
2302
|
+ "id": "19f41c21-d9af-e666-8f50-e1748778f955",
|
|
|
2303
|
+ "alias": "State entity",
|
|
|
2304
|
+ "filter": {
|
|
|
2305
|
+ "type": "stateEntity",
|
|
|
2306
|
+ "resolveMultiple": false,
|
|
|
2307
|
+ "stateEntityParamName": null,
|
|
|
2308
|
+ "defaultStateEntity": null
|
|
|
2309
|
+ }
|
|
|
2310
|
+ }
|
|
|
2311
|
+ },
|
|
|
2312
|
+ "filters": {
|
|
|
2313
|
+ "19a0ad1c-b31d-4a29-9d7b-5d87e2a8ea6e": {
|
|
|
2314
|
+ "id": "19a0ad1c-b31d-4a29-9d7b-5d87e2a8ea6e",
|
|
|
2315
|
+ "filter": "WaitingDevicesFilter",
|
|
|
2316
|
+ "keyFilters": [
|
|
|
2317
|
+ {
|
|
|
2318
|
+ "key": {
|
|
|
2319
|
+ "type": "TIME_SERIES",
|
|
|
2320
|
+ "key": "fw_state"
|
|
|
2321
|
+ },
|
|
|
2322
|
+ "valueType": "STRING",
|
|
|
2323
|
+ "predicates": [
|
|
|
2324
|
+ {
|
|
|
2325
|
+ "keyFilterPredicate": {
|
|
|
2326
|
+ "operation": "EQUAL",
|
|
|
2327
|
+ "value": {
|
|
|
2328
|
+ "defaultValue": "QUEUED",
|
|
|
2329
|
+ "dynamicValue": null
|
|
|
2330
|
+ },
|
|
|
2331
|
+ "ignoreCase": false,
|
|
|
2332
|
+ "type": "STRING"
|
|
|
2333
|
+ },
|
|
|
2334
|
+ "userInfo": {
|
|
|
2335
|
+ "editable": true,
|
|
|
2336
|
+ "label": "",
|
|
|
2337
|
+ "autogeneratedLabel": true,
|
|
|
2338
|
+ "order": 0
|
|
|
2339
|
+ }
|
|
|
2340
|
+ }
|
|
|
2341
|
+ ]
|
|
|
2342
|
+ }
|
|
|
2343
|
+ ],
|
|
|
2344
|
+ "editable": false
|
|
|
2345
|
+ },
|
|
|
2346
|
+ "579f0468-9ce9-7e3e-b34c-88dd3de59897": {
|
|
|
2347
|
+ "id": "579f0468-9ce9-7e3e-b34c-88dd3de59897",
|
|
|
2348
|
+ "filter": "UpdatingDevicesFilter",
|
|
|
2349
|
+ "keyFilters": [
|
|
|
2350
|
+ {
|
|
|
2351
|
+ "key": {
|
|
|
2352
|
+ "type": "TIME_SERIES",
|
|
|
2353
|
+ "key": "fw_state"
|
|
|
2354
|
+ },
|
|
|
2355
|
+ "valueType": "STRING",
|
|
|
2356
|
+ "predicates": [
|
|
|
2357
|
+ {
|
|
|
2358
|
+ "keyFilterPredicate": {
|
|
|
2359
|
+ "operation": "OR",
|
|
|
2360
|
+ "predicates": [
|
|
|
2361
|
+ {
|
|
|
2362
|
+ "keyFilterPredicate": {
|
|
|
2363
|
+ "operation": "EQUAL",
|
|
|
2364
|
+ "value": {
|
|
|
2365
|
+ "defaultValue": "INITIATED",
|
|
|
2366
|
+ "dynamicValue": null
|
|
|
2367
|
+ },
|
|
|
2368
|
+ "ignoreCase": false,
|
|
|
2369
|
+ "type": "STRING"
|
|
|
2370
|
+ },
|
|
|
2371
|
+ "userInfo": {
|
|
|
2372
|
+ "editable": false,
|
|
|
2373
|
+ "label": "fw_state equel",
|
|
|
2374
|
+ "autogeneratedLabel": true,
|
|
|
2375
|
+ "order": 0
|
|
|
2376
|
+ }
|
|
|
2377
|
+ },
|
|
|
2378
|
+ {
|
|
|
2379
|
+ "keyFilterPredicate": {
|
|
|
2380
|
+ "operation": "EQUAL",
|
|
|
2381
|
+ "value": {
|
|
|
2382
|
+ "defaultValue": "DOWNLOADING",
|
|
|
2383
|
+ "dynamicValue": null
|
|
|
2384
|
+ },
|
|
|
2385
|
+ "ignoreCase": false,
|
|
|
2386
|
+ "type": "STRING"
|
|
|
2387
|
+ },
|
|
|
2388
|
+ "userInfo": {
|
|
|
2389
|
+ "editable": false,
|
|
|
2390
|
+ "label": "fw_state equal",
|
|
|
2391
|
+ "autogeneratedLabel": true,
|
|
|
2392
|
+ "order": 0
|
|
|
2393
|
+ }
|
|
|
2394
|
+ },
|
|
|
2395
|
+ {
|
|
|
2396
|
+ "keyFilterPredicate": {
|
|
|
2397
|
+ "operation": "EQUAL",
|
|
|
2398
|
+ "value": {
|
|
|
2399
|
+ "defaultValue": "DOWNLOADED",
|
|
|
2400
|
+ "dynamicValue": null
|
|
|
2401
|
+ },
|
|
|
2402
|
+ "ignoreCase": false,
|
|
|
2403
|
+ "type": "STRING"
|
|
|
2404
|
+ },
|
|
|
2405
|
+ "userInfo": {
|
|
|
2406
|
+ "editable": false,
|
|
|
2407
|
+ "label": "fw_state equal",
|
|
|
2408
|
+ "autogeneratedLabel": true,
|
|
|
2409
|
+ "order": 0
|
|
|
2410
|
+ }
|
|
|
2411
|
+ },
|
|
|
2412
|
+ {
|
|
|
2413
|
+ "keyFilterPredicate": {
|
|
|
2414
|
+ "operation": "EQUAL",
|
|
|
2415
|
+ "value": {
|
|
|
2416
|
+ "defaultValue": "VERIFIED",
|
|
|
2417
|
+ "dynamicValue": null
|
|
|
2418
|
+ },
|
|
|
2419
|
+ "ignoreCase": false,
|
|
|
2420
|
+ "type": "STRING"
|
|
|
2421
|
+ },
|
|
|
2422
|
+ "userInfo": {
|
|
|
2423
|
+ "editable": false,
|
|
|
2424
|
+ "label": "fw_state equal",
|
|
|
2425
|
+ "autogeneratedLabel": true,
|
|
|
2426
|
+ "order": 0
|
|
|
2427
|
+ }
|
|
|
2428
|
+ },
|
|
|
2429
|
+ {
|
|
|
2430
|
+ "keyFilterPredicate": {
|
|
|
2431
|
+ "operation": "EQUAL",
|
|
|
2432
|
+ "value": {
|
|
|
2433
|
+ "defaultValue": "UPDATING",
|
|
|
2434
|
+ "dynamicValue": null
|
|
|
2435
|
+ },
|
|
|
2436
|
+ "ignoreCase": false,
|
|
|
2437
|
+ "type": "STRING"
|
|
|
2438
|
+ },
|
|
|
2439
|
+ "userInfo": {
|
|
|
2440
|
+ "editable": false,
|
|
|
2441
|
+ "label": "fw_state equal",
|
|
|
2442
|
+ "autogeneratedLabel": true,
|
|
|
2443
|
+ "order": 0
|
|
|
2444
|
+ }
|
|
|
2445
|
+ }
|
|
|
2446
|
+ ],
|
|
|
2447
|
+ "type": "COMPLEX"
|
|
|
2448
|
+ },
|
|
|
2449
|
+ "userInfo": {
|
|
|
2450
|
+ "editable": true,
|
|
|
2451
|
+ "label": "",
|
|
|
2452
|
+ "autogeneratedLabel": true,
|
|
|
2453
|
+ "order": 0
|
|
|
2454
|
+ }
|
|
|
2455
|
+ }
|
|
|
2456
|
+ ]
|
|
|
2457
|
+ }
|
|
|
2458
|
+ ],
|
|
|
2459
|
+ "editable": false
|
|
|
2460
|
+ },
|
|
|
2461
|
+ "6044e198-df64-cd76-f339-696f220c4943": {
|
|
|
2462
|
+ "id": "6044e198-df64-cd76-f339-696f220c4943",
|
|
|
2463
|
+ "filter": "UpdetedDevicesFilter",
|
|
|
2464
|
+ "keyFilters": [
|
|
|
2465
|
+ {
|
|
|
2466
|
+ "key": {
|
|
|
2467
|
+ "type": "TIME_SERIES",
|
|
|
2468
|
+ "key": "fw_state"
|
|
|
2469
|
+ },
|
|
|
2470
|
+ "valueType": "STRING",
|
|
|
2471
|
+ "predicates": [
|
|
|
2472
|
+ {
|
|
|
2473
|
+ "keyFilterPredicate": {
|
|
|
2474
|
+ "operation": "EQUAL",
|
|
|
2475
|
+ "value": {
|
|
|
2476
|
+ "defaultValue": "UPDATED",
|
|
|
2477
|
+ "dynamicValue": null
|
|
|
2478
|
+ },
|
|
|
2479
|
+ "ignoreCase": false,
|
|
|
2480
|
+ "type": "STRING"
|
|
|
2481
|
+ },
|
|
|
2482
|
+ "userInfo": {
|
|
|
2483
|
+ "editable": true,
|
|
|
2484
|
+ "label": "",
|
|
|
2485
|
+ "autogeneratedLabel": true,
|
|
|
2486
|
+ "order": 0
|
|
|
2487
|
+ }
|
|
|
2488
|
+ }
|
|
|
2489
|
+ ]
|
|
|
2490
|
+ }
|
|
|
2491
|
+ ],
|
|
|
2492
|
+ "editable": false
|
|
|
2493
|
+ },
|
|
|
2494
|
+ "bdbc6ea1-95a7-3912-341a-58dc7704a00f": {
|
|
|
2495
|
+ "id": "bdbc6ea1-95a7-3912-341a-58dc7704a00f",
|
|
|
2496
|
+ "filter": "FailedDevicesFilter",
|
|
|
2497
|
+ "keyFilters": [
|
|
|
2498
|
+ {
|
|
|
2499
|
+ "key": {
|
|
|
2500
|
+ "type": "TIME_SERIES",
|
|
|
2501
|
+ "key": "fw_state"
|
|
|
2502
|
+ },
|
|
|
2503
|
+ "valueType": "STRING",
|
|
|
2504
|
+ "predicates": [
|
|
|
2505
|
+ {
|
|
|
2506
|
+ "keyFilterPredicate": {
|
|
|
2507
|
+ "operation": "EQUAL",
|
|
|
2508
|
+ "value": {
|
|
|
2509
|
+ "defaultValue": "FAILED",
|
|
|
2510
|
+ "dynamicValue": null
|
|
|
2511
|
+ },
|
|
|
2512
|
+ "ignoreCase": false,
|
|
|
2513
|
+ "type": "STRING"
|
|
|
2514
|
+ },
|
|
|
2515
|
+ "userInfo": {
|
|
|
2516
|
+ "editable": true,
|
|
|
2517
|
+ "label": "",
|
|
|
2518
|
+ "autogeneratedLabel": true,
|
|
|
2519
|
+ "order": 0
|
|
|
2520
|
+ }
|
|
|
2521
|
+ }
|
|
|
2522
|
+ ]
|
|
|
2523
|
+ }
|
|
|
2524
|
+ ],
|
|
|
2525
|
+ "editable": false
|
|
|
2526
|
+ },
|
|
|
2527
|
+ "8fdb88d0-50ac-2232-fdb7-69c30c16544e": {
|
|
|
2528
|
+ "id": "8fdb88d0-50ac-2232-fdb7-69c30c16544e",
|
|
|
2529
|
+ "filter": "DeviceSearch",
|
|
|
2530
|
+ "keyFilters": [
|
|
|
2531
|
+ {
|
|
|
2532
|
+ "key": {
|
|
|
2533
|
+ "type": "ENTITY_FIELD",
|
|
|
2534
|
+ "key": "name"
|
|
|
2535
|
+ },
|
|
|
2536
|
+ "valueType": "STRING",
|
|
|
2537
|
+ "predicates": [
|
|
|
2538
|
+ {
|
|
|
2539
|
+ "keyFilterPredicate": {
|
|
|
2540
|
+ "operation": "CONTAINS",
|
|
|
2541
|
+ "value": {
|
|
|
2542
|
+ "defaultValue": ""
|
|
|
2543
|
+ },
|
|
|
2544
|
+ "ignoreCase": true,
|
|
|
2545
|
+ "type": "STRING"
|
|
|
2546
|
+ },
|
|
|
2547
|
+ "userInfo": {
|
|
|
2548
|
+ "editable": true,
|
|
|
2549
|
+ "label": "Device name",
|
|
|
2550
|
+ "autogeneratedLabel": false,
|
|
|
2551
|
+ "order": 0
|
|
|
2552
|
+ }
|
|
|
2553
|
+ }
|
|
|
2554
|
+ ]
|
|
|
2555
|
+ }
|
|
|
2556
|
+ ],
|
|
|
2557
|
+ "editable": true
|
|
|
2558
|
+ }
|
|
|
2559
|
+ },
|
|
|
2560
|
+ "timewindow": {
|
|
|
2561
|
+ "displayValue": "",
|
|
|
2562
|
+ "hideInterval": false,
|
|
|
2563
|
+ "hideAggregation": false,
|
|
|
2564
|
+ "hideAggInterval": false,
|
|
|
2565
|
+ "hideTimezone": false,
|
|
|
2566
|
+ "selectedTab": 0,
|
|
|
2567
|
+ "realtime": {
|
|
|
2568
|
+ "realtimeType": 0,
|
|
|
2569
|
+ "interval": 1000,
|
|
|
2570
|
+ "timewindowMs": 60000,
|
|
|
2571
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
2572
|
+ },
|
|
|
2573
|
+ "history": {
|
|
|
2574
|
+ "historyType": 0,
|
|
|
2575
|
+ "interval": 1000,
|
|
|
2576
|
+ "timewindowMs": 60000,
|
|
|
2577
|
+ "fixedTimewindow": {
|
|
|
2578
|
+ "startTimeMs": 1618998609030,
|
|
|
2579
|
+ "endTimeMs": 1619085009030
|
|
|
2580
|
+ },
|
|
|
2581
|
+ "quickInterval": "CURRENT_DAY"
|
|
|
2582
|
+ },
|
|
|
2583
|
+ "aggregation": {
|
|
|
2584
|
+ "type": "AVG",
|
|
|
2585
|
+ "limit": 25000
|
|
|
2586
|
+ }
|
|
|
2587
|
+ },
|
|
|
2588
|
+ "settings": {
|
|
|
2589
|
+ "stateControllerId": "entity",
|
|
|
2590
|
+ "showTitle": false,
|
|
|
2591
|
+ "showDashboardsSelect": false,
|
|
|
2592
|
+ "showEntitiesSelect": false,
|
|
|
2593
|
+ "showDashboardTimewindow": true,
|
|
|
2594
|
+ "showDashboardExport": false,
|
|
|
2595
|
+ "toolbarAlwaysOpen": true,
|
|
|
2596
|
+ "titleColor": "rgba(0,0,0,0.870588)",
|
|
|
2597
|
+ "showFilters": true,
|
|
|
2598
|
+ "showDashboardLogo": false,
|
|
|
2599
|
+ "dashboardLogoUrl": null,
|
|
|
2600
|
+ "showUpdateDashboardImage": false
|
|
|
2601
|
+ }
|
|
|
2602
|
+ },
|
|
|
2603
|
+ "externalId": null,
|
|
|
2604
|
+ "name": "Firmware"
|
|
|
2605
|
+} |