mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-19 05:28:07 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
4a0bfa4b8e
12 changed files with 45 additions and 24 deletions
|
|
@ -16,14 +16,18 @@ import {setKey} from "../sync/syncGuide";
|
|||
export const about = {
|
||||
element: undefined as Element,
|
||||
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">
|
||||
${window.siyuan.languages.autoLaunch}
|
||||
<div class="b3-label__text">${window.siyuan.languages.autoLaunchTip}</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" : ""}">
|
||||
<div class="fn__flex-1">
|
||||
${window.siyuan.languages.autoDownloadUpdatePkg}
|
||||
|
|
@ -348,9 +352,10 @@ export const about = {
|
|||
/// #if !BROWSER
|
||||
const autoLaunchElement = about.element.querySelector("#autoLaunch") as HTMLInputElement;
|
||||
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
|
||||
|
|
|
|||
5
app/src/types/config.d.ts
vendored
5
app/src/types/config.d.ts
vendored
|
|
@ -1351,8 +1351,11 @@ declare namespace Config {
|
|||
appDir: string;
|
||||
/**
|
||||
* Boot automatically
|
||||
* - `0`: Do not boot automatically
|
||||
* - `1`: Boot automatically
|
||||
* - `2`: Boot automatically + Minimize UI
|
||||
*/
|
||||
autoLaunch: boolean;
|
||||
autoLaunch: number;
|
||||
/**
|
||||
* The absolute path of the `conf` directory of the current workspace
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue