MeshCtrl.js devicesharing improvements.

This commit is contained in:
Ylian Saint-Hilaire 2021-10-08 19:03:51 -07:00
parent 335ca7881f
commit 1aacef0b52
2 changed files with 10 additions and 1 deletions

View File

@ -1870,7 +1870,6 @@ function serverConnect() {
case 'addusertousergroup':
case 'removeuserfromusergroup':
case 'removeDeviceShare':
case 'createDeviceShareLink':
case 'userbroadcast': { // BROADCAST
if ((settings.cmd == 'shell') || (settings.cmd == 'upload') || (settings.cmd == 'download')) return;
if ((settings.multiresponse != null) && (settings.multiresponse > 1)) { settings.multiresponse--; break; }
@ -1882,6 +1881,15 @@ function serverConnect() {
}
break;
}
case 'createDeviceShareLink':
if (data.result == 'OK') {
if (data.publicid) { console.log('ID: ' + data.publicid); }
console.log('URL: ' + data.url);
} else {
console.log(data.result);
}
process.exit();
break;
case 'createInviteLink':
if (data.responseid == 'meshctrl') {
if (data.url) { console.log(data.url); }

View File

@ -4718,6 +4718,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
var url = 'https://' + serverName + ':' + httpsPort + '/' + xdomain + 'sharing?c=' + inviteCookie;
if (serverName.split('.') == 1) { url = '/' + xdomain + page + '?c=' + inviteCookie; }
command.url = url;
command.publicid = publicid;
if (command.responseid != null) { command.result = 'OK'; }
try { ws.send(JSON.stringify(command)); } catch (ex) { }