Vanessa 2023-09-04 09:31:08 +08:00
parent a093759231
commit 9333f52edd

View file

@ -67,13 +67,13 @@ export const about = {
<svg><use xlink:href="#iconLock"></use></svg>${window.siyuan.languages.config}
</button>
</label>
<label class="b3-label fn__flex${window.siyuan.config.accessAuthCode ? "" : " fn__none"}">
<label class="b3-label fn__flex${!window.siyuan.config.accessAuthCode || isBrowser() ? " fn__none" : ""}">
<div class="fn__flex-1">
${window.siyuan.languages.about7}
<div class="b3-label__text">${window.siyuan.languages.about8}</div>
</div>
<div class="fn__space"></div>
<input class="b3-switch fn__flex-center" id="lockScreenMode" type="checkbox"${window.siyuan.config.system.lockScreenMode === 0 ? " checked" : ""}>
<input class="b3-switch fn__flex-center" id="lockScreenMode" type="checkbox"${window.siyuan.config.system.lockScreenMode === 1 ? " checked" : ""}>
</label>
</div>
<label class="b3-label config__item${isBrowser() ? " fn__none" : " fn__flex"}">
@ -310,6 +310,10 @@ export const about = {
});
});
});
const lockScreenModeElement = about.element.querySelector("#lockScreenMode") as HTMLInputElement;
lockScreenModeElement.addEventListener("change", () => {
fetchPost("/api/system/setFollowSystemLockScreen", {lockScreenMode: lockScreenModeElement.checked ? 1 : 0});
});
const googleAnalyticsElement = about.element.querySelector("#googleAnalytics") as HTMLInputElement;
googleAnalyticsElement.addEventListener("change", () => {
fetchPost("/api/system/setGoogleAnalytics", {googleAnalytics: googleAnalyticsElement.checked}, () => {