| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Windows/SystemApps/Microsoft.Windows.CloudExperienceHost_cw5n1h2txyewy/core/js/ |
Upload File : |
//
// Copyright (C) Microsoft. All rights reserved.
//
define([], () => {
function normalizePromise(promise) {
return new WinJS.Promise((resolve, reject) => {
Promise.resolve(promise).then(resolve, reject);
});
}
class AutopilotModule {
constructor() {
this.autopilotManager = null;
}
isAutopilotEnabledAsync() {
return normalizePromise(
EnterpriseDeviceManagement.Service.AutoPilot.AutoPilotUtilStatics.isLocalProfileAvailableAsync()
.then(isProfileAvailable => isProfileAvailable, () => false)
);
}
shouldSkipAutoPilotUpdateAsync() {
return normalizePromise((async () => {
try {
if (await this.isAutopilotEnabledAsync()) {
const isUpdateDisabled = (await EnterpriseDeviceManagement.Service.AutoPilot.AutoPilotUtilStatics.getDwordPolicyAsync("CloudAssignedAutopilotUpdateDisabled") === 1);
await CloudExperienceHost.Telemetry.logEvent(isUpdateDisabled ? "AutoPilot_ShouldSkipAutoPilotUpdate_SkippingBecauseDisabled" : "AutoPilot_ShouldSkipAutoPilotUpdate_NoSkippingBecauseEnabled");
return isUpdateDisabled; // return we should skip if update is explicitly disabled
}
// Skip when no AP enabled
return true;
} catch (err) {
CloudExperienceHost.Telemetry.logEvent("Autopilot_AutoPilotUpdatePage_GetShouldSkipOptOutAsyncFailed", JSON.stringify({ error: err }));
return true;
}
})());
}
getAutopilotUpdateTimeoutAsync() {
const DefaultTimeoutMS = 1800000; // 1000 * 60 * 30 = 30m
return normalizePromise((async () => {
const isApEnabled = await this.isAutopilotEnabledAsync();
if (!isApEnabled) {
// not now: throw new Error("Autopilot not enabled");
}
const timeoutDuration = await this.getAutopilotManager().getDwordPolicyAsync("AutopilotUpdateTimeout");
return (timeoutDuration === 0 ? DefaultTimeoutMS : timeoutDuration);
})());
}
performAutopilotUpdateWithProgressAsync() {
return normalizePromise(this.getAutopilotManager().performAutopilotUpdateWithProgressAsync());
}
getAutopilotManager() {
if (!this.autopilotManager) {
this.autopilotManager = new EnterpriseDeviceManagement.Service.AutoPilot.AutoPilotServer();
}
return this.autopilotManager;
}
}
return new AutopilotModule();
});