🎨 桌面端内核进程使用随机端口 https://github.com/siyuan-note/siyuan/issues/4952

This commit is contained in:
Liang Ding 2022-10-25 10:21:14 +08:00
parent a20a19182b
commit bb90e72eee
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
10 changed files with 50 additions and 0 deletions

View file

@ -40,6 +40,14 @@ export const about = {
<div class="fn__space"></div>
<input class="b3-switch fn__flex-center" id="networkServe" type="checkbox"${window.siyuan.config.system.networkServe ? " checked" : ""}>
</label>
<label class="b3-label fn__flex">
<div class="fn__flex-1">
${window.siyuan.languages.useFixedPort}
<div class="b3-label__text">${window.siyuan.languages.useFixedPortTip}</div>
</div>
<div class="fn__space"></div>
<input class="b3-switch fn__flex-center" id="fixedPort" type="checkbox"${window.siyuan.config.system.fixedPort ? " checked" : ""}>
</label>
<label class="b3-label${isBrowser() ? " fn__none" : " fn__flex"}">
<div class="fn__flex-1">
${window.siyuan.languages.about2}
@ -348,6 +356,14 @@ export const about = {
});
});
});
const fixedPortElement = about.element.querySelector("#fixedPort") as HTMLInputElement;
fixedPortElement.addEventListener("change", () => {
fetchPost("/api/system/setFixedPort", {networkServe: fixedPortElement.checked}, () => {
exportLayout(false, () => {
exitSiYuan();
});
});
});
const uploadErrLogElement = about.element.querySelector("#uploadErrLog") as HTMLInputElement;
uploadErrLogElement.addEventListener("change", () => {
fetchPost("/api/system/setUploadErrLog", {uploadErrLog: uploadErrLogElement.checked}, () => {

View file

@ -341,6 +341,7 @@ declare interface IConfig {
uploadErrLog: boolean
downloadInstallPkg: boolean
networkServe: boolean
fixedPort: boolean
useExistingDB: boolean
}
localIPs: string[]