config-editor-base 2.7.2 → 2.7.4
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/dist/index.js +75 -4
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +75 -4
- package/dist/index.modern.js.map +1 -1
- package/dist/schema/Advanced/uischema-01.09.json +1013 -0
- package/dist/schema/CANedge1/schema-01.09.json +2425 -0
- package/dist/schema/CANedge1 GNSS/schema-01.09.json +2818 -0
- package/dist/schema/CANedge2/schema-01.09.json +3003 -0
- package/dist/schema/CANedge2 GNSS/schema-01.09.json +3396 -0
- package/dist/schema/CANedge3 GNSS/schema-01.09.json +3215 -0
- package/dist/schema/Simple/uischema-01.09.json +1063 -0
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -230,8 +230,6 @@ var handleUploadedFile = function handleUploadedFile(file, dropdown, schemaAry,
|
|
|
230
230
|
if (contentJSON != null) {
|
|
231
231
|
switch (true) {
|
|
232
232
|
case type == "uischema" && isValidUISchema(file.name):
|
|
233
|
-
console.log("contentJSON", contentJSON);
|
|
234
|
-
console.log("fileNameDisplay", fileNameDisplay);
|
|
235
233
|
dispatch(setUISchemaContent(contentJSON));
|
|
236
234
|
dispatch(resetLocalUISchemaList());
|
|
237
235
|
dispatch(setUISchemaFile([fileNameDisplay]));
|
|
@@ -345,7 +343,6 @@ var publicSchemaFiles = function publicSchemaFiles(selectedConfig, schemaAry, co
|
|
|
345
343
|
console.log("Unable to load embedded Rule Schema");
|
|
346
344
|
}
|
|
347
345
|
if (uiSchemaAryFiltered && uiSchemaAryFiltered.length) {
|
|
348
|
-
console.log("uiSchemaAryFiltered", uiSchemaAryFiltered);
|
|
349
346
|
dispatch(resetUISchemaList());
|
|
350
347
|
dispatch(setUISchemaFile(uiSchemaAryFiltered));
|
|
351
348
|
dispatch(setUISchemaContent(loadFile(uiSchemaAryFiltered[0])));
|
|
@@ -405,6 +402,29 @@ var checkConfigTransmitPeriodDelay = function checkConfigTransmitPeriodDelay(con
|
|
|
405
402
|
}
|
|
406
403
|
};
|
|
407
404
|
};
|
|
405
|
+
var checkConfigTransmitExceedLimits = function checkConfigTransmitExceedLimits(content) {
|
|
406
|
+
return function (dispatch) {
|
|
407
|
+
var transmitList = [];
|
|
408
|
+
for (var i = 1; i <= 2; i++) {
|
|
409
|
+
if (content["can_" + i] && Array.isArray(content["can_" + i].transmit)) {
|
|
410
|
+
transmitList = transmitList.concat(content["can_" + i].transmit);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
var messageCount = transmitList.length;
|
|
414
|
+
var byteCount = transmitList.reduce(function (total, message) {
|
|
415
|
+
return total + (message.data ? message.data.length / 2 : 0);
|
|
416
|
+
}, 0);
|
|
417
|
+
var MAX_MESSAGES = 224;
|
|
418
|
+
var MAX_BYTES = 4096;
|
|
419
|
+
if (messageCount > MAX_MESSAGES || byteCount > MAX_BYTES) {
|
|
420
|
+
dispatch(set({
|
|
421
|
+
type: "warning",
|
|
422
|
+
message: "Your CAN transmit list(s) exceed the limits: " + messageCount + " messages (max 224) and " + byteCount + " bytes (max 4096). This is invalid and will cause the device to reject your Configuration File",
|
|
423
|
+
autoClear: false
|
|
424
|
+
}));
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
};
|
|
408
428
|
var checkConfigTransmitMonitoring = function checkConfigTransmitMonitoring(content) {
|
|
409
429
|
return function (dispatch) {
|
|
410
430
|
for (var i = 1; i < 3; i++) {
|
|
@@ -420,6 +440,24 @@ var checkConfigTransmitMonitoring = function checkConfigTransmitMonitoring(conte
|
|
|
420
440
|
}
|
|
421
441
|
};
|
|
422
442
|
};
|
|
443
|
+
var checkConfigTransmitMonitoringRouting = function checkConfigTransmitMonitoringRouting(content) {
|
|
444
|
+
return function (dispatch) {
|
|
445
|
+
if (content["routing"] && content["routing"].length > 0) {
|
|
446
|
+
content["routing"].forEach(function (route) {
|
|
447
|
+
if (route.state === 1 && (route.chn_dst === 1 || route.chn_dst === 2)) {
|
|
448
|
+
var channelKey = "can_" + route.chn_dst;
|
|
449
|
+
if (content[channelKey] && content[channelKey].phy && content[channelKey].phy.mode !== 0) {
|
|
450
|
+
dispatch(set({
|
|
451
|
+
type: "warning",
|
|
452
|
+
message: "You are routing a message onto CAN CH" + route.chn_dst + ", but the device will not route any messages unless the CAN CH" + route.chn_dst + " mode is set to Normal.",
|
|
453
|
+
autoClear: false
|
|
454
|
+
}));
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
};
|
|
423
461
|
var checkConfigFiltersDisabled = function checkConfigFiltersDisabled(content) {
|
|
424
462
|
return function (dispatch) {
|
|
425
463
|
for (var i = 1; i < 3; i++) {
|
|
@@ -574,7 +612,6 @@ var checkConfigTlsPort = function checkConfigTlsPort(content) {
|
|
|
574
612
|
var checkMissingAPN = function checkMissingAPN(content) {
|
|
575
613
|
return function (dispatch) {
|
|
576
614
|
if (content.connect != undefined && content.connect.s3 != undefined && content.connect.s3.server != undefined && content.connect.cellular != undefined && content.connect.cellular.apn != undefined) {
|
|
577
|
-
console.log("content.connect.cellular.apn", content.connect.cellular.apn);
|
|
578
615
|
if (content.connect.s3.server.endpoint != undefined && content.connect.cellular.apn != undefined) {
|
|
579
616
|
if (content.connect.s3.server.endpoint.includes("http") && content.connect.cellular.apn == "") {
|
|
580
617
|
dispatch(set({
|
|
@@ -587,6 +624,32 @@ var checkMissingAPN = function checkMissingAPN(content) {
|
|
|
587
624
|
}
|
|
588
625
|
};
|
|
589
626
|
};
|
|
627
|
+
var checkMissingWiFi = function checkMissingWiFi(content) {
|
|
628
|
+
return function (dispatch) {
|
|
629
|
+
if (content.connect != undefined && content.connect.s3 != undefined && content.connect.s3.server != undefined && content.connect.wifi != undefined && content.connect.wifi.accesspoint != undefined) {
|
|
630
|
+
if (content.connect.s3.server.endpoint != undefined && content.connect.wifi.accesspoint.length == 0 && content.connect.s3.server.endpoint.includes("http")) {
|
|
631
|
+
dispatch(set({
|
|
632
|
+
type: "warning",
|
|
633
|
+
message: "Your S3 details appear populated, but you have added no WiFi details. Your device will therefore be unable to connect to your server.",
|
|
634
|
+
autoClear: false
|
|
635
|
+
}));
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
};
|
|
640
|
+
var checkMissingS3IfWiFi = function checkMissingS3IfWiFi(content) {
|
|
641
|
+
return function (dispatch) {
|
|
642
|
+
if (content.connect != undefined && content.connect.s3 != undefined && content.connect.s3.server != undefined && content.connect.wifi != undefined && content.connect.wifi.accesspoint != undefined) {
|
|
643
|
+
if (content.connect.wifi.accesspoint.length > 0 && content.connect.protocol != undefined && content.connect.protocol == 0 && (content.connect.s3.server.endpoint != undefined && !content.connect.s3.server.endpoint.includes("http") || content.connect.s3.server.endpoint == undefined)) {
|
|
644
|
+
dispatch(set({
|
|
645
|
+
type: "warning",
|
|
646
|
+
message: "Your have added WiFi details, but no S3 endpoint is added. Your device will therefore be unable to connect to your server.",
|
|
647
|
+
autoClear: false
|
|
648
|
+
}));
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
};
|
|
590
653
|
var checkIncorrectAPNTelekom = function checkIncorrectAPNTelekom(content) {
|
|
591
654
|
return function (dispatch) {
|
|
592
655
|
if (content.connect != undefined && content.connect.s3 != undefined && content.connect.s3.server != undefined && content.connect.cellular != undefined && content.connect.cellular.apn != undefined) {
|
|
@@ -672,6 +735,8 @@ var saveUpdatedConfiguration = function saveUpdatedConfiguration(filename, conte
|
|
|
672
735
|
if (content.can_2 != undefined) {
|
|
673
736
|
dispatch(checkConfigTransmitPeriodDelay(content));
|
|
674
737
|
dispatch(checkConfigTransmitMonitoring(content));
|
|
738
|
+
dispatch(checkConfigTransmitMonitoringRouting(content));
|
|
739
|
+
dispatch(checkConfigTransmitExceedLimits(content));
|
|
675
740
|
dispatch(checkConfigFiltersDisabled(content));
|
|
676
741
|
dispatch(checkConfigTls(content));
|
|
677
742
|
dispatch(checkConfigAwsEndpoint(content));
|
|
@@ -682,6 +747,8 @@ var saveUpdatedConfiguration = function saveUpdatedConfiguration(filename, conte
|
|
|
682
747
|
dispatch(checkConfigTlsPort(content));
|
|
683
748
|
dispatch(checkFileSplitValue(content));
|
|
684
749
|
dispatch(checkMissingAPN(content));
|
|
750
|
+
dispatch(checkMissingWiFi(content));
|
|
751
|
+
dispatch(checkMissingS3IfWiFi(content));
|
|
685
752
|
dispatch(checkIncorrectAPNSuperSIM(content));
|
|
686
753
|
dispatch(checkIncorrectAPNTelekom(content));
|
|
687
754
|
dispatch(checkIncorrectAPNSpaces(content));
|
|
@@ -786,7 +853,9 @@ var actions = {
|
|
|
786
853
|
resetFiles: resetFiles,
|
|
787
854
|
resetLocalSchemaList: resetLocalSchemaList,
|
|
788
855
|
checkConfigTransmitPeriodDelay: checkConfigTransmitPeriodDelay,
|
|
856
|
+
checkConfigTransmitExceedLimits: checkConfigTransmitExceedLimits,
|
|
789
857
|
checkConfigTransmitMonitoring: checkConfigTransmitMonitoring,
|
|
858
|
+
checkConfigTransmitMonitoringRouting: checkConfigTransmitMonitoringRouting,
|
|
790
859
|
checkConfigFiltersDisabled: checkConfigFiltersDisabled,
|
|
791
860
|
checkConfigControlSignalZeroScalingFactor: checkConfigControlSignalZeroScalingFactor,
|
|
792
861
|
checkConfigTls: checkConfigTls,
|
|
@@ -797,6 +866,8 @@ var actions = {
|
|
|
797
866
|
checkRTCAdjustment: checkRTCAdjustment,
|
|
798
867
|
checkConfigTlsPort: checkConfigTlsPort,
|
|
799
868
|
checkMissingAPN: checkMissingAPN,
|
|
869
|
+
checkMissingWiFi: checkMissingWiFi,
|
|
870
|
+
checkMissingS3IfWiFi: checkMissingS3IfWiFi,
|
|
800
871
|
checkIncorrectAPNTelekom: checkIncorrectAPNTelekom,
|
|
801
872
|
checkIncorrectAPNSuperSIM: checkIncorrectAPNSuperSIM,
|
|
802
873
|
checkIncorrectRoamingSuperSIM: checkIncorrectRoamingSuperSIM,
|