mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add refresh timestamp to context sidebar
This commit is contained in:
parent
5d86f7b6ba
commit
e01996095f
@ -56,6 +56,7 @@ RED.sidebar.context = (function() {
|
|||||||
});
|
});
|
||||||
nodeSection.expand();
|
nodeSection.expand();
|
||||||
nodeSection.content.css({height:"100%"});
|
nodeSection.content.css({height:"100%"});
|
||||||
|
nodeSection.timestamp = $('<div class="sidebar-context-updated"> </div>').appendTo(nodeSection.content);
|
||||||
var table = $('<table class="node-info"></table>').appendTo(nodeSection.content);
|
var table = $('<table class="node-info"></table>').appendTo(nodeSection.content);
|
||||||
nodeSection.table = $('<tbody>').appendTo(table);
|
nodeSection.table = $('<tbody>').appendTo(table);
|
||||||
var bg = $('<div style="float: right"></div>').appendTo(nodeSection.header);
|
var bg = $('<div style="float: right"></div>').appendTo(nodeSection.header);
|
||||||
@ -89,6 +90,7 @@ RED.sidebar.context = (function() {
|
|||||||
});
|
});
|
||||||
flowSection.expand();
|
flowSection.expand();
|
||||||
flowSection.content.css({height:"100%"});
|
flowSection.content.css({height:"100%"});
|
||||||
|
flowSection.timestamp = $('<div class="sidebar-context-updated"> </div>').appendTo(flowSection.content);
|
||||||
var table = $('<table class="node-info"></table>').appendTo(flowSection.content);
|
var table = $('<table class="node-info"></table>').appendTo(flowSection.content);
|
||||||
flowSection.table = $('<tbody>').appendTo(table);
|
flowSection.table = $('<tbody>').appendTo(table);
|
||||||
bg = $('<div style="float: right"></div>').appendTo(flowSection.header);
|
bg = $('<div style="float: right"></div>').appendTo(flowSection.header);
|
||||||
@ -106,6 +108,7 @@ RED.sidebar.context = (function() {
|
|||||||
});
|
});
|
||||||
globalSection.expand();
|
globalSection.expand();
|
||||||
globalSection.content.css({height:"100%"});
|
globalSection.content.css({height:"100%"});
|
||||||
|
globalSection.timestamp = $('<div class="sidebar-context-updated"> </div>').appendTo(globalSection.content);
|
||||||
var table = $('<table class="node-info"></table>').appendTo(globalSection.content);
|
var table = $('<table class="node-info"></table>').appendTo(globalSection.content);
|
||||||
globalSection.table = $('<tbody>').appendTo(table);
|
globalSection.table = $('<tbody>').appendTo(table);
|
||||||
|
|
||||||
@ -185,10 +188,10 @@ RED.sidebar.context = (function() {
|
|||||||
$(nodeSection.table).empty();
|
$(nodeSection.table).empty();
|
||||||
if (node) {
|
if (node) {
|
||||||
$('<tr class="node-info-node-row red-ui-search-empty blank" colspan="2"><td>refresh to load</td></tr>').appendTo(nodeSection.table);
|
$('<tr class="node-info-node-row red-ui-search-empty blank" colspan="2"><td>refresh to load</td></tr>').appendTo(nodeSection.table);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$('<tr class="node-info-node-row red-ui-search-empty blank" colspan="2"><td>none selected</td></tr>').appendTo(nodeSection.table);
|
$('<tr class="node-info-node-row red-ui-search-empty blank" colspan="2"><td>none selected</td></tr>').appendTo(nodeSection.table);
|
||||||
}
|
}
|
||||||
|
nodeSection.timestamp.html(" ");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -244,6 +247,7 @@ RED.sidebar.context = (function() {
|
|||||||
if (l === 0) {
|
if (l === 0) {
|
||||||
$('<tr class="node-info-node-row red-ui-search-empty blank" colspan="2"><td>empty</td></tr>').appendTo(container);
|
$('<tr class="node-info-node-row red-ui-search-empty blank" colspan="2"><td>empty</td></tr>').appendTo(container);
|
||||||
}
|
}
|
||||||
|
$(section.timestamp).text(new Date().toLocaleString());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function updateEntry(section,baseUrl,id) {
|
function updateEntry(section,baseUrl,id) {
|
||||||
|
@ -92,6 +92,7 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
padding-left: 30px;
|
padding-left: 30px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
user-select: none;
|
||||||
}
|
}
|
||||||
.palette-header > i {
|
.palette-header > i {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -39,3 +39,9 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.sidebar-context-updated {
|
||||||
|
text-align: right;
|
||||||
|
font-size: 11px;
|
||||||
|
color: #bbb;
|
||||||
|
padding: 1px 3px;
|
||||||
|
}
|
||||||
|
@ -73,7 +73,7 @@ function clean(flowConfig) {
|
|||||||
var contextId;
|
var contextId;
|
||||||
var node;
|
var node;
|
||||||
for (var id in contexts) {
|
for (var id in contexts) {
|
||||||
if (contexts.hasOwnProperty(id)) {
|
if (contexts.hasOwnProperty(id) && id !== "global") {
|
||||||
var idParts = id.split(":");
|
var idParts = id.split(":");
|
||||||
if (!flowConfig.allNodes.hasOwnProperty(idParts[0])) {
|
if (!flowConfig.allNodes.hasOwnProperty(idParts[0])) {
|
||||||
delete contexts[id];
|
delete contexts[id];
|
||||||
|
Loading…
Reference in New Issue
Block a user