Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: 改进桌面端拉起内核 https://github.com/siyuan-note/siyuan/issues/6894

Liang Ding9de0fe0d93f5
diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json
index ca6cdb4533..1730d7f6bf 100644
--- a/app/appearance/langs/en_US.json
+++ b/app/appearance/langs/en_US.json
@@ -38,8 +38,6 @@
"floatWindowMode": "Hover to display a floating window",
"floatWindowModeTip": "After enabling, a floating window will appear when the mouse hovers over the block reference, breadcrumb block icon, etc. After disabling, you need to hold down the <code class='fn__code'>${hotkey}</code> key to appear the floating window",
"codeSnippet": "Code Snippet",
- "useFixedPort": "Use Fixed Port",
- "useFixedPortTip": "After enabling, only the port <code class='fn__code'>6806</code> will be used. When disabled, both random ports and <code class='fn__code'>6806</code> will be used. The application will be closed automatically after modification, please restart manually",
"expandDown": "Expand Down",
"expandUp": "Expand Up",
"goForward": "Go forward",
diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json
index 7f4f97f94b..18a5e86775 100644
--- a/app/appearance/langs/es_ES.json
+++ b/app/appearance/langs/es_ES.json
@@ -38,8 +38,6 @@
"floatWindowMode": "Pase el cursor para mostrar una ventana flotante",
"floatWindowModeTip": "Después de habilitar, aparecerá una ventana flotante cuando el mouse se desplace sobre la referencia del bloque, el ícono del bloque de navegación, etc. Después de deshabilitar, debe mantener presionada la tecla <code class='fn__code'>${hotkey}</code> para aparece la ventana flotante",
"codeSnippet": "Fragmento de código",
- "useFixedPort": "Usar puerto fijo",
- "useFixedPortTip": "Después de habilitarlo, solo se usará el puerto <code class='fn__code'>6806</code>. Cuando está deshabilitado, se utilizarán tanto los puertos aleatorios como <code class='fn__code'>6806</code>. La aplicación se cerrará automáticamente después de la modificación, por favor reinicie manualmente",
"expandDown": "Expandir hacia abajo",
"expandUp": "Expandir hacia arriba",
"goForward": "Ir hacia adelante",
diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json
index 1056b50e69..acae913209 100644
--- a/app/appearance/langs/fr_FR.json
+++ b/app/appearance/langs/fr_FR.json
@@ -38,8 +38,6 @@
"floatWindowMode": "Survolez pour afficher une fenêtre flottante",
"floatWindowModeTip": "Après l'activation, une fenêtre flottante apparaît lorsque la souris survole la référence du bloc, l'icône du fil d'Ariane, etc. Après la désactivation, vous devez maintenir enfoncée la touche <code class='fn__code'>${hotkey}</code> pour apparaît la fenêtre flottante",
"codeSnippet": "Extrait de code",
- "useFixedPort": "Utiliser un port fixe",
- "useFixedPortTip": "Après activation, seul le port <code class='fn__code'>6806</code> sera utilisé. Lorsqu'il est désactivé, les ports aléatoires et <code class='fn__code'>6806</code> seront utilisés. L'application sera fermée automatiquement après modification, veuillez la redémarrer manuellement.",
"expandDown": "Développer vers le bas",
"expandUp": "Développer vers le haut",
"goForward": "Suivant",
diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json
index 32a61206d4..2647a1da5c 100644
--- a/app/appearance/langs/zh_CHT.json
+++ b/app/appearance/langs/zh_CHT.json
@@ -38,8 +38,6 @@
"floatWindowMode": "懸停出現浮窗",
"floatWindowModeTip": "啟用後鼠標懸停塊引、導覽路徑塊標等位置會出現浮窗,關閉後需按住 <code class='fn__code'>${hotkey}</code> 鍵才會出現浮窗",
"codeSnippet": "代碼片段",
- "useFixedPort": "使用固定端口",
- "useFixedPortTip": "啟用後將僅使用固定端口 <code class='fn__code'>6806</code>,關閉時同時使用隨機端口和 <code class='fn__code'>6806</code>。修改後會自動關閉應用,請手動重啟",
"expandDown": "向下擴選",
"expandUp": "向上擴選",
"goForward": "前進",
diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json
index 5066733248..43f46279cb 100644
--- a/app/appearance/langs/zh_CN.json
+++ b/app/appearance/langs/zh_CN.json
@@ -38,8 +38,6 @@
"floatWindowMode": "悬停出现浮窗",
"floatWindowModeTip": "启用后鼠标悬停块引、面包屑块标等位置会出现浮窗,关闭后需按住 <code class='fn__code'>${hotkey}</code> 键才会出现浮窗",
"codeSnippet": "代码片段",
- "useFixedPort": "使用固定端口",
- "useFixedPortTip": "启用后将仅使用固定端口 <code class='fn__code'>6806</code>,关闭时同时使用随机端口和 <code class='fn__code'>6806</code>。修改后会自动关闭应用,请手动重启",
"expandDown": "向下扩选",
"expandUp": "向上扩选",
"goForward": "前进",
diff --git a/app/src/config/about.ts b/app/src/config/about.ts
index 7b8891ad4f..0cbcdc359c 100644
--- a/app/src/config/about.ts
+++ b/app/src/config/about.ts
@@ -57,14 +57,6 @@ 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}
@@ -369,14 +361,6 @@ export const about = {
});
});
});
- const fixedPortElement = about.element.querySelector("#fixedPort") as HTMLInputElement;
- fixedPortElement.addEventListener("change", () => {
- fetchPost("/api/system/setFixedPort", {fixedPort: fixedPortElement.checked}, () => {
- exportLayout(false, () => {
- exitSiYuan();
- });
- });
- });
const googleAnalyticsElement = about.element.querySelector("#googleAnalytics") as HTMLInputElement;
googleAnalyticsElement.addEventListener("change", () => {
fetchPost("/api/system/setGoogleAnalytics", {googleAnalytics: googleAnalyticsElement.checked}, () => {
diff --git a/app/src/config/search.ts b/app/src/config/search.ts
index 27fce77e82..afe836398f 100644
--- a/app/src/config/search.ts
+++ b/app/src/config/search.ts
@@ -74,7 +74,7 @@ export const initConfigSearch = (element: HTMLElement) => {
"importKey", "genKey", "genKeyByPW", "copyKey", "resetRepo", "systemLogTip", "export", "visitAnnouncements",
"safeQuit", "directConnection", "siyuanNote", "key", "password", "copied", "resetRepoTip",
"autoDownloadUpdatePkg", "autoDownloadUpdatePkgTip", "networkProxy", "keyPlaceholder", "initRepoKeyTip",
- "useFixedPort", "useFixedPortTip", "googleAnalytics", "googleAnalyticsTip"]),
+ "googleAnalytics", "googleAnalyticsTip"]),
];
const inputElement = element.querySelector(".b3-form__icon input") as HTMLInputElement;
/// #if !BROWSER
diff --git a/kernel/api/router.go b/kernel/api/router.go
index 1fee183f16..736665257f 100644
--- a/kernel/api/router.go
+++ b/kernel/api/router.go
@@ -39,7 +39,6 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/system/getEmojiConf", model.CheckAuth, getEmojiConf)
ginServer.Handle("POST", "/api/system/setAccessAuthCode", model.CheckAuth, setAccessAuthCode)
ginServer.Handle("POST", "/api/system/setNetworkServe", model.CheckAuth, setNetworkServe)
- ginServer.Handle("POST", "/api/system/setFixedPort", model.CheckAuth, setFixedPort)
ginServer.Handle("POST", "/api/system/setUploadErrLog", model.CheckAuth, setUploadErrLog)
ginServer.Handle("POST", "/api/system/setGoogleAnalytics", model.CheckAuth, setGoogleAnalytics)
ginServer.Handle("POST", "/api/system/setDownloadInstallPkg", model.CheckAuth, setDownloadInstallPkg)
diff --git a/kernel/api/system.go b/kernel/api/system.go
index 6a0bc18e3b..0d8378a034 100644
--- a/kernel/api/system.go
+++ b/kernel/api/system.go
@@ -285,23 +285,6 @@ func setNetworkServe(c *gin.Context) {
time.Sleep(time.Second * 3)
}
-func setFixedPort(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
-
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
-
- fixedPort := arg["fixedPort"].(bool)
- model.Conf.System.FixedPort = fixedPort
- model.Conf.Save()
-
- util.PushMsg(model.Conf.Language(42), 1000*15)
- time.Sleep(time.Second * 3)
-}
-
func setGoogleAnalytics(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
diff --git a/kernel/conf/system.go b/kernel/conf/system.go
index 1b07736208..f560c9b096 100644
--- a/kernel/conf/system.go
+++ b/kernel/conf/system.go
@@ -35,7 +35,6 @@ type System struct {
DataDir string `json:"dataDir"`
NetworkServe bool `json:"networkServe"` // 是否开启网络伺服
- FixedPort bool `json:"fixedPort"` // 是否使用固定端口 6806
NetworkProxy *NetworkProxy `json:"networkProxy"`
UploadErrLog bool `json:"uploadErrLog"`
diff --git a/kernel/model/conf.go b/kernel/model/conf.go
index c951e28665..f96109f80f 100644
--- a/kernel/model/conf.go
+++ b/kernel/model/conf.go
@@ -296,13 +296,6 @@ func InitConf() {
Conf.AccessAuthCode = util.AccessAuthCode
}
- if util.ContainerStd != util.Container {
- Conf.System.FixedPort = true
- }
- if Conf.System.FixedPort {
- util.ServerPort = util.FixedPort
- }
-
Conf.LocalIPs = util.GetLocalIPs()
Conf.Save()