|
Server : Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 System : Windows NT SERVER-PC 10.0 build 26200 (Windows 11) AMD64 User : ServerPC ( 0) PHP Version : 8.2.12 Disable Function : NONE Directory : C:/Windows/SystemApps/Microsoft.Windows.CloudExperienceHost_cw5n1h2txyewy/core/js/ |
Upload File : |
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
}
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) {
}
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();
});