🎨 桌面端自动下载更新安装包 https://github.com/siyuan-note/siyuan/issues/5837

This commit is contained in:
Liang Ding 2022-09-07 22:43:14 +08:00
parent 9531bdd01c
commit e2a6780cec
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
14 changed files with 155 additions and 16 deletions

View file

@ -125,6 +125,14 @@ export const about = {
<svg><use xlink:href="#iconRefresh"></use></svg>${window.siyuan.languages.checkUpdate}
</button>
</div>
<div class="fn__flex b3-label${isBrowser() ? " fn__none" : ""}">
<div class="fn__flex-1">
${window.siyuan.languages.autoDownloadUpdatePkg}
<div class="b3-label__text">${window.siyuan.languages.autoDownloadUpdatePkgTip}</div>
</div>
<div class="fn__space"></div>
<input class="b3-switch fn__flex-center" id="downloadInstallPkg" type="checkbox"${window.siyuan.config.system.downloadInstallPkg ? " checked" : ""}>
</div>
<div class="fn__flex b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.systemLog}
@ -339,6 +347,12 @@ export const about = {
});
});
});
const downloadInstallPkgElement = about.element.querySelector("#downloadInstallPkg") as HTMLInputElement;
downloadInstallPkgElement.addEventListener("change", () => {
fetchPost("/api/system/setDownloadInstallPkg", {downloadInstallPkg: downloadInstallPkgElement.checked}, () => {
window.siyuan.config.system.downloadInstallPkg = downloadInstallPkgElement.checked
});
});
about.element.querySelector("#aboutConfim").addEventListener("click", () => {
fetchPost("/api/system/setNetworkProxy", {
scheme: (about.element.querySelector("#aboutScheme") as HTMLInputElement).value,

View file

@ -304,6 +304,7 @@ declare interface IConfig {
xanadu: boolean
udanax: boolean
uploadErrLog: boolean
downloadInstallPkg: boolean
networkServe: boolean
useExistingDB: boolean
}