bootstrap: fix edit node and duplicate lastbootuptime
Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
parent
badee98b71
commit
9a8f4e8ebe
|
@ -1305,10 +1305,6 @@ NoMeshesPanel img {
|
||||||
font-size: small;
|
font-size: small;
|
||||||
}
|
}
|
||||||
|
|
||||||
#dp10devicevalue {
|
|
||||||
width: 230px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fulldesk #p11 {
|
.fulldesk #p11 {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10036,12 +10036,11 @@
|
||||||
var showEditNodeValueDialog_modes4 = [64, 64, 64, 4096];
|
var showEditNodeValueDialog_modes4 = [64, 64, 64, 4096];
|
||||||
function showEditNodeValueDialog(mode) {
|
function showEditNodeValueDialog(mode) {
|
||||||
if (xxdialogMode) return;
|
if (xxdialogMode) return;
|
||||||
var x = '<select id=dp10devicevalue multiple class="form-control" maxlength=' + showEditNodeValueDialog_modes4[mode] + ' class=form-control>';
|
var x = '';
|
||||||
var y = '';
|
var y = '';
|
||||||
var v = currentNode[showEditNodeValueDialog_modes2[mode]];
|
|
||||||
if (v == null) v = '';
|
|
||||||
if (mode == 3) {
|
if (mode == 3) {
|
||||||
// Get a list of all possible device tags
|
// Get a list of all possible device tags
|
||||||
|
x = '<select id=dp10devicevalue multiple class="form-control" maxlength=' + showEditNodeValueDialog_modes4[mode] + ' class=form-control>';
|
||||||
var allTags = [];
|
var allTags = [];
|
||||||
for (var i in nodes) { if (nodes[i].tags) { for (var j in nodes[i].tags) { if (allTags.indexOf(nodes[i].tags[j]) == -1) { allTags.push(nodes[i].tags[j]); } } } }
|
for (var i in nodes) { if (nodes[i].tags) { for (var j in nodes[i].tags) { if (allTags.indexOf(nodes[i].tags[j]) == -1) { allTags.push(nodes[i].tags[j]); } } } }
|
||||||
if (allTags.length > 0) {
|
if (allTags.length > 0) {
|
||||||
|
@ -10051,7 +10050,6 @@
|
||||||
y += Array.isArray(v) && v.indexOf(allTags[i]) !== -1 ? '<option selected=selected>' + EscapeHtml(allTags[i]) + '</option>' : '<option>' + EscapeHtml(allTags[i]) + '</option>';
|
y += Array.isArray(v) && v.indexOf(allTags[i]) !== -1 ? '<option selected=selected>' + EscapeHtml(allTags[i]) + '</option>' : '<option>' + EscapeHtml(allTags[i]) + '</option>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
x += y + '</select>'
|
x += y + '</select>'
|
||||||
setModalContent('xxAddAgent', "Edit Tags", x);
|
setModalContent('xxAddAgent', "Edit Tags", x);
|
||||||
$('#dp10devicevalue').select2({
|
$('#dp10devicevalue').select2({
|
||||||
|
@ -10063,6 +10061,18 @@
|
||||||
tokenSeparators: [','],
|
tokenSeparators: [','],
|
||||||
tags: true
|
tags: true
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
x = addHtmlFormFloating(showEditNodeValueDialog_modes[mode], '<input id=dp10devicevalue class="form-control" maxlength=' + showEditNodeValueDialog_modes4[mode] + ' placeholder="' + showEditNodeValueDialog_modes3[mode] + '" onchange=p10editdevicevalueValidate(' + mode + ',event) onkeyup=p10editdevicevalueValidate(' + mode + ',event) class=form-control/>');
|
||||||
|
setModalContent('xxAddAgent', 'Edit Device', x);
|
||||||
|
showModal('xxAddAgentModal', 'idx_dlgOkButton', function () {
|
||||||
|
showEditNodeValueDialogEx(3, mode);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
var v = currentNode[showEditNodeValueDialog_modes2[mode]];
|
||||||
|
if (v == null) v = '';
|
||||||
|
if (Array.isArray(v)) { v = v.join(', '); }
|
||||||
|
Q('dp10devicevalue').value = v;
|
||||||
|
p10editdevicevalueValidate();
|
||||||
showModal('xxAddAgentModal', 'idx_dlgOkButton', function () { showEditNodeValueDialogEx(3, mode); });
|
showModal('xxAddAgentModal', 'idx_dlgOkButton', function () { showEditNodeValueDialogEx(3, mode); });
|
||||||
Q('dp10devicevalue').focus();
|
Q('dp10devicevalue').focus();
|
||||||
}
|
}
|
||||||
|
@ -10077,10 +10087,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function showEditNodeValueDialogEx(button, mode) {
|
function showEditNodeValueDialogEx(button, mode) {
|
||||||
var tt = $('#dp10devicevalue').select2('data'), tags = "";
|
var tags = '';
|
||||||
for (var i in tt) { tags += tt[i]['text'].trim() + ', '; }
|
|
||||||
var x = { action: 'changedevice', nodeid: currentNode._id };
|
var x = { action: 'changedevice', nodeid: currentNode._id };
|
||||||
|
if (mode == 3) {
|
||||||
|
var tt = $('#dp10devicevalue').select2('data');
|
||||||
|
for (var i in tt) { tags += tt[i]['text'].trim() + ', '; }
|
||||||
x[showEditNodeValueDialog_modes2[mode]] = decodeURIComponent(tags.slice(0,-2));
|
x[showEditNodeValueDialog_modes2[mode]] = decodeURIComponent(tags.slice(0,-2));
|
||||||
|
} else {
|
||||||
|
x[showEditNodeValueDialog_modes2[mode]] = Q('dp10devicevalue').value;
|
||||||
|
}
|
||||||
meshserver.send(x);
|
meshserver.send(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13152,7 +13167,6 @@
|
||||||
var x = '';
|
var x = '';
|
||||||
if (node.rname) { x += addDetailItem("Name", EscapeHtml(node.rname), s); }
|
if (node.rname) { x += addDetailItem("Name", EscapeHtml(node.rname), s); }
|
||||||
if (node.osdesc) { x += addDetailItem("Version", EscapeHtml(node.osdesc), s); }
|
if (node.osdesc) { x += addDetailItem("Version", EscapeHtml(node.osdesc), s); }
|
||||||
if ((hardware.windows && hardware.windows.osinfo) || node.osdesc) {
|
|
||||||
if (hardware.windows && hardware.windows.osinfo) {
|
if (hardware.windows && hardware.windows.osinfo) {
|
||||||
var m = hardware.windows.osinfo;
|
var m = hardware.windows.osinfo;
|
||||||
if (m.OSArchitecture) {
|
if (m.OSArchitecture) {
|
||||||
|
@ -13183,17 +13197,6 @@
|
||||||
const date = printDateTime(lastBootUpTime);
|
const date = printDateTime(lastBootUpTime);
|
||||||
x += addDetailItem("Last Boot Up Time", date);
|
x += addDetailItem("Last Boot Up Time", date);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (hardware.linux && hardware.linux.LastBootUpTime) {
|
|
||||||
var lastBootUpTime = new Date(hardware.linux.LastBootUpTime);
|
|
||||||
const date = printDateTime(lastBootUpTime);
|
|
||||||
x += addDetailItem("Last Boot Up Time", date);
|
|
||||||
}
|
|
||||||
if (hardware.darwin && hardware.darwin.LastBootUpTime) {
|
|
||||||
var lastBootUpTime = new Date(hardware.darwin.LastBootUpTime * 1000); // must times by 1000 even tho timestamp is correct?
|
|
||||||
const date = printDateTime(lastBootUpTime);
|
|
||||||
x += addDetailItem("Last Boot Up Time", date);
|
|
||||||
}
|
|
||||||
if (x != '') { sections.push({ name: "Operating System", html: x, img: 'software64.png' }); }
|
if (x != '') { sections.push({ name: "Operating System", html: x, img: 'software64.png' }); }
|
||||||
|
|
||||||
// MeshAgent
|
// MeshAgent
|
||||||
|
|
Loading…
Reference in New Issue