This commit is contained in:
Liang Ding 2022-12-20 19:50:10 +08:00
parent 1715b150a2
commit 9de0fe0d93
No known key found for this signature in database
GPG Key ID: 136F30F901A2231D
11 changed files with 1 additions and 53 deletions

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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": "前進",

View File

@ -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": "前进",

View File

@ -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}, () => {

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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"`

View File

@ -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()