Added PreconfiguredRemoteInput #3264

This commit is contained in:
Ylian Saint-Hilaire 2021-11-08 11:45:45 -08:00
parent 966392b779
commit eece5412f4
4 changed files with 52 additions and 2 deletions

View File

@ -307,6 +307,25 @@
"guestDeviceSharing": { "type": "boolean", "default": true, "description": "When set to false, the desktop/terminal sharing link feature is not available." },
"autoRemoveInactiveDevices": { "type": "integer", "default": 0, "minimum": 0, "maximum": 2000, "description": "Number of days a device can be inactive before it's removed. 0 disables this feature. Device group setting will override this value." },
"DeviceSearchBarServerAndClientName": { "type": "boolean", "default": false, "description": "When set to true, the devices search box will match on both the server name and client name of a device." },
"PreconfiguredRemoteInput": {
"type": "array",
"default": null,
"description": "When set, you can right click on the input button in the desktop tab and instantly remotely type one of these pre-configured strings.",
"items": {
"type": "object",
"required": [ "name", "value" ],
"properties": {
"name": {
"description": "Name of the text string.",
"type": "string"
},
"protocol": {
"description": "Text string that will be remotely typed when selected.",
"type": "string"
}
}
}
},
"altMessenging": {
"type": "object",
"properties": {

View File

@ -548,6 +548,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
if (typeof domain.terminal == 'object') { // Settings used for remote terminal feature
if ((typeof domain.terminal.linuxshell == 'string') && (domain.terminal.linuxshell != 'any')) { serverinfo.linuxshell = domain.terminal.linuxshell; }
}
if (Array.isArray(domain.preconfiguredremoteinput)) { serverinfo.preConfiguredRemoteInput = domain.preconfiguredremoteinput; }
// Send server information
try { ws.send(JSON.stringify({ action: 'serverinfo', serverinfo: serverinfo })); } catch (ex) { }

View File

@ -141,6 +141,7 @@
"minify": true,
"_guestDeviceSharing" : false,
"_AutoRemoveInactiveDevices": 37,
"_DeviceSearchBarServerAndClientName": false,
"_loginKey": [ "abc", "123" ],
"_newAccounts": true,
"_newAccountsUserGroups": [ "ugrp//xxxxxxxxxxxxxxxxx" ],
@ -180,6 +181,20 @@
}
]
},
"PreconfiguredRemoteInput": [
{
"name": "CompagnyUrl",
"value": "https://help.mycompany.com/"
},
{
"name": "Any Text",
"value": "Any text\r"
},
{
"name": "Welcome",
"value": "Default welcome text"
}
],
"myServer": {
"Backup": false,
"Restore": false,

View File

@ -111,6 +111,8 @@
<div id="deskKeyShortcutContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
<div class="cmtext" onclick="cmdeskshortcutaction(1,event)">Customize...</div>
</div>
<div id="deskPreConfigShortcutContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
</div>
<!--
<div id="pluginTabContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
@ -2258,6 +2260,12 @@
addNotification({ text: format("Certificate expires in {0} day(s)", days) });
}
}
if (serverinfo.preConfiguredRemoteInput) {
var x = '';
for (var i in serverinfo.preConfiguredRemoteInput) { x += '<div class="cmtext" onclick="cmdeskpreconfigtypeaction(' + i + ',event)">' + EscapeHtml(serverinfo.preConfiguredRemoteInput[i].name) + '</div>'; }
QH('deskPreConfigShortcutContextMenu', x);
Q('DeskType').setAttribute('cmenu', 'deskPreConfigShortcutContextMenu');
}
break;
}
case 'userinfo': {
@ -5880,6 +5888,11 @@
deskCustomizeKeys();
}
function cmdeskpreconfigtypeaction(action) {
if (xxdialogMode) return;
showDeskTypeEx(serverinfo.preConfiguredRemoteInput[action].value); // Type a pre-configured input string
}
function p13deletefileCm(b, file) {
files.sendText({ action: 'rm', reqid: 1, path: p13filetreelocation.join('/'), delfiles: [ file.n ], rec: false });
p13folderup(999);
@ -5911,6 +5924,7 @@
QV('filesContextMenu', false);
QV('deskPlayerContextMenu', false);
QV('deskKeyShortcutContextMenu', false);
QV('deskPreConfigShortcutContextMenu', false);
QV('expandAllContextMenu', false);
//QV('pluginTabContextMenu', false);
contextelement = null;
@ -8779,8 +8793,9 @@
var AmtDeskTypeContent = null;
var DeskTypeTranslate = { 39: 222, 42: 106, 43: 107, 44: 188, 45: 189, 46: 190, 47: 191, 59: 186, 61: 187, 91: 219, 92: 220, 93: 221, 96: 192, 191: 111 };
var DeskTypeShiftTranslate = { 33: 49, 34: 222, 35: 51, 36: 52, 37: 53, 38: 55, 40: 57, 41: 48, 58: 186, 60: 188, 62: 190, 63: 191, 64: 50, 94: 54, 95: 189, 106: 56, 107: 187, 123: 219, 124: 220, 125: 221, 126: 192 };
function showDeskTypeEx() {
var txt = Q('d2typeText').value, ltxt = Q('d2typeText').value.toUpperCase(), x = [], shift = false;
function showDeskTypeEx(text) {
var txt, ltxt, x = [], shift = false;
if (typeof text == 'string') { txt = text, ltxt = text.toUpperCase() } else { txt = Q('d2typeText').value, ltxt = Q('d2typeText').value.toUpperCase(); }
if (desktop.contype == 2) {
// Intel AMT
for (var i in txt) { var a = txt.charCodeAt(i); x.push([a, 1], [a, 0]); }