1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Version 0.6.86

This commit is contained in:
Ylian Saint-Hilaire 2020-11-11 22:56:47 -08:00
parent e72fcaca42
commit 22105f2af3
16 changed files with 44627 additions and 1607 deletions

View file

@ -762,6 +762,7 @@
<input type=button id=p13PasteButton disabled="disabled" value="Paste" onclick="p13pasteFile()" />&nbsp;
<input type=button id=p13ZipButton disabled="disabled" value="Zip" onclick="p13zipFiles()" />&nbsp;
<input type=button id=p13RefreshButton disabled="disabled" value="Refresh" onclick="p13folderup(9999)" />&nbsp;
<input type=button id=p13FindButton disabled="disabled" value="Find" onclick="p13findfile()" />&nbsp;
</div>
</td>
</tr>
@ -8028,6 +8029,12 @@
data = JSON.parse(decode_utf8(data));
if (data.action == 'download') { p13gotDownloadCommand(data); return; }
// Find file result
if (data.action == 'findfile') {
if (xxdialogTag == data.reqid) { if (data.r == null) { QE('d2findFilter', true); QE('filefind_dlgOkButton', true); xxdialogTag = null; } else { QA('d2findResults', '<div style=white-space:nowrap>' + EscapeHtml(data.r) + '</div>'); } }
return;
}
// Process file upload commands
if ((data.action != null) && (data.action.startsWith('upload'))) { p13gotUploadData(data); return; }
@ -8149,6 +8156,38 @@
return false;
}
function p13findfile() {
if (xxdialogMode) return;
var x = addHtmlValue("Filter", '<input id=d2findFilter style="width:230px" onkeyup=p13findfileValidate() placeholder="*.txt"></input>');
x += '<div id=d2findResults style="width:100%;height:184px;background-color:white;border:1px solid black;padding:3px;overflow:scroll;margin-top:8px"></div>';
x += '<div style=margin-top:8px><input id=filefind_dlgCancelButton type=button value=' + "Cancel" + ' style=float:right;width:80px;margin-left:5px onclick=p13findfileCancel()>';
x += '<input id=filefind_dlgOkButton type=submit value=' + "OK" + ' style=float:right;width:80px onclick=p13findfileEx()><br /><br /></div>';
setDialogMode(2, "File Files", 0, null, x);
Q('d2findResults').focus();
p13findfileValidate();
}
function p13findfileValidate() {
QE('filefind_dlgOkButton', Q('d2findFilter').value.length > 0);
}
function p13findfileCancel() {
if (xxdialogTag != null) { files.sendText({ action: 'cancelfindfile', reqid: xxdialogTag }); }
dialogclose(0)
}
function p13findfileEx(b, t) {
var winagent = ((currentNode.agent.id > 0) && (currentNode.agent.id < 5));
var slash = winagent ? '\\' : '/';
var path = p13filetreelocation.join(slash) + slash;
if (!winagent) { path = slash + path; }
xxdialogTag = 'find:' + Math.random();
files.sendText({ action: 'findfile', reqid: xxdialogTag, path: path, filter: Q('d2findFilter').value });
QH('d2findResults', '');
QE('d2findFilter', false);
QE('filefind_dlgOkButton', false);
}
var p13sortorder;
function p13sort_filename(a, b) { if (a.ln > b.ln) return (1 * p13sortorder); if (a.ln < b.ln) return (-1 * p13sortorder); return 0; }
function p13sort_timestamp(a, b) { if (a.d > b.d) return (1 * p13sortorder); if (a.d < b.d) return (-1 * p13sortorder); return 0; }
@ -8175,6 +8214,7 @@
QE('p13SelectAllButton', false);
Q('p13SelectAllButton').value = "Select All";
QE('p13RefreshButton', false);
QE('p13FindButton', false);
QE('p13CutButton', false);
QE('p13CopyButton', false);
QE('p13ZipButton', false);
@ -8190,6 +8230,7 @@
QE('p13SelectAllButton', tc > 0);
Q('p13SelectAllButton').value = (cc > 0 ? "Select None" : "Select All");
QE('p13RefreshButton', true);
QE('p13FindButton', ((p13filetreelocation.length > 0) || (winAgent == false)));
QE('p13CutButton', (cc > 0) && (cc == sfc) && ((p13filetreelocation.length > 0) || (winAgent == false)));
QE('p13CopyButton', (cc > 0) && (cc == sfc) && ((p13filetreelocation.length > 0) || (winAgent == false)));
QE('p13ZipButton', (cc > 0) && ((p13filetreelocation.length > 0) || (winAgent == false)));