|
|
|
|
@@ -715,7 +715,7 @@
|
|
|
|
|
<div id="tlsNotification1" style="text-align:center;padding-top:8px;color:darkblue;cursor:pointer;display:none" onclick="showTlsCert(1)"><img src="images/lock.gif" /> TLS Secured</div>
|
|
|
|
|
<div id="tlsNotification2" style="text-align:center;padding-top:8px;color:darkblue;cursor:pointer;display:none" onclick="showTlsCert(1)"><img src="images/lock.gif" /> TLS Secured (Pinned)</div>
|
|
|
|
|
<div id="tlsNotification3" style="text-align:center;padding-top:8px;color:darkblue;cursor:pointer;display:none" onclick="showTlsCert(1)"><img src="images/lock.gif" /> TLS (Untrusted)</div>
|
|
|
|
|
<div id="tlsNotification4" style="text-align:center;padding-top:8px;color:darkblue;cursor:pointer;display:none;color:red" onclick="switchToTls(1)"><img src="images/unlock.gif" /> Switch to TLS</div>
|
|
|
|
|
<div id="tlsNotification4" style="text-align:center;padding-top:8px;color:darkblue;cursor:pointer;display:none;color:red" onclick="switchToTls()"><img src="images/unlock.gif" /> Switch to TLS</div>
|
|
|
|
|
<!-- ###END###{Mode-NodeWebkit} -->
|
|
|
|
|
<!-- ###BEGIN###{ComputerSelector} -->
|
|
|
|
|
<div style='padding:8px'>
|
|
|
|
|
@@ -1557,9 +1557,9 @@
|
|
|
|
|
<div style=height:26px>
|
|
|
|
|
<select id="idx_d24Command" style="float:right;width:200px" onchange=showAdvPowerDlgChange()>
|
|
|
|
|
<option value=2>Power up</option>
|
|
|
|
|
<option value=10>Reset</option>
|
|
|
|
|
<option value=5>Power cycle</option>
|
|
|
|
|
<option value=8>Power down</option>
|
|
|
|
|
<option value=10>Reset</option>
|
|
|
|
|
<option id="d24p500" value=500>OS Wake from Standby</option>
|
|
|
|
|
<option id="d24p501" value=501>OS Power Saving</option>
|
|
|
|
|
<option value=999>Set boot options</option>
|
|
|
|
|
@@ -1588,14 +1588,18 @@
|
|
|
|
|
<div style=height:26px>
|
|
|
|
|
<select id="idx_d24ForceBootDevice" style="float:right;width:200px" onchange=showAdvPowerDlgChange()>
|
|
|
|
|
<option value=0>None</option>
|
|
|
|
|
<option value=1>Force CD/DVD Boot</option>
|
|
|
|
|
<option value=2>Force PXE Boot</option>
|
|
|
|
|
<option value=3>Force Hard Disk Boot</option>
|
|
|
|
|
<option value=4>Force Diagnostic Boot</option>
|
|
|
|
|
<option id="ForceDVDBootOption" value=1>Force CD/DVD Boot</option>
|
|
|
|
|
<option id="ForcePXEBootOption" value=2>Force PXE Boot</option>
|
|
|
|
|
<option id="ForceHDBootOption" value=3>Force Hard Disk Boot</option>
|
|
|
|
|
<option id="ForceDiagBootOption" value=4>Force Diagnostic Boot</option>
|
|
|
|
|
<!-- ###BEGIN###{PowerControl-OneClick} -->
|
|
|
|
|
<option id="ForceUEFIBootOption" value=5>Force OCR UEFI Boot Option</option>
|
|
|
|
|
<option id="ForceHttpBootOption" value=6>Force OCR UEFI HTTPS Boot</option>
|
|
|
|
|
<!-- ###END###{PowerControl-OneClick} -->
|
|
|
|
|
</select>
|
|
|
|
|
<div>Boot Source</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style=height:26px>
|
|
|
|
|
<div id="idx_d24bootSource" style=height:26px>
|
|
|
|
|
<select id="idx_d24BootMediaIndex" style="float:right;width:200px" onchange=showAdvPowerDlgChange()>
|
|
|
|
|
<option value=0>None</option>
|
|
|
|
|
<option value=1>Index 1</option>
|
|
|
|
|
@@ -1603,8 +1607,18 @@
|
|
|
|
|
<option value=3>Index 3</option>
|
|
|
|
|
<option value=3>Index 4</option>
|
|
|
|
|
</select>
|
|
|
|
|
<div>Boot Media Index</div>
|
|
|
|
|
<div>Boot Media</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- ###BEGIN###{PowerControl-OneClick} -->
|
|
|
|
|
<div id="idx_d24customBootSource" style=height:26px;display:none>
|
|
|
|
|
<select id="idx_d24customBootMediaIndex" onchange=showAdvPowerDlgChange() style="float:right;width:200px"></select>
|
|
|
|
|
<div>Boot Media</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="idx_d24diskImage" style=height:26px>
|
|
|
|
|
<input id=idx_d24ocrBootFile type=file onchange=showAdvPowerDlgChange() style="float:right;width:200px" accept=".iso">
|
|
|
|
|
<div>Boot Image</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- ###END###{PowerControl-OneClick} -->
|
|
|
|
|
<div style=height:26px id=idd_d24IDERBootDevice>
|
|
|
|
|
<select id="idx_d24IDERBootDevice" style="float:right;width:200px" onchange=showAdvPowerDlgChange()>
|
|
|
|
|
<option value=0>Boot to floppy</option>
|
|
|
|
|
@@ -2074,12 +2088,15 @@
|
|
|
|
|
|
|
|
|
|
// ###BEGIN###{PowerControl-Advanced}
|
|
|
|
|
// ###BEGIN###{PowerControl-OneClick}
|
|
|
|
|
function setupWebServer() {
|
|
|
|
|
if (webserver != null) return;
|
|
|
|
|
function setupWebServer(leafCN) {
|
|
|
|
|
if ((webserver != null) && (webserver.certCommonName == leafCN)) return;
|
|
|
|
|
|
|
|
|
|
// Stop the web server if present
|
|
|
|
|
if (webserver != null) { webserver.stop(); webserver = null; }
|
|
|
|
|
|
|
|
|
|
// Create a web server to serve One Client Recovery (OCR) disk image files.
|
|
|
|
|
webserver = CreateWebServer();
|
|
|
|
|
webserver.generateCertificate(urlvars['webcn']);
|
|
|
|
|
webserver.generateCertificate(leafCN);
|
|
|
|
|
webserver.start();
|
|
|
|
|
webserver.onTransfers = function (webserver, transfers) {
|
|
|
|
|
var x = '';
|
|
|
|
|
@@ -4800,6 +4817,18 @@
|
|
|
|
|
amtversion = parseInt(v.split('.')[0]);
|
|
|
|
|
amtversionmin = parseInt(v.split('.')[1]);
|
|
|
|
|
|
|
|
|
|
// ###BEGIN###{Mode-NodeWebkit}
|
|
|
|
|
// Perform Intel ME authentication if available.
|
|
|
|
|
/*
|
|
|
|
|
if (amtversion >= 15) {
|
|
|
|
|
var nonce = '12345678901234567890'; // TODO: This is a test nonce, we will need to use a random one.
|
|
|
|
|
stack.AMT_GeneralSettings_AMTAuthenticate(btoa(nonce), function (stack, name, response, status) {
|
|
|
|
|
console.log('Intel AMT Auth', name, response, status);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
// ###END###{Mode-NodeWebkit}
|
|
|
|
|
|
|
|
|
|
// ###BEGIN###{ComputerSelector}
|
|
|
|
|
if (stack.wsman.comm.digestRealm && (currentcomputer['digestrealm'] != stack.wsman.comm.digestRealm)) {
|
|
|
|
|
currentcomputer['digestrealm'] = stack.wsman.comm.digestRealm;
|
|
|
|
|
@@ -5000,7 +5029,12 @@
|
|
|
|
|
|
|
|
|
|
// Sign the key pair using the CA certifiate
|
|
|
|
|
messagebox("TLS Setup", "Creating TLS certificate...");
|
|
|
|
|
var cert = amtcert_signWithCaKey(DERKey, null, { 'CN': currentcomputer['name'], 'O': "None", 'ST': "None", 'C': "None" }, { 'CN': "Untrusted Root Certificate" }, { name: 'extKeyUsage', serverAuth: true });
|
|
|
|
|
|
|
|
|
|
var name = ''
|
|
|
|
|
try { name = amtsysstate['AMT_GeneralSettings'].response['HostName']; } catch (ex) { }
|
|
|
|
|
if ((name == null) || (name == '')) { name = currentcomputer['name']; }
|
|
|
|
|
if ((name == null) || (name == '')) { name = currentcomputer['host']; }
|
|
|
|
|
var cert = amtcert_signWithCaKey(DERKey, null, { 'CN': name, 'O': "None", 'ST': "None", 'C': "None" }, { 'CN': "Untrusted Root Certificate" }, { name: 'extKeyUsage', serverAuth: true });
|
|
|
|
|
if (cert == null) { messagebox("Issue Certificate", "Unable to sign certificate."); return; }
|
|
|
|
|
|
|
|
|
|
// Save cert and cert hash in computer list
|
|
|
|
|
@@ -6180,10 +6214,16 @@
|
|
|
|
|
var xxDragDropCertFiles = null;
|
|
|
|
|
function addCertButton(files) {
|
|
|
|
|
if (xxdialogMode || !xxAccountAdminName) return;
|
|
|
|
|
var x = '<div style=height:10px></div>';
|
|
|
|
|
var x = '<div style=height:10px></div>', op0 = '', op2 = '';
|
|
|
|
|
xxDragDropCertFiles = files;
|
|
|
|
|
// ###BEGIN###{CertificateManager}
|
|
|
|
|
if ((!xxDragDropCertFiles) && (certificateStore.length > 0)) { x += '<div style=height:26px;margin-top:4px><select onchange=addCertButtonUpdate() id=certoptype style=float:right;width:260px><option value=0>' + "Add from certificate manager" + '</option><option value=1>' + "Add from certificate file" + '</option></select><div style=padding-top:4px>' + "Operation" + '</div></div>'; }
|
|
|
|
|
// ###BEGIN###{PowerControl-Advanced}
|
|
|
|
|
// ###BEGIN###{PowerControl-OneClick}
|
|
|
|
|
if (amtversion > 12) { op2 = '<option value=2>' + "MeshCommander Web Server Root" + '</option>'; }
|
|
|
|
|
// ###END###{PowerControl-OneClick}
|
|
|
|
|
// ###END###{PowerControl-Advanced}
|
|
|
|
|
if (certificateStore.length > 0) { op0 += '<option value=0>' + "Add from certificate manager" + '</option>'; }
|
|
|
|
|
if ((!xxDragDropCertFiles) && ((op0 != '') || (op2 != ''))) { x += '<div style=height:26px;margin-top:4px><select onchange=addCertButtonUpdate() id=certoptype style=float:right;width:260px>' + op0 + '<option value=1>' + "Add from certificate file" + '</option>' + op2 + '</select><div style=padding-top:4px>' + "Operation" + '</div></div>'; }
|
|
|
|
|
x += '<div id=dxcertfileop1>';
|
|
|
|
|
var input = '<input id=certopen onchange=addCertButtonUpdate() type=file style=float:right;width:260px accept=".crt,.cer,.pem">';
|
|
|
|
|
if (xxDragDropCertFiles) { input = '<input style=float:right;width:260px readonly disabled value="' + xxDragDropCertFiles[0].name + '">'; }
|
|
|
|
|
@@ -6202,7 +6242,7 @@
|
|
|
|
|
if (xxDragDropCertFiles) { input = '<input style=float:right;width:260px readonly disabled value="' + xxDragDropCertFiles[0].name + '">'; }
|
|
|
|
|
x += '<div style=height:26px;margin-top:4px>' + input + '<div style=padding-top:4px>' + "Certificate file" + '</div></div>';
|
|
|
|
|
// ###END###{!CertificateManager}
|
|
|
|
|
x += '<div style=height:26px;margin-top:4px><select id=certtype style=float:right;width:260px><option value=0>' + "Chain Certificate" + '</option><option value=1>' + "Trusted Root Certificate" + '</option></select><div style=padding-top:4px>' + "Certificate type" + '</div></div>';
|
|
|
|
|
x += '<div style=height:26px;margin-top:4px><select id=certtype style=float:right;width:260px><option value=1>' + "Trusted Root Certificate" + '</option><option value=0>' + "Chain Certificate" + '</option></select><div style=padding-top:4px>' + "Certificate type" + '</div></div>';
|
|
|
|
|
setDialogMode(11, "Add Certificate", 3, addCertButtonOk, x);
|
|
|
|
|
addCertButtonUpdate();
|
|
|
|
|
}
|
|
|
|
|
@@ -6216,11 +6256,41 @@
|
|
|
|
|
}
|
|
|
|
|
// ###END###{CertificateManager}
|
|
|
|
|
var certopen = getInputElement('certopen');
|
|
|
|
|
QE('idx_dlgOkButton', !certopen || certopen.files.length == 1);
|
|
|
|
|
QE('idx_dlgOkButton', !certopen || (certopen.files.length == 1) || (Q('certoptype').value == 2));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function addCertButtonOk() {
|
|
|
|
|
// ###BEGIN###{CertificateManager}
|
|
|
|
|
// ###BEGIN###{PowerControl-Advanced}
|
|
|
|
|
// ###BEGIN###{PowerControl-OneClick}
|
|
|
|
|
if (Q('certoptype').value == 2) {
|
|
|
|
|
var certbin = null;
|
|
|
|
|
if (webserver == null) {
|
|
|
|
|
webserver = CreateWebServer();
|
|
|
|
|
webserver.generateCertificate(0);
|
|
|
|
|
certbin = webserver.rootCert;
|
|
|
|
|
webserver = null;
|
|
|
|
|
} else {
|
|
|
|
|
certbin = webserver.rootCert;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// This is a .PEM file, keep everything between BEGIN/END, clean it up and use as-is. It's already Base64.
|
|
|
|
|
var i = certbin.indexOf('-----BEGIN CERTIFICATE-----');
|
|
|
|
|
if (i >= 0) {
|
|
|
|
|
certbin = certbin.substring(i + 27);
|
|
|
|
|
i = certbin.indexOf('-----END CERTIFICATE-----');
|
|
|
|
|
if (i >= 0) certbin = certbin.substring(0, i)
|
|
|
|
|
certbin = certbin.replace(/\r\n/g, '');
|
|
|
|
|
if (getSelectElement('certtype').value == 1) {
|
|
|
|
|
amtstack.AMT_PublicKeyManagementService_AddTrustedRootCertificate(certbin, certificateAdded);
|
|
|
|
|
} else {
|
|
|
|
|
amtstack.AMT_PublicKeyManagementService_AddCertificate(certbin, certificateAdded);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// ###END###{PowerControl-OneClick}
|
|
|
|
|
// ###END###{PowerControl-Advanced}
|
|
|
|
|
if ((xxDragDropCertFiles) || (certificateStore.length == 0) || (Q('certoptype').value == 1)) {
|
|
|
|
|
var certopen = getInputElement('certopen');
|
|
|
|
|
var files = xxDragDropCertFiles;
|
|
|
|
|
@@ -6830,6 +6900,7 @@
|
|
|
|
|
xxSystemDefense = responses;
|
|
|
|
|
updateSystemDefense();
|
|
|
|
|
QV('go18', true); // Show System Defense Panel
|
|
|
|
|
if (urlvars['norefresh']) { UpdateDefenseStats(); } // If norefresh is set, pull the system defense stats now.
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -6919,9 +6990,11 @@
|
|
|
|
|
QH('id_TableSystemDefense', x);
|
|
|
|
|
|
|
|
|
|
if (xxFilterStatisticsTimer == null) {
|
|
|
|
|
UpdateDefenseStats();
|
|
|
|
|
xxFilterStatisticsTimerActive = false;
|
|
|
|
|
if (!urlvars['norefresh']) { xxFilterStatisticsTimer = setInterval(UpdateDefenseStats, 5000); }
|
|
|
|
|
if (!urlvars['norefresh']) {
|
|
|
|
|
UpdateDefenseStats();
|
|
|
|
|
xxFilterStatisticsTimer = setInterval(UpdateDefenseStats, 5000);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -9875,17 +9948,24 @@
|
|
|
|
|
|
|
|
|
|
function powerActionResponse00(stack, name, response, status) {
|
|
|
|
|
if (status == 200) {
|
|
|
|
|
var powerState = 3;
|
|
|
|
|
try {
|
|
|
|
|
var x = amtsysstate['CIM_ServiceAvailableToElement'].responses[0]['PowerState'];
|
|
|
|
|
if (x == 2) { powerState = 1; } else { powerState = 2; }
|
|
|
|
|
} catch (ex) { }
|
|
|
|
|
amtPowerBootCapabilities = response.Body;
|
|
|
|
|
QH('d5actionSelect', '');
|
|
|
|
|
addOption('d5actionSelect', "Power up", 2);
|
|
|
|
|
if (powerState & 2) { addOption('d5actionSelect', "Power up", 2); }
|
|
|
|
|
if (powerState & 1) {
|
|
|
|
|
addOption('d5actionSelect', "Reset", 10);
|
|
|
|
|
addOption('d5actionSelect', "Power cycle", 5);
|
|
|
|
|
addOption('d5actionSelect', "Power down", 8);
|
|
|
|
|
addOption('d5actionSelect', "Reset", 10);
|
|
|
|
|
if (amtPowerBootCapabilities['ForceDiagnosticBoot'] == true) {
|
|
|
|
|
addOption('d5actionSelect', "Power on to diagnostic", 300);
|
|
|
|
|
addOption('d5actionSelect', "Reset to diagnostic", 301);
|
|
|
|
|
}
|
|
|
|
|
if (amtversion > 9) {
|
|
|
|
|
if (amtPowerBootCapabilities['ForceDiagnosticBoot'] == true) {
|
|
|
|
|
if (powerState & 2) { addOption('d5actionSelect', "Power on to diagnostic", 300); }
|
|
|
|
|
if (powerState & 1) { addOption('d5actionSelect', "Reset to diagnostic", 301); }
|
|
|
|
|
}
|
|
|
|
|
if ((amtversion > 9) && (powerState & 1)) {
|
|
|
|
|
addOption('d5actionSelect', "OS Wake from Standby", 500);
|
|
|
|
|
addOption('d5actionSelect', "OS Power Saving", 501);
|
|
|
|
|
addOption('d5actionSelect', "Soft-off", 12);
|
|
|
|
|
@@ -9894,26 +9974,26 @@
|
|
|
|
|
addOption('d5actionSelect', "Hibernate", 7);
|
|
|
|
|
}
|
|
|
|
|
if (amtPowerBootCapabilities['BIOSSetup'] == true) {
|
|
|
|
|
addOption('d5actionSelect', "Power up to BIOS", 100);
|
|
|
|
|
addOption('d5actionSelect', "Reset to BIOS", 101);
|
|
|
|
|
if (powerState & 2) { addOption('d5actionSelect', "Power up to BIOS", 100); }
|
|
|
|
|
if (powerState & 1) { addOption('d5actionSelect', "Reset to BIOS", 101); }
|
|
|
|
|
}
|
|
|
|
|
if (amtPowerBootCapabilities['SecureErase'] == true) {
|
|
|
|
|
addOption('d5actionSelect', "Power up to Secure Erase", 104);
|
|
|
|
|
addOption('d5actionSelect', "Reset to Secure Erase", 105);
|
|
|
|
|
if (powerState & 2) { addOption('d5actionSelect', "Power up to Secure Erase", 104); }
|
|
|
|
|
if (powerState & 1) { addOption('d5actionSelect', "Reset to Secure Erase", 105); }
|
|
|
|
|
}
|
|
|
|
|
// ###BEGIN###{IDER}
|
|
|
|
|
addOption('d5actionSelect', "Reset to IDE-R Floppy", 200);
|
|
|
|
|
addOption('d5actionSelect', "Power on to IDE-R Floppy", 201);
|
|
|
|
|
addOption('d5actionSelect', "Reset to IDE-R CDROM", 202);
|
|
|
|
|
addOption('d5actionSelect', "Power on to IDE-R CDROM", 203);
|
|
|
|
|
if (powerState & 1) { addOption('d5actionSelect', "Reset to IDE-R Floppy", 200); }
|
|
|
|
|
if (powerState & 2) { addOption('d5actionSelect', "Power on to IDE-R Floppy", 201); }
|
|
|
|
|
if (powerState & 1) { addOption('d5actionSelect', "Reset to IDE-R CDROM", 202); }
|
|
|
|
|
if (powerState & 2) { addOption('d5actionSelect', "Power on to IDE-R CDROM", 203); }
|
|
|
|
|
// ###END###{IDER}
|
|
|
|
|
addOption('d5actionSelect', "Reset to PXE", 400);
|
|
|
|
|
addOption('d5actionSelect', "Power on to PXE", 401);
|
|
|
|
|
if (powerState & 1) { addOption('d5actionSelect', "Reset to PXE", 400); }
|
|
|
|
|
if (powerState & 2) { addOption('d5actionSelect', "Power on to PXE", 401); }
|
|
|
|
|
// ###BEGIN###{PowerControl-Advanced}
|
|
|
|
|
// ###BEGIN###{PowerControl-OneClick}
|
|
|
|
|
if (amtPowerBootCapabilities['ForceUEFIHTTPSBoot'] === true) {
|
|
|
|
|
addOption('d5actionSelect', "Reset to HTTPS Boot", 600);
|
|
|
|
|
addOption('d5actionSelect', "Power on to HTTPS Boot", 601);
|
|
|
|
|
if (powerState & 1) { addOption('d5actionSelect', "Reset to HTTPS Boot", 600); }
|
|
|
|
|
if (powerState & 2) { addOption('d5actionSelect', "Power on to HTTPS Boot", 601); }
|
|
|
|
|
}
|
|
|
|
|
// ###END###{PowerControl-OneClick}
|
|
|
|
|
addOption('d5actionSelect', "Custom action...", 999);
|
|
|
|
|
@@ -9932,16 +10012,22 @@
|
|
|
|
|
// ###END###{PowerControl-Advanced}
|
|
|
|
|
|
|
|
|
|
function powerActionDlgCheck() {
|
|
|
|
|
AmtOcrPba = null;
|
|
|
|
|
AmtOcrPbaLength = 0;
|
|
|
|
|
var action = d5actionSelect.value;
|
|
|
|
|
|
|
|
|
|
// ###BEGIN###{PowerControl-Advanced}
|
|
|
|
|
// ###BEGIN###{PowerControl-OneClick}
|
|
|
|
|
if ((action == 600) || (action == 601)) {
|
|
|
|
|
// ###BEGIN###{Mode-NodeWebkit}
|
|
|
|
|
// If the connection to intel AMT is not TLS, warn and exit now.
|
|
|
|
|
if (wsstack.comm.xtlsCertificate == null) { messagebox("Power Action", "This feature requires a TLS connection to Intel AMT"); return; }
|
|
|
|
|
// ###END###{Mode-NodeWebkit}
|
|
|
|
|
var x = "Select a disk image for remote boot." + '<br /><br /><input id=ocrfile type=file onchange=oneClickFileSelect() accept=".iso">';
|
|
|
|
|
setDialogMode(11, "HTTPS Boot", 3, function () {
|
|
|
|
|
var files = Q('ocrfile').files;
|
|
|
|
|
if (files.length != 1) return;
|
|
|
|
|
setupWebServer();
|
|
|
|
|
setupWebServer(urlvars['webcn'] ? urlvars['webcn'] : wsstack.comm.localAddress);
|
|
|
|
|
webserver.setupBootImage(files[0].path, (urlvars['webcn'] ? urlvars['webcn'] : wsstack.comm.localAddress));
|
|
|
|
|
powerActionDlg();
|
|
|
|
|
}, x);
|
|
|
|
|
@@ -9967,11 +10053,38 @@
|
|
|
|
|
// ###END###{Mode-NodeWebkit}
|
|
|
|
|
rsepass = 1;
|
|
|
|
|
setDialogMode(11, "Power Actions", 3, powerActionDlg, x);
|
|
|
|
|
// ###BEGIN###{PowerControl-OneClick}
|
|
|
|
|
} else if ((action == 999) && (amtversion >= 15)) {
|
|
|
|
|
statusbox("Power Actions", "Checking boot sources...");
|
|
|
|
|
amtstack.BatchEnum('', ['CIM_BootSourceSetting'], powerActionDlgCheck00, true);
|
|
|
|
|
// ###END###{PowerControl-OneClick}
|
|
|
|
|
} else {
|
|
|
|
|
powerActionDlg();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ###BEGIN###{PowerControl-OneClick}
|
|
|
|
|
var AmtOcrPba = null;
|
|
|
|
|
var AmtOcrPbaLength = 0;
|
|
|
|
|
function powerActionDlgCheck00(stack, name, response, status) {
|
|
|
|
|
if (status != 200) { messagebox("Power Action", format("GET CIM_BootSourceSetting, Error #{0}", status) + ((response.Header && response.Header.WsmanError) ? (', ' + response.Header.WsmanError) : '')); return; }
|
|
|
|
|
var bootSources = response.CIM_BootSourceSetting.responses;
|
|
|
|
|
AmtOcrPba = {};
|
|
|
|
|
for (var i = 0; i < bootSources.length; i++) {
|
|
|
|
|
var instanceid = bootSources[i]['InstanceID'];
|
|
|
|
|
if ((instanceid != null) && instanceid.toString().startsWith('Intel(r) AMT: Force OCR UEFI Boot')) {
|
|
|
|
|
try {
|
|
|
|
|
var arr = instanceid.trim().split(' ');
|
|
|
|
|
idx = parseInt(arr[arr.length - 1]);
|
|
|
|
|
AmtOcrPba[parseInt(idx)] = { instance: bootSources[i]['BIOSBootString'], bootstr: bootSources[i]['BootString'] };
|
|
|
|
|
AmtOcrPbaLength++;
|
|
|
|
|
} catch (e) { }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
powerActionDlg();
|
|
|
|
|
}
|
|
|
|
|
// ###END###{PowerControl-OneClick}
|
|
|
|
|
|
|
|
|
|
function powerActionDlg() {
|
|
|
|
|
//if (amtversion == 0) return;
|
|
|
|
|
//if (amtversion > 6) { amtstack.Get('IPS_OptInService', powerActionResponse0); } else { amtstack.Get('AMT_BootSettingData', powerActionResponse1); }
|
|
|
|
|
@@ -10014,16 +10127,29 @@
|
|
|
|
|
// ###BEGIN###{PowerControl-Advanced}
|
|
|
|
|
var AvdPowerDlg;
|
|
|
|
|
function showAdvPowerDlg() {
|
|
|
|
|
try { Q('idx_d24Command').value = (amtsysstate['CIM_ServiceAvailableToElement'].responses[0]['PowerState'] == 2)?10:2; } catch (ex) { }
|
|
|
|
|
|
|
|
|
|
// Show boot capabilities
|
|
|
|
|
QV('d24dBiosPause', amtPowerBootCapabilities['BIOSPause'] == true);
|
|
|
|
|
QV('d24dBiosSecureBoot', amtPowerBootCapabilities['BIOSSecureBoot'] == true);
|
|
|
|
|
QV('d24dReflashBios', amtPowerBootCapabilities['BIOSReflash'] == true);
|
|
|
|
|
QV('d24dBiosSetup', amtPowerBootCapabilities['BIOSSetup'] == true);
|
|
|
|
|
// QV('', amtPowerBootCapabilities['ForceCDorDVDBoot'] == true);
|
|
|
|
|
// QV('', amtPowerBootCapabilities['ForceDiagnosticBoot'] == true);
|
|
|
|
|
// QV('', amtPowerBootCapabilities['ForceHardDriveBoot'] == true);
|
|
|
|
|
// QV('', amtPowerBootCapabilities['ForceHardDriveSafeModeBoot'] == true);
|
|
|
|
|
// QV('', amtPowerBootCapabilities['ForcePXEBoot'] == true);
|
|
|
|
|
QV('ForceDVDBootOption', amtPowerBootCapabilities['ForceCDorDVDBoot'] == true);
|
|
|
|
|
QV('ForceDiagBootOption', amtPowerBootCapabilities['ForceDiagnosticBoot'] == true);
|
|
|
|
|
QV('ForceHDBootOption', amtPowerBootCapabilities['ForceHardDriveBoot'] == true);
|
|
|
|
|
//QV('', amtPowerBootCapabilities['ForceHardDriveSafeModeBoot'] == true);
|
|
|
|
|
//QV('', amtPowerBootCapabilities['ForceWinREBoot'] == true);
|
|
|
|
|
QV('ForcePXEBootOption', amtPowerBootCapabilities['ForcePXEBoot'] == true);
|
|
|
|
|
// ###BEGIN###{PowerControl-OneClick}
|
|
|
|
|
QV('ForceUEFIBootOption', false);
|
|
|
|
|
if ((AmtOcrPbaLength > 0) && (amtPowerBootCapabilities['ForceUEFIPBABoot'] == true)) {
|
|
|
|
|
QV('ForceUEFIBootOption', true);
|
|
|
|
|
var x = '';
|
|
|
|
|
for (var i in AmtOcrPba) { x += '<option value=' + i + '>' + AmtOcrPba[i].instance + '</option>'; }
|
|
|
|
|
QH('idx_d24customBootMediaIndex', x);
|
|
|
|
|
}
|
|
|
|
|
QV('ForceHttpBootOption', amtPowerBootCapabilities['ForceUEFIHTTPSBoot'] == true);
|
|
|
|
|
// ###END###{PowerControl-OneClick}
|
|
|
|
|
QV('d24dForceProgressEvents', amtPowerBootCapabilities['ForcedProgressEvents'] == true);
|
|
|
|
|
QV('d24dUseIDER', amtPowerBootCapabilities['IDER'] == true);
|
|
|
|
|
QV('d24dLockKeyboard', amtPowerBootCapabilities['KeyboardLock'] == true);
|
|
|
|
|
@@ -10044,6 +10170,7 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function showAdvPowerDlgChange() {
|
|
|
|
|
var ok = true;
|
|
|
|
|
QV('idd_d24IDERBootDevice', Q('d24UseIDER').checked);
|
|
|
|
|
QV('idd_d24RSEPass', Q('d24SecureErase') ? Q('d24SecureErase').checked : false);
|
|
|
|
|
// ###BEGIN###{Mode-NodeWebkit}
|
|
|
|
|
@@ -10059,16 +10186,38 @@
|
|
|
|
|
QE('idd_d24RSEPass', !ospower);
|
|
|
|
|
|
|
|
|
|
// If the boot source is not "None" (0), disable all boot settings.
|
|
|
|
|
var bootSettingOpts = ['d24BiosPause', 'd24BiosSecureBoot', 'd24BiosSetup', 'd24ForceProgressEvents', 'd24LockPowerButton', 'd24LockResetButton', 'd24LockSleepButton', 'd24LockKeyboard', 'd24UserPasswordBypass', 'd24ReflashBios', 'd24SafeMode', 'd24UseIDER', 'd24SerialOverLan', 'd24SecureErase'];
|
|
|
|
|
if (idx_d24ForceBootDevice.value > 0) {
|
|
|
|
|
for (var i in bootSettingOpts) {
|
|
|
|
|
Q(bootSettingOpts[i]).checked = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (var i in bootSettingOpts) { QE(bootSettingOpts[i], idx_d24ForceBootDevice.value == 0); }
|
|
|
|
|
//var bootSettingOpts = ['d24BiosPause', 'd24BiosSecureBoot', 'd24BiosSetup', 'd24ForceProgressEvents', 'd24LockPowerButton', 'd24LockResetButton', 'd24LockSleepButton', 'd24LockKeyboard', 'd24UserPasswordBypass', 'd24ReflashBios', 'd24SafeMode', 'd24UseIDER', 'd24SerialOverLan', 'd24SecureErase'];
|
|
|
|
|
//if ((idx_d24ForceBootDevice.value > 0) && (idx_d24ForceBootDevice.value < 5)) { for (var i in bootSettingOpts) { Q(bootSettingOpts[i]).checked = false; } }
|
|
|
|
|
//for (var i in bootSettingOpts) { QE(bootSettingOpts[i], idx_d24ForceBootDevice.value == 0); }
|
|
|
|
|
|
|
|
|
|
// ###BEGIN###{PowerControl-OneClick}
|
|
|
|
|
var bootSourceIndex = Q('idx_d24ForceBootDevice').value;
|
|
|
|
|
QV('idx_d24bootSource', bootSourceIndex < 5);
|
|
|
|
|
QV('idx_d24customBootSource', bootSourceIndex == 5)
|
|
|
|
|
QV('idx_d24diskImage', bootSourceIndex == 6);
|
|
|
|
|
if ((bootSourceIndex == 6) && (Q('idx_d24ocrBootFile').files.length != 1)) { ok = false; }
|
|
|
|
|
// console.log(AmtOcrPbaLength, AmtOcrPba);
|
|
|
|
|
// ###END###{PowerControl-OneClick}
|
|
|
|
|
|
|
|
|
|
QE('idx_dlgOkButton', ok);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function showAdvPowerDlgOk() {
|
|
|
|
|
// ###BEGIN###{PowerControl-OneClick}
|
|
|
|
|
var forceBootSelection = Q('idx_d24ForceBootDevice').value;
|
|
|
|
|
// ###BEGIN###{Mode-NodeWebkit}
|
|
|
|
|
if (((forceBootSelection == 5) || (forceBootSelection == 6)) && (wsstack.comm.xtlsCertificate == null)) {
|
|
|
|
|
messagebox("Power Action", "This feature requires a TLS connection to Intel AMT"); return;
|
|
|
|
|
}
|
|
|
|
|
// ###END###{Mode-NodeWebkit}
|
|
|
|
|
if (forceBootSelection == 6) {
|
|
|
|
|
var files = Q('idx_d24ocrBootFile').files;
|
|
|
|
|
if (files.length != 1) return;
|
|
|
|
|
setupWebServer(urlvars['webcn'] ? urlvars['webcn'] : wsstack.comm.localAddress);
|
|
|
|
|
webserver.setupBootImage(files[0].path, (urlvars['webcn'] ? urlvars['webcn'] : wsstack.comm.localAddress));
|
|
|
|
|
}
|
|
|
|
|
// ###END###{PowerControl-OneClick}
|
|
|
|
|
|
|
|
|
|
var action = Q('idx_d24Command').value;
|
|
|
|
|
if ((action == 500) || (action == 501)) {
|
|
|
|
|
// Perform OS wake from standby or OS sleep (Intel AMT 10+)
|
|
|
|
|
@@ -10248,12 +10397,31 @@
|
|
|
|
|
// ###BEGIN###{PowerControl-Advanced}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Remove read-only parameters
|
|
|
|
|
delete r['WinREBootEnabled'];
|
|
|
|
|
delete r['UEFILocalPBABootEnabled'];
|
|
|
|
|
delete r['UEFIHTTPSBootEnabled'];
|
|
|
|
|
delete r['SecureBootControlEnabled'];
|
|
|
|
|
delete r['BootguardStatus'];
|
|
|
|
|
delete r['OptionsCleared'];
|
|
|
|
|
delete r['BIOSLastStatus'];
|
|
|
|
|
delete r['UefiBootParametersArray'];
|
|
|
|
|
if (r['UefiBootNumberOfParams'] != null) r['UefiBootNumberOfParams'] = 0;
|
|
|
|
|
|
|
|
|
|
//r['EnforceSecureBoot'] = true;
|
|
|
|
|
|
|
|
|
|
// ###BEGIN###{PowerControl-OneClick}
|
|
|
|
|
// Add OCR TLV parameters if firmware supports OCR and Force HTTPS Boot is requested
|
|
|
|
|
if ((action == 600) || (action == 601)) { // Force UEFI HTTPS Boot
|
|
|
|
|
if ((action == 600) || (action == 601) || ((action == 999) && (Q('idx_d24ForceBootDevice').value == 6))) { // Force UEFI HTTPS Boot
|
|
|
|
|
r['UefiBootParametersArray'] = webserver.lastBootImageArgs.args;
|
|
|
|
|
r['UefiBootNumberOfParams'] = webserver.lastBootImageArgs.argscount;
|
|
|
|
|
r['BootMediaIndex'] = 0; // Do not use boot media index for One Click Recovery (OCR)
|
|
|
|
|
} else if ((action == 999) && (Q('idx_d24ForceBootDevice').value == 5)) {
|
|
|
|
|
var bootstr = AmtOcrPba[Q('idx_d24customBootMediaIndex').value].bootstr;
|
|
|
|
|
console.log('OCR BootStr: ' + bootstr);
|
|
|
|
|
r['UefiBootParametersArray'] = btoa(makeUefiBootParam(2, bootstr) + makeUefiBootParam(3, bootstr.length, 2)); // EFI_DEVICE_PATH (2) + EFI_DEVICE_PATH-LENGTH (3)
|
|
|
|
|
r['UefiBootNumberOfParams'] = 2;
|
|
|
|
|
r['BootMediaIndex'] = 0; // Do not use boot media index for One Click Recovery (OCR)
|
|
|
|
|
}
|
|
|
|
|
// ###END###{PowerControl-OneClick}
|
|
|
|
|
// ###END###{PowerControl-Advanced}
|
|
|
|
|
@@ -10262,12 +10430,17 @@
|
|
|
|
|
console.log("Boot Action: " + action);
|
|
|
|
|
console.log("Setting Boot Settings: " + ObjectToString2(r));
|
|
|
|
|
statusbox("Power Action", "Setting boot settings...");
|
|
|
|
|
|
|
|
|
|
// Set the boot order to null, this is needed for some AMT versions that don't clear this automatically.
|
|
|
|
|
amtstack.CIM_BootConfigSetting_ChangeBootOrder(null, function (stack, name, response, status) {
|
|
|
|
|
if (status != 200) { messagebox("Power Action", format("PUT CIM_BootConfigSetting_ChangeBootOrder, Error #{0}", status) + ((response.Header && response.Header.WsmanError) ? (', ' + response.Header.WsmanError) : '')); return; }
|
|
|
|
|
amtstack.Put('AMT_BootSettingData', r, powerActionResponse2, 0, 1);
|
|
|
|
|
}, 0, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function powerActionResponse2(stack, name, response, status, tag) {
|
|
|
|
|
//console.log("powerActionResponse2(" + name + "," + response + "," + status + ")");
|
|
|
|
|
if (status != 200) { messagebox("Power Action", format("PUT AMT_BootSettingData, Error #{0}", status)); console.log(tag); return; }
|
|
|
|
|
if (status != 200) { messagebox("Power Action", format("PUT AMT_BootSettingData, Error #{0}", status) + ((response.Header && response.Header.WsmanError) ? (', ' + response.Header.WsmanError) : '')); return; }
|
|
|
|
|
//if (status == 408) { messagebox("Power Action", "Access denied."); return; }
|
|
|
|
|
//if (errcheck(status, stack)) return;
|
|
|
|
|
//console.log("Setup next boot...");
|
|
|
|
|
@@ -10284,14 +10457,17 @@
|
|
|
|
|
if (idx_d24ForceBootDevice.value > 0) { bootSource = ['Force CD/DVD Boot', 'Force PXE Boot', 'Force Hard-drive Boot', 'Force Diagnostic Boot'][idx_d24ForceBootDevice.value - 1]; }
|
|
|
|
|
// ###END###{!PowerControl-OneClick}
|
|
|
|
|
// ###BEGIN###{PowerControl-OneClick}
|
|
|
|
|
if (idx_d24ForceBootDevice.value > 0) { bootSource = ['Force CD/DVD Boot', 'Force PXE Boot', 'Force Hard-drive Boot', 'Force Diagnostic Boot', 'Force OCR UEFI Boot Option ' + Q('idx_d24BootMediaIndex').value, 'Force OCR UEFI HTTPS Boot'][idx_d24ForceBootDevice.value - 1]; }
|
|
|
|
|
if (idx_d24ForceBootDevice.value > 0) { bootSource = ['Force CD/DVD Boot', 'Force PXE Boot', 'Force Hard-drive Boot', 'Force Diagnostic Boot', 'Force OCR UEFI Boot Option ' + Q('idx_d24customBootMediaIndex').value, 'Force OCR UEFI HTTPS Boot'][idx_d24ForceBootDevice.value - 1]; }
|
|
|
|
|
// ###END###{PowerControl-OneClick}
|
|
|
|
|
} else {
|
|
|
|
|
// ###END###{PowerControl-Advanced}
|
|
|
|
|
if (action == 300 || action == 301) { bootSource = 'Force Diagnostic Boot'; }
|
|
|
|
|
if (action == 400 || action == 401) { bootSource = 'Force PXE Boot'; }
|
|
|
|
|
// ###BEGIN###{PowerControl-Advanced}
|
|
|
|
|
if (action == 600 || action == 601) { bootSource = 'Force OCR UEFI HTTPS Boot'; }
|
|
|
|
|
if (action == 600 || action == 601) {
|
|
|
|
|
|
|
|
|
|
bootSource = 'Force OCR UEFI HTTPS Boot';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Resetting Force boot data in case it was changed so that it won't be used on the next power action
|
|
|
|
|
|