showNotesPanel in device view (#5543)

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
Simon Smith 2023-11-12 18:13:21 +00:00 committed by GitHub
parent 0ce305ebcf
commit c05cbeae88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 56 additions and 3 deletions

View File

@ -1658,6 +1658,11 @@ See description for information about each item.
"default": false, "default": false,
"description": "When enabled, this will hide the power timeline in the web ui" "description": "When enabled, this will hide the power timeline in the web ui"
}, },
"showNotesPanel": {
"type": "boolean",
"default": false,
"description": "When enabled, this will show the notes panel in the device view"
},
"agentInviteCodes": { "agentInviteCodes": {
"type": "boolean", "type": "boolean",
"default": false, "default": false,

View File

@ -1651,6 +1651,11 @@
"default": false, "default": false,
"description": "When enabled, this will hide the power timeline in the web ui" "description": "When enabled, this will hide the power timeline in the web ui"
}, },
"showNotesPanel": {
"type": "boolean",
"default": false,
"description": "When enabled, this will show the notes panel in the device view"
},
"agentInviteCodes": { "agentInviteCodes": {
"type": "boolean", "type": "boolean",
"default": false, "default": false,

View File

@ -3247,4 +3247,24 @@ a {
padding: 6px 12px; padding: 6px 12px;
border: 1px solid #ccc; border: 1px solid #ccc;
border-top: none; border-top: none;
} }
#notesPanel table {
color: black;
background-color: #EEE;
border-color: #AAA;
border-width: 1px;
border-style: solid;
border-collapse: collapse;
width: 100%;
}
#notesPanel thead {
background-color: #AAA;
font-weight: bold;
}
#notesPanel thead tr {
background-color: #AAA;
font-weight: bold;
}

View File

@ -191,6 +191,7 @@
"_ipkvm": false, "_ipkvm": false,
"minify": true, "minify": true,
"_hidePowerTimeline": true, "_hidePowerTimeline": true,
"_showNotesPanel": true,
"_newAccounts": true, "_newAccounts": true,
"_newAccountsUserGroups": [ "ugrp//xxxxxxxxxxxxxxxxx" ], "_newAccountsUserGroups": [ "ugrp//xxxxxxxxxxxxxxxxx" ],
"_userNameIsEmail": true, "_userNameIsEmail": true,

View File

@ -611,6 +611,18 @@
<td style=width:auto valign=top> <td style=width:auto valign=top>
<div id=p10html></div> <div id=p10html></div>
</td> </td>
<td style=width:100px;display:none id=notesPanel valign=top>
<table>
<thead>
<tr><th>Notes</th></tr>
</thead>
<tbody>
<tr>
<td><textarea id=notesPanelArea readonly style=width:300px;height:200px;resize:none;overflow-y:scroll></textarea></td>
</tr>
</tbody>
</table>
</td>
<td style=width:20px></td> <td style=width:20px></td>
<td style=width:200px;vertical-align:top;position:relative valign=top> <td style=width:200px;vertical-align:top;position:relative valign=top>
<div class="deviceNotifyLargeDot"> <div class="deviceNotifyLargeDot">
@ -1485,6 +1497,7 @@
var webRelayPort = parseInt('{{{webRelayPort}}}'); var webRelayPort = parseInt('{{{webRelayPort}}}');
var webRelayDns = '{{{webRelayDns}}}'; var webRelayDns = '{{{webRelayDns}}}';
var hidePowerTimeline = {{{hidePowerTimeline}}}; var hidePowerTimeline = {{{hidePowerTimeline}}};
var showNotesPanel = {{{showNotesPanel}}};
var sessionRefreshTimer = null; var sessionRefreshTimer = null;
var domain = '{{{domain}}}'; var domain = '{{{domain}}}';
var domainUrl = '{{{domainurl}}}'; var domainUrl = '{{{domainurl}}}';
@ -2871,6 +2884,9 @@
QV('idx_dlgOkButton', true); QV('idx_dlgOkButton', true);
focusTextBox('d2devNotes'); focusTextBox('d2devNotes');
} }
}else{
if (message.notes) { QH('notesPanelArea', decodeURIComponent(message.notes)); } else { QH('notesPanelArea', ''); }
if (showNotesPanel && message.notes) { QV('notesPanel',true); }else{ QV('notesPanel', false); }
} }
break; break;
} }
@ -7680,6 +7696,7 @@
meshserver.send({ action: 'lastconnect', nodeid: currentNode._id }); meshserver.send({ action: 'lastconnect', nodeid: currentNode._id });
meshserver.send({ action: 'getsysinfo', nodeid: currentNode._id }); meshserver.send({ action: 'getsysinfo', nodeid: currentNode._id });
meshserver.send({ action: 'getnetworkinfo', nodeid: currentNode._id }); meshserver.send({ action: 'getnetworkinfo', nodeid: currentNode._id });
meshserver.send({ action: 'getNotes', id: currentNode._id });
QH('p17info2', ''); QH('p17info2', '');
} }
@ -7964,7 +7981,11 @@
meshserver.send({ action: 'getNotes', id: decodeURIComponent(noteid) }); meshserver.send({ action: 'getNotes', id: decodeURIComponent(noteid) });
} }
function showNotesEx(buttons, tag) { meshserver.send({ action: 'setNotes', id: decodeURIComponent(tag), notes: encodeURIComponentEx(Q('d2devNotes').value) }); } function showNotesEx(buttons, tag) {
QH('notesPanelArea', Q('d2devNotes').value);
meshserver.send({ action: 'setNotes', id: decodeURIComponent(tag), notes: encodeURIComponentEx(Q('d2devNotes').value) });
if (showNotesPanel && Q('d2devNotes').value != '') { QV('notesPanel',true); }else{ QV('notesPanel', false); }
}
function openIpKvmRemoteControl(nodeid) { function openIpKvmRemoteControl(nodeid) {
if (xxdialogMode) return; if (xxdialogMode) return;

View File

@ -3105,7 +3105,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
pluginHandler: (parent.pluginHandler == null) ? 'null' : parent.pluginHandler.prepExports(), pluginHandler: (parent.pluginHandler == null) ? 'null' : parent.pluginHandler.prepExports(),
webRelayPort: ((args.relaydns != null) ? ((typeof args.aliasport == 'number') ? args.aliasport : args.port) : ((parent.webrelayserver != null) ? ((typeof args.relayaliasport == 'number') ? args.relayaliasport : parent.webrelayserver.port) : 0)), webRelayPort: ((args.relaydns != null) ? ((typeof args.aliasport == 'number') ? args.aliasport : args.port) : ((parent.webrelayserver != null) ? ((typeof args.relayaliasport == 'number') ? args.relayaliasport : parent.webrelayserver.port) : 0)),
webRelayDns: ((args.relaydns != null) ? args.relaydns[0] : ''), webRelayDns: ((args.relaydns != null) ? args.relaydns[0] : ''),
hidePowerTimeline: (domain.hidepowertimeline ? 'true' : 'false') hidePowerTimeline: (domain.hidepowertimeline ? 'true' : 'false'),
showNotesPanel: (domain.shownotespanel ? 'true' : 'false')
}, dbGetFunc.req, domain), user); }, dbGetFunc.req, domain), user);
} }
xdbGetFunc.req = req; xdbGetFunc.req = req;