|
@@ -16,14 +16,18 @@ import {setKey} from "../sync/syncGuide";
|
|
export const about = {
|
|
export const about = {
|
|
element: undefined as Element,
|
|
element: undefined as Element,
|
|
genHTML: () => {
|
|
genHTML: () => {
|
|
- return `<label class="fn__flex b3-label${isBrowser() || window.siyuan.config.system.isMicrosoftStore || "std" !== window.siyuan.config.system.container || "linux" === window.siyuan.config.system.os ? " fn__none" : ""}">
|
|
|
|
|
|
+ return `<div class="fn__flex b3-label config__item${isBrowser() || window.siyuan.config.system.isMicrosoftStore || "std" !== window.siyuan.config.system.container || "linux" === window.siyuan.config.system.os ? " fn__none" : ""}">
|
|
<div class="fn__flex-1">
|
|
<div class="fn__flex-1">
|
|
${window.siyuan.languages.autoLaunch}
|
|
${window.siyuan.languages.autoLaunch}
|
|
<div class="b3-label__text">${window.siyuan.languages.autoLaunchTip}</div>
|
|
<div class="b3-label__text">${window.siyuan.languages.autoLaunchTip}</div>
|
|
</div>
|
|
</div>
|
|
- <div class="fn__space"></div>
|
|
|
|
- <input class="b3-switch fn__flex-center" id="autoLaunch" type="checkbox"${window.siyuan.config.system.autoLaunch ? " checked" : ""}>
|
|
|
|
-</label>
|
|
|
|
|
|
+ <span class="fn__space"></span>
|
|
|
|
+ <select class="b3-select fn__flex-center fn__size200" id="autoLaunch">
|
|
|
|
+ <option value="0" ${window.siyuan.config.system.autoLaunch === 0 ? "selected" : ""}>${window.siyuan.languages.autoLaunchMode0}</option>
|
|
|
|
+ <option value="1" ${window.siyuan.config.system.autoLaunch === 1 ? "selected" : ""}>${window.siyuan.languages.autoLaunchMode1}</option>
|
|
|
|
+ <option value="2" ${window.siyuan.config.system.autoLaunch === 2 ? "selected" : ""}>${window.siyuan.languages.autoLaunchMode2}</option>
|
|
|
|
+ </select>
|
|
|
|
+</div>
|
|
<label class="fn__flex b3-label${isBrowser() || window.siyuan.config.system.isMicrosoftStore || window.siyuan.config.system.container !== "std" ? " fn__none" : ""}">
|
|
<label class="fn__flex b3-label${isBrowser() || window.siyuan.config.system.isMicrosoftStore || window.siyuan.config.system.container !== "std" ? " fn__none" : ""}">
|
|
<div class="fn__flex-1">
|
|
<div class="fn__flex-1">
|
|
${window.siyuan.languages.autoDownloadUpdatePkg}
|
|
${window.siyuan.languages.autoDownloadUpdatePkg}
|
|
@@ -348,9 +352,10 @@ export const about = {
|
|
/// #if !BROWSER
|
|
/// #if !BROWSER
|
|
const autoLaunchElement = about.element.querySelector("#autoLaunch") as HTMLInputElement;
|
|
const autoLaunchElement = about.element.querySelector("#autoLaunch") as HTMLInputElement;
|
|
autoLaunchElement.addEventListener("change", () => {
|
|
autoLaunchElement.addEventListener("change", () => {
|
|
- fetchPost("/api/system/setAutoLaunch", {autoLaunch: autoLaunchElement.checked}, () => {
|
|
|
|
- window.siyuan.config.system.autoLaunch = autoLaunchElement.checked;
|
|
|
|
- ipcRenderer.send(Constants.SIYUAN_AUTO_LAUNCH, {openAtLogin: autoLaunchElement.checked});
|
|
|
|
|
|
+ const autoLaunchMode = parseInt(autoLaunchElement.value)
|
|
|
|
+ fetchPost("/api/system/setAutoLaunch", {autoLaunch: autoLaunchMode}, () => {
|
|
|
|
+ window.siyuan.config.system.autoLaunch = autoLaunchMode;
|
|
|
|
+ ipcRenderer.send(Constants.SIYUAN_AUTO_LAUNCH, {openAtLogin: 0 != autoLaunchMode});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
/// #endif
|
|
/// #endif
|