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;
|
||||
}
|
||||
|
||||
#dp10devicevalue {
|
||||
width: 230px;
|
||||
}
|
||||
|
||||
.fulldesk #p11 {
|
||||
height: 100%;
|
||||
}
|
||||
|
|
|
@ -10036,12 +10036,11 @@
|
|||
var showEditNodeValueDialog_modes4 = [64, 64, 64, 4096];
|
||||
function showEditNodeValueDialog(mode) {
|
||||
if (xxdialogMode) return;
|
||||
var x = '<select id=dp10devicevalue multiple class="form-control" maxlength=' + showEditNodeValueDialog_modes4[mode] + ' class=form-control>';
|
||||
var x = '';
|
||||
var y = '';
|
||||
var v = currentNode[showEditNodeValueDialog_modes2[mode]];
|
||||
if (v == null) v = '';
|
||||
if (mode == 3) {
|
||||
// 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 = [];
|
||||
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) {
|
||||
|
@ -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>';
|
||||
}
|
||||
}
|
||||
}
|
||||
x += y + '</select>'
|
||||
setModalContent('xxAddAgent', "Edit Tags", x);
|
||||
$('#dp10devicevalue').select2({
|
||||
|
@ -10063,6 +10061,18 @@
|
|||
tokenSeparators: [','],
|
||||
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); });
|
||||
Q('dp10devicevalue').focus();
|
||||
}
|
||||
|
@ -10077,10 +10087,15 @@
|
|||
}
|
||||
|
||||
function showEditNodeValueDialogEx(button, mode) {
|
||||
var tt = $('#dp10devicevalue').select2('data'), tags = "";
|
||||
for (var i in tt) { tags += tt[i]['text'].trim() + ', '; }
|
||||
var tags = '';
|
||||
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));
|
||||
} else {
|
||||
x[showEditNodeValueDialog_modes2[mode]] = Q('dp10devicevalue').value;
|
||||
}
|
||||
meshserver.send(x);
|
||||
}
|
||||
|
||||
|
@ -13152,7 +13167,6 @@
|
|||
var x = '';
|
||||
if (node.rname) { x += addDetailItem("Name", EscapeHtml(node.rname), 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) {
|
||||
var m = hardware.windows.osinfo;
|
||||
if (m.OSArchitecture) {
|
||||
|
@ -13183,17 +13197,6 @@
|
|||
const date = printDateTime(lastBootUpTime);
|
||||
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' }); }
|
||||
|
||||
// MeshAgent
|
||||
|
|
Loading…
Reference in New Issue