From 2f9f77018496eb532535eccada3816e0724c1bb1 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Sat, 21 Dec 2019 16:47:49 -0800 Subject: [PATCH] Fixed multi-desktop connect all. --- package.json | 2 +- views/default-min.handlebars | 8 ++++++-- views/default.handlebars | 8 ++++++-- views/translations/default-min_cs.handlebars | 8 ++++++-- views/translations/default-min_fr.handlebars | 8 ++++++-- views/translations/default-min_ja.handlebars | 8 ++++++-- views/translations/default-min_nl.handlebars | 8 ++++++-- views/translations/default-min_pt.handlebars | 8 ++++++-- views/translations/default_cs.handlebars | 8 ++++++-- views/translations/default_fr.handlebars | 8 ++++++-- views/translations/default_ja.handlebars | 8 ++++++-- views/translations/default_nl.handlebars | 8 ++++++-- views/translations/default_pt.handlebars | 8 ++++++-- 13 files changed, 73 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index 62fb79e2..c1c91cf8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.4.6-h", + "version": "0.4.6-i", "keywords": [ "Remote Management", "Intel AMT", diff --git a/views/default-min.handlebars b/views/default-min.handlebars index 12fdc8a1..e737d294 100644 --- a/views/default-min.handlebars +++ b/views/default-min.handlebars @@ -2009,7 +2009,7 @@ var count = 0; for (var i in nodes) { var node = nodes[i], nodeid = nodes[i]._id; - if (multiDesktop[nodeid] == null) { + if ((multiDesktop[nodeid] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodeid) >= 0))) { var mesh = meshes[node.meshid], meshrights = mesh.links[userinfo._id].rights; if ((meshrights & 8) || (meshrights & 256)) { // Requires remote control rights or desktop view only rights //var conn = 0; @@ -2022,7 +2022,11 @@ } // Perform connect all - for (var i in nodes) { if (multiDesktop[nodes[i]._id] == null) { toggleKvmDevice(nodes[i]._id); } } + for (var i in nodes) { + if ((multiDesktop[nodes[i]._id] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodes[i]._id) >= 0))) { + toggleKvmDevice(nodes[i]._id); + } + } } function disconnectAllKvmFunction() { if (xxdialogMode) return false; for (var nodeid in multiDesktop) { multiDesktop[nodeid].Stop(); } multiDesktop = {}; } function onMultiDesktopStateChange(desk, state) { try { QH('skvmid_' + desk.shortid, ["Disconnected", "Connecting...", "Setup...", '', ''][state]); } catch (ex) {} } diff --git a/views/default.handlebars b/views/default.handlebars index 1c601218..e03b06af 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -3063,7 +3063,7 @@ var count = 0; for (var i in nodes) { var node = nodes[i], nodeid = nodes[i]._id; - if (multiDesktop[nodeid] == null) { + if ((multiDesktop[nodeid] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodeid) >= 0))) { var mesh = meshes[node.meshid], meshrights = mesh.links[userinfo._id].rights; if ((meshrights & 8) || (meshrights & 256)) { // Requires remote control rights or desktop view only rights //var conn = 0; @@ -3076,7 +3076,11 @@ } // Perform connect all - for (var i in nodes) { if (multiDesktop[nodes[i]._id] == null) { toggleKvmDevice(nodes[i]._id); } } + for (var i in nodes) { + if ((multiDesktop[nodes[i]._id] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodes[i]._id) >= 0))) { + toggleKvmDevice(nodes[i]._id); + } + } } function disconnectAllKvmFunction() { if (xxdialogMode) return false; for (var nodeid in multiDesktop) { multiDesktop[nodeid].Stop(); } multiDesktop = {}; } function onMultiDesktopStateChange(desk, state) { try { QH('skvmid_' + desk.shortid, ["Disconnected", "Connecting...", "Setup...", '', ''][state]); } catch (ex) {} } diff --git a/views/translations/default-min_cs.handlebars b/views/translations/default-min_cs.handlebars index b84c64ba..fa050506 100644 --- a/views/translations/default-min_cs.handlebars +++ b/views/translations/default-min_cs.handlebars @@ -2009,7 +2009,7 @@ var count = 0; for (var i in nodes) { var node = nodes[i], nodeid = nodes[i]._id; - if (multiDesktop[nodeid] == null) { + if ((multiDesktop[nodeid] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodeid) >= 0))) { var mesh = meshes[node.meshid], meshrights = mesh.links[userinfo._id].rights; if ((meshrights & 8) || (meshrights & 256)) { // Requires remote control rights or desktop view only rights //var conn = 0; @@ -2022,7 +2022,11 @@ } // Perform connect all - for (var i in nodes) { if (multiDesktop[nodes[i]._id] == null) { toggleKvmDevice(nodes[i]._id); } } + for (var i in nodes) { + if ((multiDesktop[nodes[i]._id] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodes[i]._id) >= 0))) { + toggleKvmDevice(nodes[i]._id); + } + } } function disconnectAllKvmFunction() { if (xxdialogMode) return false; for (var nodeid in multiDesktop) { multiDesktop[nodeid].Stop(); } multiDesktop = {}; } function onMultiDesktopStateChange(desk, state) { try { QH('skvmid_' + desk.shortid, ["Odpojeno", "Připojování...", "Nastavení...", '', ''][state]); } catch (ex) {} } diff --git a/views/translations/default-min_fr.handlebars b/views/translations/default-min_fr.handlebars index 55825662..718a9068 100644 --- a/views/translations/default-min_fr.handlebars +++ b/views/translations/default-min_fr.handlebars @@ -2009,7 +2009,7 @@ var count = 0; for (var i in nodes) { var node = nodes[i], nodeid = nodes[i]._id; - if (multiDesktop[nodeid] == null) { + if ((multiDesktop[nodeid] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodeid) >= 0))) { var mesh = meshes[node.meshid], meshrights = mesh.links[userinfo._id].rights; if ((meshrights & 8) || (meshrights & 256)) { // Requires remote control rights or desktop view only rights //var conn = 0; @@ -2022,7 +2022,11 @@ } // Perform connect all - for (var i in nodes) { if (multiDesktop[nodes[i]._id] == null) { toggleKvmDevice(nodes[i]._id); } } + for (var i in nodes) { + if ((multiDesktop[nodes[i]._id] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodes[i]._id) >= 0))) { + toggleKvmDevice(nodes[i]._id); + } + } } function disconnectAllKvmFunction() { if (xxdialogMode) return false; for (var nodeid in multiDesktop) { multiDesktop[nodeid].Stop(); } multiDesktop = {}; } function onMultiDesktopStateChange(desk, state) { try { QH('skvmid_' + desk.shortid, ["Débranché", "Connecting...", "Traitement...", '', ''][state]); } catch (ex) {} } diff --git a/views/translations/default-min_ja.handlebars b/views/translations/default-min_ja.handlebars index 995d5a6b..6f9999aa 100644 --- a/views/translations/default-min_ja.handlebars +++ b/views/translations/default-min_ja.handlebars @@ -2009,7 +2009,7 @@ var count = 0; for (var i in nodes) { var node = nodes[i], nodeid = nodes[i]._id; - if (multiDesktop[nodeid] == null) { + if ((multiDesktop[nodeid] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodeid) >= 0))) { var mesh = meshes[node.meshid], meshrights = mesh.links[userinfo._id].rights; if ((meshrights & 8) || (meshrights & 256)) { // Requires remote control rights or desktop view only rights //var conn = 0; @@ -2022,7 +2022,11 @@ } // Perform connect all - for (var i in nodes) { if (multiDesktop[nodes[i]._id] == null) { toggleKvmDevice(nodes[i]._id); } } + for (var i in nodes) { + if ((multiDesktop[nodes[i]._id] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodes[i]._id) >= 0))) { + toggleKvmDevice(nodes[i]._id); + } + } } function disconnectAllKvmFunction() { if (xxdialogMode) return false; for (var nodeid in multiDesktop) { multiDesktop[nodeid].Stop(); } multiDesktop = {}; } function onMultiDesktopStateChange(desk, state) { try { QH('skvmid_' + desk.shortid, ["切断されました", "接続しています...", "セットアップ...", '', ''][state]); } catch (ex) {} } diff --git a/views/translations/default-min_nl.handlebars b/views/translations/default-min_nl.handlebars index 1544ac07..61e67db1 100644 --- a/views/translations/default-min_nl.handlebars +++ b/views/translations/default-min_nl.handlebars @@ -2009,7 +2009,7 @@ var count = 0; for (var i in nodes) { var node = nodes[i], nodeid = nodes[i]._id; - if (multiDesktop[nodeid] == null) { + if ((multiDesktop[nodeid] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodeid) >= 0))) { var mesh = meshes[node.meshid], meshrights = mesh.links[userinfo._id].rights; if ((meshrights & 8) || (meshrights & 256)) { // Requires remote control rights or desktop view only rights //var conn = 0; @@ -2022,7 +2022,11 @@ } // Perform connect all - for (var i in nodes) { if (multiDesktop[nodes[i]._id] == null) { toggleKvmDevice(nodes[i]._id); } } + for (var i in nodes) { + if ((multiDesktop[nodes[i]._id] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodes[i]._id) >= 0))) { + toggleKvmDevice(nodes[i]._id); + } + } } function disconnectAllKvmFunction() { if (xxdialogMode) return false; for (var nodeid in multiDesktop) { multiDesktop[nodeid].Stop(); } multiDesktop = {}; } function onMultiDesktopStateChange(desk, state) { try { QH('skvmid_' + desk.shortid, ["Verbroken", "Verbinden...", "Setup...", '', ''][state]); } catch (ex) {} } diff --git a/views/translations/default-min_pt.handlebars b/views/translations/default-min_pt.handlebars index 5bd8598c..5c0ea94e 100644 --- a/views/translations/default-min_pt.handlebars +++ b/views/translations/default-min_pt.handlebars @@ -2009,7 +2009,7 @@ var count = 0; for (var i in nodes) { var node = nodes[i], nodeid = nodes[i]._id; - if (multiDesktop[nodeid] == null) { + if ((multiDesktop[nodeid] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodeid) >= 0))) { var mesh = meshes[node.meshid], meshrights = mesh.links[userinfo._id].rights; if ((meshrights & 8) || (meshrights & 256)) { // Requires remote control rights or desktop view only rights //var conn = 0; @@ -2022,7 +2022,11 @@ } // Perform connect all - for (var i in nodes) { if (multiDesktop[nodes[i]._id] == null) { toggleKvmDevice(nodes[i]._id); } } + for (var i in nodes) { + if ((multiDesktop[nodes[i]._id] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodes[i]._id) >= 0))) { + toggleKvmDevice(nodes[i]._id); + } + } } function disconnectAllKvmFunction() { if (xxdialogMode) return false; for (var nodeid in multiDesktop) { multiDesktop[nodeid].Stop(); } multiDesktop = {}; } function onMultiDesktopStateChange(desk, state) { try { QH('skvmid_' + desk.shortid, ["Desconectado", "Conectando...", "Configurando...", '', ''][state]); } catch (ex) {} } diff --git a/views/translations/default_cs.handlebars b/views/translations/default_cs.handlebars index 7df10eba..c4e36faf 100644 --- a/views/translations/default_cs.handlebars +++ b/views/translations/default_cs.handlebars @@ -3061,7 +3061,7 @@ var count = 0; for (var i in nodes) { var node = nodes[i], nodeid = nodes[i]._id; - if (multiDesktop[nodeid] == null) { + if ((multiDesktop[nodeid] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodeid) >= 0))) { var mesh = meshes[node.meshid], meshrights = mesh.links[userinfo._id].rights; if ((meshrights & 8) || (meshrights & 256)) { // Requires remote control rights or desktop view only rights //var conn = 0; @@ -3074,7 +3074,11 @@ } // Perform connect all - for (var i in nodes) { if (multiDesktop[nodes[i]._id] == null) { toggleKvmDevice(nodes[i]._id); } } + for (var i in nodes) { + if ((multiDesktop[nodes[i]._id] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodes[i]._id) >= 0))) { + toggleKvmDevice(nodes[i]._id); + } + } } function disconnectAllKvmFunction() { if (xxdialogMode) return false; for (var nodeid in multiDesktop) { multiDesktop[nodeid].Stop(); } multiDesktop = {}; } function onMultiDesktopStateChange(desk, state) { try { QH('skvmid_' + desk.shortid, ["Odpojeno", "Připojování...", "Nastavení...", '', ''][state]); } catch (ex) {} } diff --git a/views/translations/default_fr.handlebars b/views/translations/default_fr.handlebars index 7915b122..564496ba 100644 --- a/views/translations/default_fr.handlebars +++ b/views/translations/default_fr.handlebars @@ -3061,7 +3061,7 @@ var count = 0; for (var i in nodes) { var node = nodes[i], nodeid = nodes[i]._id; - if (multiDesktop[nodeid] == null) { + if ((multiDesktop[nodeid] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodeid) >= 0))) { var mesh = meshes[node.meshid], meshrights = mesh.links[userinfo._id].rights; if ((meshrights & 8) || (meshrights & 256)) { // Requires remote control rights or desktop view only rights //var conn = 0; @@ -3074,7 +3074,11 @@ } // Perform connect all - for (var i in nodes) { if (multiDesktop[nodes[i]._id] == null) { toggleKvmDevice(nodes[i]._id); } } + for (var i in nodes) { + if ((multiDesktop[nodes[i]._id] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodes[i]._id) >= 0))) { + toggleKvmDevice(nodes[i]._id); + } + } } function disconnectAllKvmFunction() { if (xxdialogMode) return false; for (var nodeid in multiDesktop) { multiDesktop[nodeid].Stop(); } multiDesktop = {}; } function onMultiDesktopStateChange(desk, state) { try { QH('skvmid_' + desk.shortid, ["Débranché", "Connecting...", "Traitement...", '', ''][state]); } catch (ex) {} } diff --git a/views/translations/default_ja.handlebars b/views/translations/default_ja.handlebars index d76f1006..db72fd7b 100644 --- a/views/translations/default_ja.handlebars +++ b/views/translations/default_ja.handlebars @@ -3061,7 +3061,7 @@ var count = 0; for (var i in nodes) { var node = nodes[i], nodeid = nodes[i]._id; - if (multiDesktop[nodeid] == null) { + if ((multiDesktop[nodeid] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodeid) >= 0))) { var mesh = meshes[node.meshid], meshrights = mesh.links[userinfo._id].rights; if ((meshrights & 8) || (meshrights & 256)) { // Requires remote control rights or desktop view only rights //var conn = 0; @@ -3074,7 +3074,11 @@ } // Perform connect all - for (var i in nodes) { if (multiDesktop[nodes[i]._id] == null) { toggleKvmDevice(nodes[i]._id); } } + for (var i in nodes) { + if ((multiDesktop[nodes[i]._id] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodes[i]._id) >= 0))) { + toggleKvmDevice(nodes[i]._id); + } + } } function disconnectAllKvmFunction() { if (xxdialogMode) return false; for (var nodeid in multiDesktop) { multiDesktop[nodeid].Stop(); } multiDesktop = {}; } function onMultiDesktopStateChange(desk, state) { try { QH('skvmid_' + desk.shortid, ["切断されました", "接続しています...", "セットアップ...", '', ''][state]); } catch (ex) {} } diff --git a/views/translations/default_nl.handlebars b/views/translations/default_nl.handlebars index 8477c7fd..5ca4babf 100644 --- a/views/translations/default_nl.handlebars +++ b/views/translations/default_nl.handlebars @@ -3061,7 +3061,7 @@ var count = 0; for (var i in nodes) { var node = nodes[i], nodeid = nodes[i]._id; - if (multiDesktop[nodeid] == null) { + if ((multiDesktop[nodeid] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodeid) >= 0))) { var mesh = meshes[node.meshid], meshrights = mesh.links[userinfo._id].rights; if ((meshrights & 8) || (meshrights & 256)) { // Requires remote control rights or desktop view only rights //var conn = 0; @@ -3074,7 +3074,11 @@ } // Perform connect all - for (var i in nodes) { if (multiDesktop[nodes[i]._id] == null) { toggleKvmDevice(nodes[i]._id); } } + for (var i in nodes) { + if ((multiDesktop[nodes[i]._id] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodes[i]._id) >= 0))) { + toggleKvmDevice(nodes[i]._id); + } + } } function disconnectAllKvmFunction() { if (xxdialogMode) return false; for (var nodeid in multiDesktop) { multiDesktop[nodeid].Stop(); } multiDesktop = {}; } function onMultiDesktopStateChange(desk, state) { try { QH('skvmid_' + desk.shortid, ["Verbroken", "Verbinden...", "Setup...", '', ''][state]); } catch (ex) {} } diff --git a/views/translations/default_pt.handlebars b/views/translations/default_pt.handlebars index 627c58bf..bdd71cac 100644 --- a/views/translations/default_pt.handlebars +++ b/views/translations/default_pt.handlebars @@ -3061,7 +3061,7 @@ var count = 0; for (var i in nodes) { var node = nodes[i], nodeid = nodes[i]._id; - if (multiDesktop[nodeid] == null) { + if ((multiDesktop[nodeid] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodeid) >= 0))) { var mesh = meshes[node.meshid], meshrights = mesh.links[userinfo._id].rights; if ((meshrights & 8) || (meshrights & 256)) { // Requires remote control rights or desktop view only rights //var conn = 0; @@ -3074,7 +3074,11 @@ } // Perform connect all - for (var i in nodes) { if (multiDesktop[nodes[i]._id] == null) { toggleKvmDevice(nodes[i]._id); } } + for (var i in nodes) { + if ((multiDesktop[nodes[i]._id] == null) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + nodes[i]._id) >= 0))) { + toggleKvmDevice(nodes[i]._id); + } + } } function disconnectAllKvmFunction() { if (xxdialogMode) return false; for (var nodeid in multiDesktop) { multiDesktop[nodeid].Stop(); } multiDesktop = {}; } function onMultiDesktopStateChange(desk, state) { try { QH('skvmid_' + desk.shortid, ["Desconectado", "Conectando...", "Configurando...", '', ''][state]); } catch (ex) {} }