@bitpoolos/edge-bacnet 1.5.2 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +151 -1
- package/bacnet_client.js +202 -108
- package/bacnet_device.js +3 -1
- package/bacnet_gateway.html +100 -2
- package/bacnet_gateway.js +382 -250
- package/bacnet_inspector.html +43 -0
- package/bacnet_inspector.js +1564 -0
- package/bacnet_inspector_worker.js +535 -0
- package/bacnet_read.html +47 -50
- package/bacnet_read.js +0 -3
- package/common.js +201 -38
- package/inspector.html +460 -0
- package/package.json +6 -2
- package/resources/Logo_Simplified_Positive.svg +32 -0
- package/resources/downloadAsHtml.js +654 -0
- package/resources/icons/device-id-change-icon.svg +4 -0
- package/resources/icons/device-id-conflict-icon.svg +4 -0
- package/resources/icons/favicon.ico +0 -0
- package/resources/icons/points-error-icon.svg +4 -0
- package/resources/icons/points-missing-icon.svg +4 -0
- package/resources/icons/points-ok-icon.svg +4 -0
- package/resources/icons/points-unmapped-icon.svg +5 -0
- package/resources/icons/points-warning-icon.svg +4 -0
- package/resources/inspector.css +25312 -0
- package/resources/inspectorStyle.css +254 -0
- package/resources/inspectorStyles.css +478 -0
- package/resources/node-bacstack-ts/dist/lib/client.js +7 -3
- package/resources/primevue.min.js +1 -0
- package/resources/style.css +17 -1
- package/resources/vue3513.global.prod.js +9 -0
- package/ssrHtmlExporter.js +535 -0
- package/treeBuilder.js +3 -3
package/bacnet_gateway.html
CHANGED
|
@@ -106,6 +106,16 @@
|
|
|
106
106
|
body: JSON.stringify({ d: device }),
|
|
107
107
|
}).then((res) => res.json());
|
|
108
108
|
}
|
|
109
|
+
updatePoint(device, pointKey) {
|
|
110
|
+
return fetch(RED.settings.httpNodeRoot + "bitpool-bacnet-data/updatePoint", {
|
|
111
|
+
method: "POST",
|
|
112
|
+
headers: {
|
|
113
|
+
Accept: "application/json",
|
|
114
|
+
"Content-Type": "application/json",
|
|
115
|
+
},
|
|
116
|
+
body: JSON.stringify({ d: device, k: pointKey }),
|
|
117
|
+
}).then((res) => res.json());
|
|
118
|
+
}
|
|
109
119
|
setDeviceDisplayName(device, displayName) {
|
|
110
120
|
return fetch(RED.settings.httpNodeRoot + "bitpool-bacnet-data/setDeviceDisplayName", {
|
|
111
121
|
method: "POST",
|
|
@@ -143,6 +153,7 @@
|
|
|
143
153
|
defaults: {
|
|
144
154
|
name: { value: "" },
|
|
145
155
|
local_device_address: { value: "", required: true },
|
|
156
|
+
local_interface_name: { value: "", required: false },
|
|
146
157
|
apduTimeout: { value: 6000 },
|
|
147
158
|
roundDecimal: { value: 2 },
|
|
148
159
|
local_device_port: { value: 47808, required: true },
|
|
@@ -203,6 +214,11 @@
|
|
|
203
214
|
label: "Server",
|
|
204
215
|
});
|
|
205
216
|
|
|
217
|
+
tabs.addTab({
|
|
218
|
+
id: "read-backup-tab",
|
|
219
|
+
label: "Backup & Restore",
|
|
220
|
+
});
|
|
221
|
+
|
|
206
222
|
if (node.networkInterfaces && node.networkInterfaces.length > 0) {
|
|
207
223
|
let nicSelector = document.getElementById("node-input-local_device_address");
|
|
208
224
|
node.networkInterfaces.forEach(function (option) {
|
|
@@ -236,6 +252,13 @@
|
|
|
236
252
|
});
|
|
237
253
|
}
|
|
238
254
|
|
|
255
|
+
//sets name of network adapter
|
|
256
|
+
document.getElementById("node-input-local_device_address").addEventListener("change", function () {
|
|
257
|
+
let selectedText = this.options[this.selectedIndex].innerText;
|
|
258
|
+
let nicName = selectedText.split(":")[0];
|
|
259
|
+
node.local_interface_name = nicName;
|
|
260
|
+
});
|
|
261
|
+
|
|
239
262
|
queryAdapters();
|
|
240
263
|
|
|
241
264
|
window.confirmDialogExists = window.confirmDialogExists || false;
|
|
@@ -333,6 +356,7 @@
|
|
|
333
356
|
vueapp.use(primevue.confirmationservice);
|
|
334
357
|
node.vm1 = vueapp.mount("#serverParent");
|
|
335
358
|
|
|
359
|
+
// Import Device List
|
|
336
360
|
$("#file-upload").on("change", function (event) {
|
|
337
361
|
const input = event.target.files[0];
|
|
338
362
|
const reader = new FileReader();
|
|
@@ -349,13 +373,14 @@
|
|
|
349
373
|
contentType: "application/json",
|
|
350
374
|
data: JSON.stringify(jsonPayload),
|
|
351
375
|
success: function (result) { },
|
|
352
|
-
timeout:
|
|
376
|
+
timeout: 0,
|
|
353
377
|
});
|
|
354
378
|
};
|
|
355
379
|
|
|
356
380
|
reader.readAsText(input);
|
|
357
381
|
});
|
|
358
382
|
|
|
383
|
+
//Export Device List
|
|
359
384
|
$("#file-export").click(function (params) {
|
|
360
385
|
$.ajax({
|
|
361
386
|
url: RED.settings.httpNodeRoot + "bitpool-bacnet-data/getDeviceList",
|
|
@@ -366,7 +391,46 @@
|
|
|
366
391
|
aEle.setAttribute("download", "bitpool-bacnet-devices.json");
|
|
367
392
|
aEle.click();
|
|
368
393
|
},
|
|
369
|
-
timeout:
|
|
394
|
+
timeout: 0,
|
|
395
|
+
});
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
//Import complete Data model
|
|
399
|
+
$("#file-upload-database").on("change", function (event) {
|
|
400
|
+
const input = event.target.files[0];
|
|
401
|
+
const reader = new FileReader();
|
|
402
|
+
|
|
403
|
+
reader.onload = function (e) {
|
|
404
|
+
const text = e.target.result;
|
|
405
|
+
|
|
406
|
+
let jsonPayload = JSON.parse(text);
|
|
407
|
+
|
|
408
|
+
$.ajax({
|
|
409
|
+
type: "POST",
|
|
410
|
+
url: RED.settings.httpNodeRoot + "bitpool-bacnet-data/updateDataModel",
|
|
411
|
+
dataType: "json",
|
|
412
|
+
contentType: "application/json",
|
|
413
|
+
data: JSON.stringify(jsonPayload),
|
|
414
|
+
success: function (result) { },
|
|
415
|
+
timeout: 0,
|
|
416
|
+
});
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
reader.readAsText(input);
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
// Export complete Data model
|
|
423
|
+
$("#file-export-database").click(function (params) {
|
|
424
|
+
$.ajax({
|
|
425
|
+
url: RED.settings.httpNodeRoot + "bitpool-bacnet-data/getDataModel",
|
|
426
|
+
success: function (deviceList) {
|
|
427
|
+
let data = "text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(deviceList));
|
|
428
|
+
let aEle = document.getElementById("exportJSON");
|
|
429
|
+
aEle.setAttribute("href", "data:" + data);
|
|
430
|
+
aEle.setAttribute("download", "edge-bacnet-datastore.json");
|
|
431
|
+
aEle.click();
|
|
432
|
+
},
|
|
433
|
+
timeout: 0,
|
|
370
434
|
});
|
|
371
435
|
});
|
|
372
436
|
|
|
@@ -739,6 +803,20 @@
|
|
|
739
803
|
.point_name {
|
|
740
804
|
font-weight: bold;
|
|
741
805
|
}
|
|
806
|
+
.database-backup {
|
|
807
|
+
border-top: 1px solid grey;
|
|
808
|
+
padding-top: 25px;
|
|
809
|
+
margin-top: 5px !important;
|
|
810
|
+
}
|
|
811
|
+
.database-file-label {
|
|
812
|
+
color: black;
|
|
813
|
+
font-weight: bold;
|
|
814
|
+
font-size: 16px;
|
|
815
|
+
width: auto !important;
|
|
816
|
+
}
|
|
817
|
+
.database-file-label-div {
|
|
818
|
+
padding-top: 15px;
|
|
819
|
+
}
|
|
742
820
|
</style>
|
|
743
821
|
|
|
744
822
|
<div class="form-row node-input-read-tabs-row">
|
|
@@ -967,6 +1045,26 @@
|
|
|
967
1045
|
</div>
|
|
968
1046
|
</div>
|
|
969
1047
|
</div>
|
|
1048
|
+
<div id="read-backup-tab" style="display:none">
|
|
1049
|
+
<div class="database-file-label-div">
|
|
1050
|
+
<span class="database-file-label">Database File</span>
|
|
1051
|
+
</div>
|
|
1052
|
+
|
|
1053
|
+
<div class="form-row bp-import-buttons database-backup" id="importDeviceList">
|
|
1054
|
+
<!-- <label> Device List: </label> -->
|
|
1055
|
+
<label for="file-upload-database" class="custom-file-upload">
|
|
1056
|
+
<i class="fa fa-arrow-circle-up" id="fileLabel"></i>
|
|
1057
|
+
<a id="fileLabelText" style="padding-left: 10px;">Import database</a>
|
|
1058
|
+
</label>
|
|
1059
|
+
<input type="file" id="file-upload-database" accept="application/JSON" class="inputStyle" style="width: 258px;" />
|
|
1060
|
+
<label for="file-export-database" class="custom-file-upload" style="margin-left: 5px;">
|
|
1061
|
+
<i class="fa fa-arrow-circle-down" id="fileLabel"></i>
|
|
1062
|
+
<a id="fileLabelText" style="padding-left: 10px;">Export database</a>
|
|
1063
|
+
</label>
|
|
1064
|
+
<input id="file-export-database" class="inputStyle" style="width: 258px; display: none;" />
|
|
1065
|
+
<a id="exportJSON" style="display: none"></a>
|
|
1066
|
+
</div>
|
|
1067
|
+
</div>
|
|
970
1068
|
</div>
|
|
971
1069
|
</script>
|
|
972
1070
|
<script type="text/html" data-help-name="Bacnet-Gateway">
|