Skip to content

Commit 39e079e

Browse files
committed
fix: use dumpy configurator if configCommands haven't numeric keys. remove deprecated controller.
1 parent d86e968 commit 39e079e

File tree

3 files changed

+5
-344
lines changed

3 files changed

+5
-344
lines changed

app/controllers/configuration-commands.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,16 @@ appController.controller('ConfigCommandsController', function ($scope, $routePar
4141
$element.find('.collapse').removeClass('in');
4242
Object.keys($scope.expanded).map(key => $scope.expanded[key] = false)
4343
}
44+
function smartConfigEnable(configCommands) {
45+
return (configCommands?.version >= 3) && !Object.keys(configCommands).some((el) => !isNaN(+el));
46+
}
47+
4448
function onInit() {
4549
configurationCommandsService.init($routeParams.nodeId).then(function (commands) {
4650
$scope.commandsUpdated = commands;
4751
$scope.node = configurationCommandsService.node();
4852
const configCommands = commands.find(({instance, ccId}) => ccId === 112 && instance === 0);
49-
if (configCommands?.version >= 3) $scope.configCommands = configurationCommandsService.getConfigCommands($routeParams.nodeId);
53+
if (smartConfigEnable(configCommands)) $scope.configCommands = configurationCommandsService.getConfigCommands($routeParams.nodeId);
5054
else $scope.configCommands = configCommands;
5155
}).catch(() => {
5256
$scope.alert = {

app/controllers/configuration_commands.js

-342
This file was deleted.

index.html

-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@
108108
<script src="app/controllers/configuration_interview.js"></script>
109109
<script src="app/controllers/configuration_configuration.js"></script>
110110
<script src="app/controllers/configuration-commands.js"></script>
111-
<script src="app/controllers/configuration_commands.js"></script>
112111
<script src="app/controllers/configuration_association.js"></script>
113112
<script src="app/controllers/configuration_firmware.js"></script>
114113
<script src="app/controllers/configuration_health.js"></script>

0 commit comments

Comments
 (0)