cockpit/js/instance.js in cpee-2.1.47 vs cockpit/js/instance.js in cpee-2.1.48

- old
+ new

@@ -408,11 +408,15 @@ } else { entry.text(JSON.stringify(value)) } } else { let ele = $X('<' + key + ' xmlns="http://cpee.org/ns/properties/2.0"/>') - $(ele).text(value) + if (typeof value === 'string' || typeof value === 'boolean' || typeof value === 'number') { + $(ele).text(value) + } else { + $(ele).text(JSON.stringify(value)) + } $(de).find(' > dataelements').append(ele) } }); save[type].content(de); } else { @@ -544,28 +548,28 @@ }); } }); $('#graphgrid').css({ 'grid-template-rows': (shift/2) + 'px repeat(' + max.row + ', 1fr) ' + (shift/2) + 'px', - 'grid-template-columns': 'max-content' + (tcolumns.length > 0 ? ' repeat(' + tcolumns.length.toString() + ',max-content)' : '') + ' auto' + 'grid-template-columns': 'max-content' + (tcolumns.length > 0 ? ' repeat(' + tcolumns.length.toString() + ',max-content)' : '') + ' auto' }); for (var i = 0; i < max.row; i++) { - for (var j =0; j < tcolumns.length; j++) { + for (var j = 0; j < tcolumns.length; j++) { if (tlabels[i+1] != undefined && tlabels[i+1][j] != undefined && tlabels[i+1][j].label != undefined && tlabels[i+1][j].label != '') { var col = tlabels[i+1][j]; - var ele = $('<div class="graphlabel ' + (i % 2 == 0 ? 'odd' : 'even') + '" element-type="' + col.type + '" element-id="' + col.id + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '"><span>' + col.label + '</span></div>'); - graphrealization.illustrator.draw.bind_event(ele,col.type,false); + var ele = $('<div element-row="' + i + '" class="graphlabel ' + (i % 2 == 0 ? 'odd' : 'even') + '" element-type="' + col.type + '" element-id="' + col.id + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '"><span>' + col.label + '</span></div>'); + graphrealization.illustrator.draw.bind_event(ele, col.type, false); $('#graphgrid').append(ele); } else { if (tcolumncount[tcolumns[j]] != 0) { - var ele = $('<div class="graphempty ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + shift + 'px">&#032;</div>'); + var ele = $('<div element-row="' + i + '" class="graphempty ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + shift + 'px">&#032;</div>'); $('#graphgrid').append(ele); } } } var j = tcolumns.length; - var ele = $('<div class="graphlast ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + shift + 'px">&#032;</div>'); + var ele = $('<div element-row="' + i + '" class="graphlast ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + shift + 'px">&#032;</div>'); $('#graphgrid').append(ele); } }; graphrealization.set_svg_container($('#graphcanvas')); graphrealization.set_label_container($('#graphgrid')); @@ -756,13 +760,13 @@ save['state'] = notification; if (notification == "stopped") { monitor_instance_pos(); } - if (notification == "running") { - format_visual_clear(); - } + // if (notification == "running") { + // format_visual_clear(); + // } var but = ""; if (notification == "ready" || notification == "stopped") { $('#state_extended').show(); $("button[name=state_start]").show(); @@ -1457,10 +1461,10 @@ error: report_failure }); } function del_ui_pos(e) { ui_pos(e,function(coll){ - coll.splice(coll.indexOf($(e).attr('id')),1); + coll.splice(coll.findIndex((ele)=>ele[0] == $(e).attr('id')),1); return coll; }); } function add_ui_pos(e) { ui_pos(e,function(coll){