diff --git a/webgui/topics/Simulator/Properties.html b/webgui/topics/Simulator/Properties.html index 62aad0d8c..9ba46291f 100644 --- a/webgui/topics/Simulator/Properties.html +++ b/webgui/topics/Simulator/Properties.html @@ -40,9 +40,9 @@ }, click: toggle, "></span> - <span class="property-name" + <span class="property-name" data-bind=" - text: name, + text: indexedName, css: { 'pointer-icon': hasChildren, }, diff --git a/webgui/topics/Simulator/Properties.js b/webgui/topics/Simulator/Properties.js index 91c78a957..5862108f2 100644 --- a/webgui/topics/Simulator/Properties.js +++ b/webgui/topics/Simulator/Properties.js @@ -8,6 +8,7 @@ define([ function load() { jquery.get('/json' + self.path, null, function(data) { self.hasChildren = data.nChildren > 0; + self.index = data.index; if (typeof (data.value) != 'undefined') { self.value(data.value); self.hasValue = true; @@ -22,6 +23,7 @@ define([ var p = new PropertyViewModel(); p.name = prop.name; p.path = prop.path; + p.index = prop.index; p.hasChildren = prop.nChildren > 0; if (typeof (prop.value) != 'undefined') { p.value(prop.value); @@ -49,6 +51,11 @@ define([ self.hasChildren = false; self.hasValue = false; + self.indexedName = ko.pureComputed(function() { + if( 0 == self.index ) return self.name; + return self.name + "[" + self.index + "]"; + }); + self.isExpanded = ko.observable(false); self.isExpanded.subscribe(function(newValue) { if (newValue) {