config-editor-base 3.0.5 → 3.0.6
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 +172 -111
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +172 -111
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1445,7 +1445,7 @@ var lodash = createCommonjsModule(function (module, exports) {
|
|
|
1445
1445
|
var undefined$1;
|
|
1446
1446
|
|
|
1447
1447
|
/** Used as the semantic version number. */
|
|
1448
|
-
var VERSION = '4.17.
|
|
1448
|
+
var VERSION = '4.17.23';
|
|
1449
1449
|
|
|
1450
1450
|
/** Used as the size to enable large array optimizations. */
|
|
1451
1451
|
var LARGE_ARRAY_SIZE = 200;
|
|
@@ -5199,7 +5199,7 @@ var lodash = createCommonjsModule(function (module, exports) {
|
|
|
5199
5199
|
if (isArray(iteratee)) {
|
|
5200
5200
|
return function(value) {
|
|
5201
5201
|
return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
|
|
5202
|
-
}
|
|
5202
|
+
};
|
|
5203
5203
|
}
|
|
5204
5204
|
return iteratee;
|
|
5205
5205
|
});
|
|
@@ -5803,8 +5803,47 @@ var lodash = createCommonjsModule(function (module, exports) {
|
|
|
5803
5803
|
*/
|
|
5804
5804
|
function baseUnset(object, path) {
|
|
5805
5805
|
path = castPath(path, object);
|
|
5806
|
-
|
|
5807
|
-
|
|
5806
|
+
|
|
5807
|
+
// Prevent prototype pollution, see: https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg
|
|
5808
|
+
var index = -1,
|
|
5809
|
+
length = path.length;
|
|
5810
|
+
|
|
5811
|
+
if (!length) {
|
|
5812
|
+
return true;
|
|
5813
|
+
}
|
|
5814
|
+
|
|
5815
|
+
var isRootPrimitive = object == null || (typeof object !== 'object' && typeof object !== 'function');
|
|
5816
|
+
|
|
5817
|
+
while (++index < length) {
|
|
5818
|
+
var key = path[index];
|
|
5819
|
+
|
|
5820
|
+
// skip non-string keys (e.g., Symbols, numbers)
|
|
5821
|
+
if (typeof key !== 'string') {
|
|
5822
|
+
continue;
|
|
5823
|
+
}
|
|
5824
|
+
|
|
5825
|
+
// Always block "__proto__" anywhere in the path if it's not expected
|
|
5826
|
+
if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {
|
|
5827
|
+
return false;
|
|
5828
|
+
}
|
|
5829
|
+
|
|
5830
|
+
// Block "constructor.prototype" chains
|
|
5831
|
+
if (key === 'constructor' &&
|
|
5832
|
+
(index + 1) < length &&
|
|
5833
|
+
typeof path[index + 1] === 'string' &&
|
|
5834
|
+
path[index + 1] === 'prototype') {
|
|
5835
|
+
|
|
5836
|
+
// Allow ONLY when the path starts at a primitive root, e.g., _.unset(0, 'constructor.prototype.a')
|
|
5837
|
+
if (isRootPrimitive && index === 0) {
|
|
5838
|
+
continue;
|
|
5839
|
+
}
|
|
5840
|
+
|
|
5841
|
+
return false;
|
|
5842
|
+
}
|
|
5843
|
+
}
|
|
5844
|
+
|
|
5845
|
+
var obj = parent(object, path);
|
|
5846
|
+
return obj == null || delete obj[toKey(last(path))];
|
|
5808
5847
|
}
|
|
5809
5848
|
|
|
5810
5849
|
/**
|
|
@@ -18995,8 +19034,18 @@ var EditorToolModalWrapper = /*#__PURE__*/function (_React$Component) {
|
|
|
18995
19034
|
var _proto = EditorToolModalWrapper.prototype;
|
|
18996
19035
|
_proto.render = function render() {
|
|
18997
19036
|
return /*#__PURE__*/React.createElement("div", {
|
|
18998
|
-
className:
|
|
18999
|
-
|
|
19037
|
+
className: classNames('tools-side-bar', {
|
|
19038
|
+
'tools-side-bar-expanded': this.props.isExpanded
|
|
19039
|
+
})
|
|
19040
|
+
}, this.props.name === 'filter-builder-modal' && /*#__PURE__*/React.createElement("button", {
|
|
19041
|
+
type: "button",
|
|
19042
|
+
className: "close expand-toggle",
|
|
19043
|
+
onClick: this.props.onToggleExpand
|
|
19044
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
19045
|
+
style: {
|
|
19046
|
+
color: "gray"
|
|
19047
|
+
}
|
|
19048
|
+
}, this.props.isExpanded ? "\xBB" : "\xAB")), /*#__PURE__*/React.createElement("button", {
|
|
19000
19049
|
type: "button",
|
|
19001
19050
|
className: "close",
|
|
19002
19051
|
onClick: this.props.onClick
|
|
@@ -19274,6 +19323,7 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
|
|
|
19274
19323
|
isDownloadConfig: false,
|
|
19275
19324
|
isCompareChanges: false,
|
|
19276
19325
|
activeSideBar: 'schema-modal',
|
|
19326
|
+
isSideBarExpanded: false,
|
|
19277
19327
|
showNewToolsHighlight: true
|
|
19278
19328
|
};
|
|
19279
19329
|
setTimeout(function () {
|
|
@@ -19281,6 +19331,7 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
|
|
|
19281
19331
|
showNewToolsHighlight: false
|
|
19282
19332
|
});
|
|
19283
19333
|
}, 10000);
|
|
19334
|
+
_this.toggleSideBarExpand = _this.toggleSideBarExpand.bind(_this);
|
|
19284
19335
|
_this.input = '';
|
|
19285
19336
|
_this.s3 = _this.props.fetchFileContentExt ? true : false;
|
|
19286
19337
|
return _this;
|
|
@@ -19296,11 +19347,17 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
|
|
|
19296
19347
|
var _this2 = this;
|
|
19297
19348
|
var sideBar = this.state.activeSideBar == name ? 'none' : name;
|
|
19298
19349
|
this.setState({
|
|
19299
|
-
activeSideBar: sideBar
|
|
19350
|
+
activeSideBar: sideBar,
|
|
19351
|
+
isSideBarExpanded: sideBar === 'none' ? false : this.state.isSideBarExpanded
|
|
19300
19352
|
}, function () {
|
|
19301
19353
|
_this2.props.setConfigContentPreSubmit();
|
|
19302
19354
|
});
|
|
19303
19355
|
};
|
|
19356
|
+
_proto.toggleSideBarExpand = function toggleSideBarExpand() {
|
|
19357
|
+
this.setState({
|
|
19358
|
+
isSideBarExpanded: !this.state.isSideBarExpanded
|
|
19359
|
+
});
|
|
19360
|
+
};
|
|
19304
19361
|
_proto.hideUischemaModal = function hideUischemaModal() {
|
|
19305
19362
|
this.setState({
|
|
19306
19363
|
showUischemaModal: false
|
|
@@ -19490,7 +19547,8 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
|
|
|
19490
19547
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
19491
19548
|
className: classNames({
|
|
19492
19549
|
'config-editor fe-header': true,
|
|
19493
|
-
'encryption-padding': this.state.activeSideBar != 'none'
|
|
19550
|
+
'encryption-padding': this.state.activeSideBar != 'none' && !this.state.isSideBarExpanded,
|
|
19551
|
+
'encryption-padding-expanded': this.state.activeSideBar != 'none' && this.state.isSideBarExpanded
|
|
19494
19552
|
})
|
|
19495
19553
|
}, /*#__PURE__*/React.createElement("header", {
|
|
19496
19554
|
className: "top-header-offline"
|
|
@@ -19502,9 +19560,12 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
|
|
|
19502
19560
|
}
|
|
19503
19561
|
}, /*#__PURE__*/React.createElement(EditorToolModalWrapper, {
|
|
19504
19562
|
modal: modal.modal,
|
|
19563
|
+
name: modal.name,
|
|
19505
19564
|
onClick: function onClick() {
|
|
19506
19565
|
return _this6.subMenuBtnClick('none');
|
|
19507
|
-
}
|
|
19566
|
+
},
|
|
19567
|
+
isExpanded: _this6.state.isSideBarExpanded,
|
|
19568
|
+
onToggleExpand: _this6.toggleSideBarExpand
|
|
19508
19569
|
}));
|
|
19509
19570
|
}), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("div", null, editorConfigFiles.length == 0 && this.props.demoMode == false ? /*#__PURE__*/React.createElement("div", {
|
|
19510
19571
|
className: "schema-loader-callout config-loader"
|
|
@@ -24295,7 +24356,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24295
24356
|
});
|
|
24296
24357
|
};
|
|
24297
24358
|
_proto.generateFilterConfig = function generateFilterConfig() {
|
|
24298
|
-
var
|
|
24359
|
+
var _this0 = this;
|
|
24299
24360
|
var _this$state6 = this.state,
|
|
24300
24361
|
mergedEntries = _this$state6.mergedEntries,
|
|
24301
24362
|
groupJ1939Pgns = _this$state6.groupJ1939Pgns,
|
|
@@ -24339,8 +24400,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24339
24400
|
} else {
|
|
24340
24401
|
var count11Bit = 0;
|
|
24341
24402
|
var count29Bit = 0;
|
|
24342
|
-
for (var
|
|
24343
|
-
var entry =
|
|
24403
|
+
for (var _iterator0 = _createForOfIteratorHelperLoose(entries), _step0; !(_step0 = _iterator0()).done;) {
|
|
24404
|
+
var entry = _step0.value;
|
|
24344
24405
|
if (entry.isGroup && entry.groupedIds) {
|
|
24345
24406
|
count29Bit += 1;
|
|
24346
24407
|
} else if (entry.idInt > 0x7FF) {
|
|
@@ -24377,8 +24438,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24377
24438
|
var configKey = channelToConfigKey[_channel];
|
|
24378
24439
|
if (!configKey) continue;
|
|
24379
24440
|
var filters = [];
|
|
24380
|
-
for (var
|
|
24381
|
-
var _entry4 =
|
|
24441
|
+
for (var _iterator1 = _createForOfIteratorHelperLoose(_entries), _step1; !(_step1 = _iterator1()).done;) {
|
|
24442
|
+
var _entry4 = _step1.value;
|
|
24382
24443
|
var prescaler_type = 0;
|
|
24383
24444
|
var prescaler_value = undefined;
|
|
24384
24445
|
var filterTypeValue = filterType === "rejection" ? 1 : 0;
|
|
@@ -24514,12 +24575,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24514
24575
|
this.setState({
|
|
24515
24576
|
generatedFilterConfig: filterConfig
|
|
24516
24577
|
}, function () {
|
|
24517
|
-
|
|
24578
|
+
_this0.testMergedFile();
|
|
24518
24579
|
});
|
|
24519
24580
|
return filterConfig;
|
|
24520
24581
|
};
|
|
24521
24582
|
_proto.testMergedFile = function testMergedFile() {
|
|
24522
|
-
var
|
|
24583
|
+
var _this1 = this;
|
|
24523
24584
|
var _this$state7 = this.state,
|
|
24524
24585
|
generatedFilterConfig = _this$state7.generatedFilterConfig,
|
|
24525
24586
|
filterMergeMode = _this$state7.filterMergeMode;
|
|
@@ -24553,7 +24614,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24553
24614
|
this.setState({
|
|
24554
24615
|
mergedConfig: mergedConfigTemp
|
|
24555
24616
|
}, function () {
|
|
24556
|
-
var schemaContent =
|
|
24617
|
+
var schemaContent = _this1.props.schemaContent;
|
|
24557
24618
|
if (schemaContent && mergedConfigTemp) {
|
|
24558
24619
|
try {
|
|
24559
24620
|
var ajv = new Ajv({
|
|
@@ -24566,12 +24627,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24566
24627
|
if (!valid && validate.errors) {
|
|
24567
24628
|
console.log("AJV validation errors:", validate.errors);
|
|
24568
24629
|
}
|
|
24569
|
-
|
|
24630
|
+
_this1.setState({
|
|
24570
24631
|
mergedConfigValid: valid
|
|
24571
24632
|
});
|
|
24572
24633
|
} catch (e) {
|
|
24573
24634
|
console.log("AJV compilation/validation exception:", e);
|
|
24574
|
-
|
|
24635
|
+
_this1.setState({
|
|
24575
24636
|
mergedConfigValid: false
|
|
24576
24637
|
});
|
|
24577
24638
|
}
|
|
@@ -24638,8 +24699,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24638
24699
|
var existing11Bit = 0;
|
|
24639
24700
|
var existing29Bit = 0;
|
|
24640
24701
|
if (formData[_configKey] && formData[_configKey].filter && formData[_configKey].filter.id) {
|
|
24641
|
-
for (var
|
|
24642
|
-
var filter =
|
|
24702
|
+
for (var _iterator10 = _createForOfIteratorHelperLoose(formData[_configKey].filter.id), _step10; !(_step10 = _iterator10()).done;) {
|
|
24703
|
+
var filter = _step10.value;
|
|
24643
24704
|
if (filter.id_format === 1) {
|
|
24644
24705
|
existing29Bit++;
|
|
24645
24706
|
} else {
|
|
@@ -24650,8 +24711,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24650
24711
|
var new11Bit = 0;
|
|
24651
24712
|
var new29Bit = 0;
|
|
24652
24713
|
if (generatedFilterConfig[_configKey] && generatedFilterConfig[_configKey].filter && generatedFilterConfig[_configKey].filter.id) {
|
|
24653
|
-
for (var
|
|
24654
|
-
var _filter3 =
|
|
24714
|
+
for (var _iterator11 = _createForOfIteratorHelperLoose(generatedFilterConfig[_configKey].filter.id), _step11; !(_step11 = _iterator11()).done;) {
|
|
24715
|
+
var _filter3 = _step11.value;
|
|
24655
24716
|
if (_filter3.id_format === 1) {
|
|
24656
24717
|
new29Bit++;
|
|
24657
24718
|
} else {
|
|
@@ -24691,8 +24752,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24691
24752
|
var filters = config.phy[channel].filter;
|
|
24692
24753
|
var seen = new Set();
|
|
24693
24754
|
var uniqueFilters = [];
|
|
24694
|
-
for (var
|
|
24695
|
-
var filter =
|
|
24755
|
+
for (var _iterator12 = _createForOfIteratorHelperLoose(filters), _step12; !(_step12 = _iterator12()).done;) {
|
|
24756
|
+
var filter = _step12.value;
|
|
24696
24757
|
var fieldsWithoutName = _objectWithoutPropertiesLoose(filter, _excluded);
|
|
24697
24758
|
var key = JSON.stringify(fieldsWithoutName);
|
|
24698
24759
|
if (!seen.has(key)) {
|
|
@@ -24713,8 +24774,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24713
24774
|
var _filters = config[_channel3].filter.id;
|
|
24714
24775
|
var _seen = new Set();
|
|
24715
24776
|
var _uniqueFilters = [];
|
|
24716
|
-
for (var
|
|
24717
|
-
var _filter4 =
|
|
24777
|
+
for (var _iterator13 = _createForOfIteratorHelperLoose(_filters), _step13; !(_step13 = _iterator13()).done;) {
|
|
24778
|
+
var _filter4 = _step13.value;
|
|
24718
24779
|
var _fieldsWithoutName = _objectWithoutPropertiesLoose(_filter4, _excluded2);
|
|
24719
24780
|
var _key = JSON.stringify(_fieldsWithoutName);
|
|
24720
24781
|
if (!_seen.has(_key)) {
|
|
@@ -24810,15 +24871,15 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24810
24871
|
});
|
|
24811
24872
|
};
|
|
24812
24873
|
_proto.render = function render() {
|
|
24813
|
-
var
|
|
24814
|
-
var _this$
|
|
24815
|
-
csvFileName = _this$
|
|
24816
|
-
dbcFileNames = _this$
|
|
24817
|
-
csvData = _this$
|
|
24818
|
-
mergedEntries = _this$
|
|
24819
|
-
searchQuery = _this$
|
|
24820
|
-
groupJ1939Pgns = _this$
|
|
24821
|
-
isLoading = _this$
|
|
24874
|
+
var _this10 = this;
|
|
24875
|
+
var _this$state0 = this.state,
|
|
24876
|
+
csvFileName = _this$state0.csvFileName,
|
|
24877
|
+
dbcFileNames = _this$state0.dbcFileNames,
|
|
24878
|
+
csvData = _this$state0.csvData,
|
|
24879
|
+
mergedEntries = _this$state0.mergedEntries,
|
|
24880
|
+
searchQuery = _this$state0.searchQuery,
|
|
24881
|
+
groupJ1939Pgns = _this$state0.groupJ1939Pgns,
|
|
24882
|
+
isLoading = _this$state0.isLoading;
|
|
24822
24883
|
var filteredEntries = this.getFilteredEntries();
|
|
24823
24884
|
var allFilteredSelected = filteredEntries.length > 0 && filteredEntries.every(function (e) {
|
|
24824
24885
|
return e.selected;
|
|
@@ -24849,7 +24910,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24849
24910
|
}, /*#__PURE__*/React.createElement(Files, {
|
|
24850
24911
|
onChange: this.handleCsvUpload,
|
|
24851
24912
|
onError: function onError(error) {
|
|
24852
|
-
return
|
|
24913
|
+
return _this10.props.showAlert("danger", error.message);
|
|
24853
24914
|
},
|
|
24854
24915
|
accepts: [".csv"],
|
|
24855
24916
|
multiple: false,
|
|
@@ -24863,7 +24924,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24863
24924
|
}, /*#__PURE__*/React.createElement(Files, {
|
|
24864
24925
|
onChange: this.handleDbcUpload,
|
|
24865
24926
|
onError: function onError(error) {
|
|
24866
|
-
return
|
|
24927
|
+
return _this10.props.showAlert("danger", error.message);
|
|
24867
24928
|
},
|
|
24868
24929
|
accepts: [".dbc"],
|
|
24869
24930
|
multiple: true,
|
|
@@ -24873,14 +24934,14 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24873
24934
|
}, /*#__PURE__*/React.createElement("button", {
|
|
24874
24935
|
className: "btn btn-primary"
|
|
24875
24936
|
}, "Load DBC(s)"))), function () {
|
|
24876
|
-
var isFirmwareSupported =
|
|
24877
|
-
var isCanmod =
|
|
24878
|
-
var isCanmodRouter = isCanmod &&
|
|
24937
|
+
var isFirmwareSupported = _this10.isFirmwareVersionSupported();
|
|
24938
|
+
var isCanmod = _this10.props.deviceType === "CANmod";
|
|
24939
|
+
var isCanmodRouter = isCanmod && _this10.isCanmodRouter();
|
|
24879
24940
|
var isDeviceSupported = !isCanmod || isCanmodRouter;
|
|
24880
|
-
var hasConfig =
|
|
24941
|
+
var hasConfig = _this10.props.formData && Object.keys(_this10.props.formData).length > 0;
|
|
24881
24942
|
return /*#__PURE__*/React.createElement("button", {
|
|
24882
24943
|
className: "btn",
|
|
24883
|
-
onClick:
|
|
24944
|
+
onClick: _this10.onReset,
|
|
24884
24945
|
disabled: !hasConfig || !isFirmwareSupported || !isDeviceSupported,
|
|
24885
24946
|
style: {
|
|
24886
24947
|
backgroundColor: "#fff",
|
|
@@ -24914,10 +24975,10 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24914
24975
|
type: "checkbox",
|
|
24915
24976
|
checked: groupJ1939Pgns,
|
|
24916
24977
|
onChange: function onChange() {
|
|
24917
|
-
|
|
24978
|
+
_this10.setState({
|
|
24918
24979
|
groupJ1939Pgns: !groupJ1939Pgns
|
|
24919
24980
|
}, function () {
|
|
24920
|
-
|
|
24981
|
+
_this10.mergeData();
|
|
24921
24982
|
});
|
|
24922
24983
|
},
|
|
24923
24984
|
style: {
|
|
@@ -24927,7 +24988,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24927
24988
|
}), "Group 29-bit IDs as PGNs"), /*#__PURE__*/React.createElement("p", {
|
|
24928
24989
|
className: "field-description field-description-shift"
|
|
24929
24990
|
}, "In J1939/ISOBUS/NMEA protocol use cases it can be relevant to evaluate messages at the 18-bit PGN level instead of the 29-bit ID level.")), csvData && function () {
|
|
24930
|
-
var isEnabled =
|
|
24991
|
+
var isEnabled = _this10.props.formData && _this10.isFirmwareVersionSupported();
|
|
24931
24992
|
return /*#__PURE__*/React.createElement("div", {
|
|
24932
24993
|
className: "form-group pl0 field-string",
|
|
24933
24994
|
style: {
|
|
@@ -24944,9 +25005,9 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24944
25005
|
}
|
|
24945
25006
|
}, /*#__PURE__*/React.createElement("input", {
|
|
24946
25007
|
type: "checkbox",
|
|
24947
|
-
checked:
|
|
25008
|
+
checked: _this10.state.showFilteredSummary,
|
|
24948
25009
|
onChange: function onChange() {
|
|
24949
|
-
return
|
|
25010
|
+
return _this10.toggleFilteredSummary();
|
|
24950
25011
|
},
|
|
24951
25012
|
disabled: !isEnabled,
|
|
24952
25013
|
style: {
|
|
@@ -24995,10 +25056,10 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24995
25056
|
}, label, ":"), /*#__PURE__*/React.createElement("input", {
|
|
24996
25057
|
type: "text",
|
|
24997
25058
|
className: "form-control encryption-input",
|
|
24998
|
-
value:
|
|
25059
|
+
value: _this10.state["channelMap" + label],
|
|
24999
25060
|
onChange: function onChange(e) {
|
|
25000
|
-
var
|
|
25001
|
-
return
|
|
25061
|
+
var _this10$setState;
|
|
25062
|
+
return _this10.setState((_this10$setState = {}, _this10$setState["channelMap" + label] = e.target.value, _this10$setState));
|
|
25002
25063
|
},
|
|
25003
25064
|
style: {
|
|
25004
25065
|
width: "36px",
|
|
@@ -25114,11 +25175,11 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25114
25175
|
marginLeft: "8px"
|
|
25115
25176
|
}
|
|
25116
25177
|
}, "Signals")), filteredEntries.map(function (entry) {
|
|
25117
|
-
var isChannelValid =
|
|
25178
|
+
var isChannelValid = _this10.props.deviceType === "CANmod" ? _this10.isChannelValid(entry.channel) : true;
|
|
25118
25179
|
return /*#__PURE__*/React.createElement("div", {
|
|
25119
25180
|
key: entry.uniqueId,
|
|
25120
25181
|
onClick: function onClick() {
|
|
25121
|
-
return isChannelValid &&
|
|
25182
|
+
return isChannelValid && _this10.handleEntryToggle(entry.uniqueId);
|
|
25122
25183
|
},
|
|
25123
25184
|
style: {
|
|
25124
25185
|
display: "flex",
|
|
@@ -25146,7 +25207,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25146
25207
|
checked: entry.selected,
|
|
25147
25208
|
disabled: !isChannelValid,
|
|
25148
25209
|
onChange: function onChange() {
|
|
25149
|
-
return isChannelValid &&
|
|
25210
|
+
return isChannelValid && _this10.handleEntryToggle(entry.uniqueId);
|
|
25150
25211
|
}
|
|
25151
25212
|
}), /*#__PURE__*/React.createElement("span", null))), /*#__PURE__*/React.createElement("span", {
|
|
25152
25213
|
className: "binary-text-alt-2",
|
|
@@ -25183,7 +25244,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25183
25244
|
display: "flex",
|
|
25184
25245
|
alignItems: "center"
|
|
25185
25246
|
}
|
|
25186
|
-
},
|
|
25247
|
+
}, _this10.renderBarChart(entry.isGroup ? entry.groupedPercentage : entry.percentage, maxPercentage), /*#__PURE__*/React.createElement("span", {
|
|
25187
25248
|
style: {
|
|
25188
25249
|
marginLeft: "4px",
|
|
25189
25250
|
fontFamily: "monospace",
|
|
@@ -25274,7 +25335,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25274
25335
|
marginLeft: "4px"
|
|
25275
25336
|
},
|
|
25276
25337
|
onClick: function onClick() {
|
|
25277
|
-
return
|
|
25338
|
+
return _this10.selectTop(30);
|
|
25278
25339
|
}
|
|
25279
25340
|
}, "Top 30"), /*#__PURE__*/React.createElement("span", {
|
|
25280
25341
|
style: {
|
|
@@ -25287,7 +25348,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25287
25348
|
cursor: "pointer"
|
|
25288
25349
|
},
|
|
25289
25350
|
onClick: function onClick() {
|
|
25290
|
-
return
|
|
25351
|
+
return _this10.selectTop(50);
|
|
25291
25352
|
}
|
|
25292
25353
|
}, "Top 50"), /*#__PURE__*/React.createElement("span", {
|
|
25293
25354
|
style: {
|
|
@@ -25300,7 +25361,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25300
25361
|
cursor: "pointer"
|
|
25301
25362
|
},
|
|
25302
25363
|
onClick: function onClick() {
|
|
25303
|
-
return
|
|
25364
|
+
return _this10.selectMatched(true);
|
|
25304
25365
|
}
|
|
25305
25366
|
}, "Matched"), /*#__PURE__*/React.createElement("span", {
|
|
25306
25367
|
style: {
|
|
@@ -25313,13 +25374,13 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25313
25374
|
cursor: "pointer"
|
|
25314
25375
|
},
|
|
25315
25376
|
onClick: function onClick() {
|
|
25316
|
-
return
|
|
25377
|
+
return _this10.selectMatched(false);
|
|
25317
25378
|
}
|
|
25318
25379
|
}, "Unmatched")), csvData && function () {
|
|
25319
|
-
var activeCsvData =
|
|
25320
|
-
var isFiltered =
|
|
25321
|
-
var originalFileSize =
|
|
25322
|
-
var filteredFileSize = isFiltered ? originalFileSize * (1 -
|
|
25380
|
+
var activeCsvData = _this10.state.showFilteredSummary && _this10.state.filteredCsvData ? _this10.state.filteredCsvData : csvData;
|
|
25381
|
+
var isFiltered = _this10.state.showFilteredSummary && _this10.state.filteredCsvData;
|
|
25382
|
+
var originalFileSize = _this10.csvFileSize / (1024 * 1024);
|
|
25383
|
+
var filteredFileSize = isFiltered ? originalFileSize * (1 - _this10.state.filterReductionPercent / 100) : originalFileSize;
|
|
25323
25384
|
return /*#__PURE__*/React.createElement("div", {
|
|
25324
25385
|
style: {
|
|
25325
25386
|
fontSize: "12px",
|
|
@@ -25346,7 +25407,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25346
25407
|
color: "#5cb85c",
|
|
25347
25408
|
marginTop: "4px"
|
|
25348
25409
|
}
|
|
25349
|
-
}, "Showing filtered summary (reduction: ", /*#__PURE__*/React.createElement("strong", null,
|
|
25410
|
+
}, "Showing filtered summary (reduction: ", /*#__PURE__*/React.createElement("strong", null, _this10.state.filterReductionPercent.toFixed(1), "%"), ")"));
|
|
25350
25411
|
}(), function () {
|
|
25351
25412
|
var hasSelection = mergedEntries.some(function (e) {
|
|
25352
25413
|
return e.selected;
|
|
@@ -25372,10 +25433,10 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25372
25433
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25373
25434
|
className: "col-xs-6",
|
|
25374
25435
|
style: {
|
|
25375
|
-
opacity:
|
|
25376
|
-
pointerEvents:
|
|
25436
|
+
opacity: _this10.props.deviceType === "CANmod" ? 0.5 : 1,
|
|
25437
|
+
pointerEvents: _this10.props.deviceType === "CANmod" ? "none" : "auto"
|
|
25377
25438
|
},
|
|
25378
|
-
title:
|
|
25439
|
+
title: _this10.props.deviceType === "CANmod" ? "CANmod only supports acceptance filters" : ""
|
|
25379
25440
|
}, /*#__PURE__*/React.createElement(SimpleDropdown, {
|
|
25380
25441
|
name: "Type",
|
|
25381
25442
|
options: [{
|
|
@@ -25385,53 +25446,53 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25385
25446
|
value: "rejection",
|
|
25386
25447
|
label: "Rejection"
|
|
25387
25448
|
}],
|
|
25388
|
-
value:
|
|
25449
|
+
value: _this10.state.filterType,
|
|
25389
25450
|
onChange: function onChange(opt) {
|
|
25390
|
-
return
|
|
25451
|
+
return _this10.setState({
|
|
25391
25452
|
filterType: opt.value
|
|
25392
25453
|
}, function () {
|
|
25393
|
-
return
|
|
25454
|
+
return _this10.generateFilterConfig();
|
|
25394
25455
|
});
|
|
25395
25456
|
}
|
|
25396
|
-
})),
|
|
25457
|
+
})), _this10.state.filterType === "acceptance" && /*#__PURE__*/React.createElement("div", {
|
|
25397
25458
|
className: "col-xs-6"
|
|
25398
25459
|
}, /*#__PURE__*/React.createElement(SimpleDropdown, {
|
|
25399
25460
|
name: "Prescaler",
|
|
25400
25461
|
options: prescalerOptions,
|
|
25401
|
-
value:
|
|
25462
|
+
value: _this10.state.prescalerType,
|
|
25402
25463
|
onChange: function onChange(opt) {
|
|
25403
|
-
return
|
|
25464
|
+
return _this10.setState({
|
|
25404
25465
|
prescalerType: opt.value
|
|
25405
25466
|
}, function () {
|
|
25406
|
-
return
|
|
25467
|
+
return _this10.generateFilterConfig();
|
|
25407
25468
|
});
|
|
25408
25469
|
}
|
|
25409
|
-
}))),
|
|
25470
|
+
}))), _this10.state.filterType === "acceptance" && _this10.state.prescalerType !== "none" && /*#__PURE__*/React.createElement("div", {
|
|
25410
25471
|
className: "form-group pl0 field-string"
|
|
25411
|
-
},
|
|
25472
|
+
}, _this10.state.prescalerType === "count" && "Count value", _this10.state.prescalerType === "time" && "Time interval (ms)", _this10.state.prescalerType === "data" && "Data mask (hex)", (_this10.state.prescalerType === "count" || _this10.state.prescalerType === "time") && /*#__PURE__*/React.createElement("input", {
|
|
25412
25473
|
type: "number",
|
|
25413
25474
|
className: "form-control encryption-input",
|
|
25414
25475
|
min: "1",
|
|
25415
|
-
max:
|
|
25416
|
-
value:
|
|
25476
|
+
max: _this10.state.prescalerType === "count" ? 256 : 4194304,
|
|
25477
|
+
value: _this10.state.prescalerValue,
|
|
25417
25478
|
onChange: function onChange(e) {
|
|
25418
|
-
return
|
|
25479
|
+
return _this10.setState({
|
|
25419
25480
|
prescalerValue: parseInt(e.target.value) || 1
|
|
25420
25481
|
}, function () {
|
|
25421
|
-
return
|
|
25482
|
+
return _this10.generateFilterConfig();
|
|
25422
25483
|
});
|
|
25423
25484
|
}
|
|
25424
|
-
}),
|
|
25485
|
+
}), _this10.state.prescalerType === "data" && /*#__PURE__*/React.createElement("input", {
|
|
25425
25486
|
type: "text",
|
|
25426
25487
|
className: "form-control encryption-input",
|
|
25427
|
-
value:
|
|
25488
|
+
value: _this10.state.dataPrescalerMask,
|
|
25428
25489
|
onChange: function onChange(e) {
|
|
25429
25490
|
var val = e.target.value.toUpperCase();
|
|
25430
25491
|
if (/^[a-fA-F0-9]*$/.test(val) && val.length <= 16) {
|
|
25431
|
-
|
|
25492
|
+
_this10.setState({
|
|
25432
25493
|
dataPrescalerMask: val
|
|
25433
25494
|
}, function () {
|
|
25434
|
-
return
|
|
25495
|
+
return _this10.generateFilterConfig();
|
|
25435
25496
|
});
|
|
25436
25497
|
}
|
|
25437
25498
|
},
|
|
@@ -25442,7 +25503,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25442
25503
|
}
|
|
25443
25504
|
}), /*#__PURE__*/React.createElement("span", {
|
|
25444
25505
|
className: "field-description field-description-shift"
|
|
25445
|
-
},
|
|
25506
|
+
}, _this10.state.prescalerType === "count" && "Accept every Nth message (1-256)", _this10.state.prescalerType === "time" && "Minimum time between messages (1-4194304 ms)", _this10.state.prescalerType === "data" && "Hex mask for data change detection")), /*#__PURE__*/React.createElement("div", {
|
|
25446
25507
|
className: "form-group pl0 field-string",
|
|
25447
25508
|
style: {
|
|
25448
25509
|
marginBottom: "10px"
|
|
@@ -25465,12 +25526,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25465
25526
|
type: "radio",
|
|
25466
25527
|
name: "filterMergeMode",
|
|
25467
25528
|
value: "replace",
|
|
25468
|
-
checked:
|
|
25529
|
+
checked: _this10.state.filterMergeMode === "replace",
|
|
25469
25530
|
onChange: function onChange(e) {
|
|
25470
|
-
return
|
|
25531
|
+
return _this10.setState({
|
|
25471
25532
|
filterMergeMode: e.target.value
|
|
25472
25533
|
}, function () {
|
|
25473
|
-
return
|
|
25534
|
+
return _this10.generateFilterConfig();
|
|
25474
25535
|
});
|
|
25475
25536
|
},
|
|
25476
25537
|
style: {
|
|
@@ -25493,12 +25554,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25493
25554
|
type: "radio",
|
|
25494
25555
|
name: "filterMergeMode",
|
|
25495
25556
|
value: "append_top",
|
|
25496
|
-
checked:
|
|
25557
|
+
checked: _this10.state.filterMergeMode === "append_top",
|
|
25497
25558
|
onChange: function onChange(e) {
|
|
25498
|
-
return
|
|
25559
|
+
return _this10.setState({
|
|
25499
25560
|
filterMergeMode: e.target.value
|
|
25500
25561
|
}, function () {
|
|
25501
|
-
return
|
|
25562
|
+
return _this10.generateFilterConfig();
|
|
25502
25563
|
});
|
|
25503
25564
|
},
|
|
25504
25565
|
style: {
|
|
@@ -25521,12 +25582,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25521
25582
|
type: "radio",
|
|
25522
25583
|
name: "filterMergeMode",
|
|
25523
25584
|
value: "append_bottom",
|
|
25524
|
-
checked:
|
|
25585
|
+
checked: _this10.state.filterMergeMode === "append_bottom",
|
|
25525
25586
|
onChange: function onChange(e) {
|
|
25526
|
-
return
|
|
25587
|
+
return _this10.setState({
|
|
25527
25588
|
filterMergeMode: e.target.value
|
|
25528
25589
|
}, function () {
|
|
25529
|
-
return
|
|
25590
|
+
return _this10.generateFilterConfig();
|
|
25530
25591
|
});
|
|
25531
25592
|
},
|
|
25532
25593
|
style: {
|
|
@@ -25562,9 +25623,9 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25562
25623
|
}, 0);
|
|
25563
25624
|
return " (" + count11Bit + " 11-bit, " + count29Bit + " 29-bit) | " + sizePercent.toFixed(1) + "%";
|
|
25564
25625
|
}()), function () {
|
|
25565
|
-
var isFirmwareSupported =
|
|
25566
|
-
var isCanmod =
|
|
25567
|
-
var isCanmodRouter = isCanmod &&
|
|
25626
|
+
var isFirmwareSupported = _this10.isFirmwareVersionSupported();
|
|
25627
|
+
var isCanmod = _this10.props.deviceType === "CANmod";
|
|
25628
|
+
var isCanmodRouter = isCanmod && _this10.isCanmodRouter();
|
|
25568
25629
|
var minFirmware = isCanmod ? MIN_FIRMWARE_CANMOD_ROUTER : MIN_FIRMWARE_CANEDGE;
|
|
25569
25630
|
var isDeviceSupported = !isCanmod || isCanmodRouter;
|
|
25570
25631
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -25575,25 +25636,25 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25575
25636
|
}
|
|
25576
25637
|
}, /*#__PURE__*/React.createElement("button", {
|
|
25577
25638
|
className: "btn btn-primary",
|
|
25578
|
-
onClick:
|
|
25579
|
-
disabled: !
|
|
25639
|
+
onClick: _this10.onMerge,
|
|
25640
|
+
disabled: !_this10.props.formData || Object.keys(_this10.props.formData).length === 0 || _this10.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported
|
|
25580
25641
|
}, "Merge files"), /*#__PURE__*/React.createElement("button", {
|
|
25581
25642
|
className: "btn btn-default",
|
|
25582
|
-
onClick:
|
|
25583
|
-
disabled: Object.keys(
|
|
25643
|
+
onClick: _this10.onDownload,
|
|
25644
|
+
disabled: Object.keys(_this10.state.generatedFilterConfig).length === 0
|
|
25584
25645
|
}, "Download JSON")), function () {
|
|
25585
|
-
var mergeDisabled = !
|
|
25646
|
+
var mergeDisabled = !_this10.props.formData || Object.keys(_this10.props.formData).length === 0 || _this10.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported;
|
|
25586
25647
|
if (!mergeDisabled) return null;
|
|
25587
25648
|
var reason = "";
|
|
25588
|
-
if (!
|
|
25649
|
+
if (!_this10.props.formData || Object.keys(_this10.props.formData).length === 0) {
|
|
25589
25650
|
reason = "No configuration file loaded";
|
|
25590
25651
|
} else if (!isDeviceSupported) {
|
|
25591
25652
|
reason = "Only CANmod.router is supported for CANmod devices";
|
|
25592
25653
|
} else if (!isFirmwareSupported) {
|
|
25593
25654
|
reason = "Merging requires firmware " + minFirmware + ".XX+ - please update your device";
|
|
25594
|
-
} else if (
|
|
25655
|
+
} else if (_this10.state.mergedConfigValid === "Unknown") {
|
|
25595
25656
|
reason = "No filters selected";
|
|
25596
|
-
} else if (
|
|
25657
|
+
} else if (_this10.state.mergedConfigValid === false) {
|
|
25597
25658
|
reason = "Generated filter configuration is invalid";
|
|
25598
25659
|
}
|
|
25599
25660
|
return reason ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -25604,7 +25665,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25604
25665
|
}
|
|
25605
25666
|
}, reason) : null;
|
|
25606
25667
|
}());
|
|
25607
|
-
}(), Object.keys(
|
|
25668
|
+
}(), Object.keys(_this10.state.generatedFilterConfig).length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
25608
25669
|
style: {
|
|
25609
25670
|
marginTop: "10px"
|
|
25610
25671
|
}
|
|
@@ -25617,17 +25678,17 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25617
25678
|
}
|
|
25618
25679
|
}, /*#__PURE__*/React.createElement("input", {
|
|
25619
25680
|
type: "checkbox",
|
|
25620
|
-
checked:
|
|
25681
|
+
checked: _this10.state.showFilterPreview,
|
|
25621
25682
|
onChange: function onChange() {
|
|
25622
|
-
return
|
|
25623
|
-
showFilterPreview: !
|
|
25683
|
+
return _this10.setState({
|
|
25684
|
+
showFilterPreview: !_this10.state.showFilterPreview
|
|
25624
25685
|
});
|
|
25625
25686
|
},
|
|
25626
25687
|
style: {
|
|
25627
25688
|
marginRight: "6px",
|
|
25628
25689
|
marginBottom: "4px"
|
|
25629
25690
|
}
|
|
25630
|
-
}), "Show partial config preview"),
|
|
25691
|
+
}), "Show partial config preview"), _this10.state.showFilterPreview && /*#__PURE__*/React.createElement("div", {
|
|
25631
25692
|
style: {
|
|
25632
25693
|
marginTop: "10px"
|
|
25633
25694
|
}
|
|
@@ -25638,7 +25699,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25638
25699
|
overflow: "auto",
|
|
25639
25700
|
fontSize: "11px"
|
|
25640
25701
|
}
|
|
25641
|
-
}, JSON.stringify(
|
|
25702
|
+
}, JSON.stringify(_this10.state.generatedFilterConfig, null, 2)))));
|
|
25642
25703
|
}()), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null)));
|
|
25643
25704
|
};
|
|
25644
25705
|
return FilterBuilderTool;
|