(exitBtn, forced)
| 1079 | * @param {boolean} [forced] forced shutdown |
| 1080 | */ |
| 1081 | const ShutdownComputer = (exitBtn, forced) => { |
| 1082 | Load(true, forced ? GetLocale("os_shutdown_forced") : GetLocale("os_shuttingdown"), 1500, () => { |
| 1083 | document.body.style.display = "none"; |
| 1084 | Load(false); |
| 1085 | fetch(`https://${GetParentResourceName()}/exit`, |
| 1086 | { |
| 1087 | method: "POST", |
| 1088 | body: null |
| 1089 | }); |
| 1090 | }); |
| 1091 | openedApps.forEach(appName => CloseApp(appName)); |
| 1092 | openedApps = []; |
| 1093 | |
| 1094 | if (exitBtn) |
| 1095 | exitBtn.removeAttribute("validation"); |
| 1096 | |
| 1097 | apps.forEach(app => { |
| 1098 | let appElement = document.getElementById("app-"+app); |
| 1099 | appElement.style.top = "25%"; |
| 1100 | appElement.style.left = "25%"; |
| 1101 | |
| 1102 | let appTextElement = document.getElementById(app+"-text"); |
| 1103 | if (appTextElement) { |
| 1104 | appTextElement.innerHTML = ""; |
| 1105 | } |
| 1106 | }); |
| 1107 | } |
| 1108 | |
| 1109 | /** |
| 1110 | * Edit theme |
no test coverage detected