mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-04-23 20:05:51 -04:00
Fixes and improvements to web power switch support.
This commit is contained in:
parent
127d504126
commit
d8c078d4f1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
agents/agents-new/MeshCmd-signed.exe
Normal file
BIN
agents/agents-new/MeshCmd-signed.exe
Normal file
Binary file not shown.
BIN
agents/agents-new/MeshCmd64-signed.exe
Normal file
BIN
agents/agents-new/MeshCmd64-signed.exe
Normal file
Binary file not shown.
BIN
agents/agents-new/MeshService-signed.exe
Normal file
BIN
agents/agents-new/MeshService-signed.exe
Normal file
Binary file not shown.
BIN
agents/agents-new/MeshService.exe
Normal file
BIN
agents/agents-new/MeshService.exe
Normal file
Binary file not shown.
BIN
agents/agents-new/MeshService64-signed.exe
Normal file
BIN
agents/agents-new/MeshService64-signed.exe
Normal file
Binary file not shown.
BIN
agents/agents-new/MeshService64.exe
Normal file
BIN
agents/agents-new/MeshService64.exe
Normal file
Binary file not shown.
BIN
agents/agents-old/MeshCmd-signed.exe
Normal file
BIN
agents/agents-old/MeshCmd-signed.exe
Normal file
Binary file not shown.
BIN
agents/agents-old/MeshCmd64-signed.exe
Normal file
BIN
agents/agents-old/MeshCmd64-signed.exe
Normal file
Binary file not shown.
BIN
agents/agents-old/MeshService-signed.exe
Normal file
BIN
agents/agents-old/MeshService-signed.exe
Normal file
Binary file not shown.
BIN
agents/agents-old/MeshService.exe
Normal file
BIN
agents/agents-old/MeshService.exe
Normal file
Binary file not shown.
BIN
agents/agents-old/MeshService64-signed.exe
Normal file
BIN
agents/agents-old/MeshService64-signed.exe
Normal file
Binary file not shown.
BIN
agents/agents-old/MeshService64.exe
Normal file
BIN
agents/agents-old/MeshService64.exe
Normal file
Binary file not shown.
29
meshipkvm.js
29
meshipkvm.js
@ -110,6 +110,19 @@ function CreateIPKVMManager(parent) {
|
|||||||
if (sender.firmwareVersion) { console.log('FirmwareVersion:', sender.firmwareVersion); }
|
if (sender.firmwareVersion) { console.log('FirmwareVersion:', sender.firmwareVersion); }
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (state == 0) {
|
||||||
|
// Disconnect all nodes for this device group
|
||||||
|
for (var i in sender.ports) {
|
||||||
|
const port = sender.ports[i];
|
||||||
|
const nodeid = generateIpKvmNodeId(sender.meshid, port.PortId, sender.domainid);
|
||||||
|
if (obj.managedPorts[nodeid] != null) {
|
||||||
|
parent.ClearConnectivityState(sender.meshid, nodeid, 1, null, null);
|
||||||
|
delete obj.managedPorts[nodeid];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when a KVM device changes state
|
// Called when a KVM device changes state
|
||||||
@ -343,6 +356,7 @@ function CreateRaritanKX3Manager(parent, hostname, port, username, password) {
|
|||||||
if ((newState == 2) && (updateTimer == null)) { updateTimer = setInterval(obj.update, 10000); }
|
if ((newState == 2) && (updateTimer == null)) { updateTimer = setInterval(obj.update, 10000); }
|
||||||
if ((newState != 2) && (updateTimer != null)) { clearInterval(updateTimer); updateTimer = null; }
|
if ((newState != 2) && (updateTimer != null)) { clearInterval(updateTimer); updateTimer = null; }
|
||||||
if ((newState == 0) && (obj.started == true) && (retryTimer == null)) { retryTimer = setTimeout(connect, 20000); }
|
if ((newState == 0) && (obj.started == true) && (retryTimer == null)) { retryTimer = setTimeout(connect, 20000); }
|
||||||
|
if (newState == 0) { obj.ports = []; obj.portCount = 0; obj.deviceCount = 0; }
|
||||||
}
|
}
|
||||||
|
|
||||||
function connect() {
|
function connect() {
|
||||||
@ -753,6 +767,7 @@ function CreateWebPowerSwitch(parent, hostname, port, username, password) {
|
|||||||
obj.started = false;
|
obj.started = false;
|
||||||
if (retryTimer != null) { clearTimeout(retryTimer); retryTimer = null; }
|
if (retryTimer != null) { clearTimeout(retryTimer); retryTimer = null; }
|
||||||
setState(0);
|
setState(0);
|
||||||
|
obj.ports = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
function setState(newState) {
|
function setState(newState) {
|
||||||
@ -762,10 +777,12 @@ function CreateWebPowerSwitch(parent, hostname, port, username, password) {
|
|||||||
if ((newState == 2) && (updateTimer == null)) { updateTimer = setInterval(obj.update, 10000); }
|
if ((newState == 2) && (updateTimer == null)) { updateTimer = setInterval(obj.update, 10000); }
|
||||||
if ((newState != 2) && (updateTimer != null)) { clearInterval(updateTimer); updateTimer = null; }
|
if ((newState != 2) && (updateTimer != null)) { clearInterval(updateTimer); updateTimer = null; }
|
||||||
if ((newState == 0) && (obj.started == true) && (retryTimer == null)) { retryTimer = setTimeout(connect, 20000); }
|
if ((newState == 0) && (obj.started == true) && (retryTimer == null)) { retryTimer = setTimeout(connect, 20000); }
|
||||||
|
if (newState == 0) { obj.ports = []; obj.portCount = 0; }
|
||||||
}
|
}
|
||||||
|
|
||||||
function connect() {
|
function connect() {
|
||||||
if (obj.state != 0) return;
|
if (obj.state != 0) return;
|
||||||
|
if (retryTimer != null) { clearTimeout(retryTimer); retryTimer = null; }
|
||||||
setState(1); // 1 = Connecting
|
setState(1); // 1 = Connecting
|
||||||
obj.update();
|
obj.update();
|
||||||
}
|
}
|
||||||
@ -891,11 +908,11 @@ function CreateWebPowerSwitch(parent, hostname, port, username, password) {
|
|||||||
|
|
||||||
function parseChallenge(header) {
|
function parseChallenge(header) {
|
||||||
header = header.replace('qop="auth,auth-int"', 'qop="auth"'); // We don't support auth-int yet, easiest way to get rid of it.
|
header = header.replace('qop="auth,auth-int"', 'qop="auth"'); // We don't support auth-int yet, easiest way to get rid of it.
|
||||||
var prefix = 'Digest ';
|
const prefix = 'Digest ';
|
||||||
var challenge = header.substr(header.indexOf(prefix) + prefix.length);
|
const challenge = header.substr(header.indexOf(prefix) + prefix.length);
|
||||||
var parts = challenge.split(',');
|
const parts = challenge.split(',');
|
||||||
var length = parts.length;
|
const length = parts.length;
|
||||||
var params = {};
|
const params = {};
|
||||||
for (var i = 0; i < length; i++) {
|
for (var i = 0; i < length; i++) {
|
||||||
var part = parts[i].match(/^\s*?([a-zA-Z0-0]+)="(.*)"\s*?$/);
|
var part = parts[i].match(/^\s*?([a-zA-Z0-0]+)="(.*)"\s*?$/);
|
||||||
if (part && part.length > 2) { params[part[1]] = part[2]; }
|
if (part && part.length > 2) { params[part[1]] = part[2]; }
|
||||||
@ -904,7 +921,7 @@ function CreateWebPowerSwitch(parent, hostname, port, username, password) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function renderDigest(params) {
|
function renderDigest(params) {
|
||||||
var parts = [];
|
const parts = [];
|
||||||
for (var i in params) { parts.push(i + '="' + params[i] + '"'); }
|
for (var i in params) { parts.push(i + '="' + params[i] + '"'); }
|
||||||
return 'Digest ' + parts.join(', ');
|
return 'Digest ' + parts.join(', ');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user