mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
f09347e49b
11 changed files with 56 additions and 24 deletions
|
|
@ -612,6 +612,7 @@
|
||||||
"md38": "The maximum length of the anchor text that is automatically rendered when the block ref anchor text is not customized, the default is <code class='fn__code'>96</code> characters",
|
"md38": "The maximum length of the anchor text that is automatically rendered when the block ref anchor text is not customized, the default is <code class='fn__code'>96</code> characters",
|
||||||
"md39": "PlantUML Serve Address",
|
"md39": "PlantUML Serve Address",
|
||||||
"md40": "Leave blank to restore default <code class='fn__code'>https://www.plantuml.com/plantuml/svg/~1</code>",
|
"md40": "Leave blank to restore default <code class='fn__code'>https://www.plantuml.com/plantuml/svg/~1</code>",
|
||||||
|
"md41": "Support using / to wrap regular expressions, for example <code class='fn__code'>foo,/[0-9]+/</code> means to exclude foo and numbers",
|
||||||
"fileTree2": "The doc tree will automatically select the current document when the editor tab is switched",
|
"fileTree2": "The doc tree will automatically select the current document when the editor tab is switched",
|
||||||
"fileTree3": "No confirmation required when deleting documents",
|
"fileTree3": "No confirmation required when deleting documents",
|
||||||
"fileTree4": "If not enabled, a confirmation box will pop up every time you delete a document",
|
"fileTree4": "If not enabled, a confirmation box will pop up every time you delete a document",
|
||||||
|
|
@ -723,7 +724,7 @@
|
||||||
"about12": "After enabling, other devices in the same LAN will be allowed to access. The application will be closed automatically after modification, please restart manually",
|
"about12": "After enabling, other devices in the same LAN will be allowed to access. The application will be closed automatically after modification, please restart manually",
|
||||||
"about13": "API token",
|
"about13": "API token",
|
||||||
"about14": "The token needs to be authenticated when calling the API",
|
"about14": "The token needs to be authenticated when calling the API",
|
||||||
"about17": "Do not enable proxy when set to <code class='fn__code'>Direct connection</code>. The application will be closed automatically after modification, please restart manually",
|
"about17": "Do not enable proxy when set to <code class='fn__code'>Direct connection</code>",
|
||||||
"checkUpdate": "Check update",
|
"checkUpdate": "Check update",
|
||||||
"currentVer": "Current version",
|
"currentVer": "Current version",
|
||||||
"visitAnnouncements": "<a href=\"https://github.com/siyuan-note/siyuan/releases\" target=\"_blank\">View system announcements</a>",
|
"visitAnnouncements": "<a href=\"https://github.com/siyuan-note/siyuan/releases\" target=\"_blank\">View system announcements</a>",
|
||||||
|
|
|
||||||
|
|
@ -612,6 +612,7 @@
|
||||||
"md38": "La longitud máxima del texto de anclaje que se renderiza automáticamente cuando el texto de anclaje del bloque ref no está personalizado, el valor por defecto es <code class='fn__code'>96</code> caracteres",
|
"md38": "La longitud máxima del texto de anclaje que se renderiza automáticamente cuando el texto de anclaje del bloque ref no está personalizado, el valor por defecto es <code class='fn__code'>96</code> caracteres",
|
||||||
"md39": "Dirección de PlantUML Serve",
|
"md39": "Dirección de PlantUML Serve",
|
||||||
"md40": "Dejar en blanco para restablecer el valor por defecto <code class='fn__code'>https://www.plantuml.com/plantuml/svg/~1</code>",
|
"md40": "Dejar en blanco para restablecer el valor por defecto <code class='fn__code'>https://www.plantuml.com/plantuml/svg/~1</code>",
|
||||||
|
"md41": "Se admite el uso de / para ajustar expresiones regulares, por ejemplo <code class='fn__code'>foo,/[0-9]+/</code> significa excluir foo y números",
|
||||||
"fileTree2": "El árbol de documentos seleccionará automáticamente el documento actual cuando se cambie la pestaña del editor",
|
"fileTree2": "El árbol de documentos seleccionará automáticamente el documento actual cuando se cambie la pestaña del editor",
|
||||||
"fileTree3": "No se requiere confirmación al borrar documentos",
|
"fileTree3": "No se requiere confirmación al borrar documentos",
|
||||||
"fileTree4": "Si no se activa, aparecerá un cuadro de confirmación cada vez que se elimine un documento",
|
"fileTree4": "Si no se activa, aparecerá un cuadro de confirmación cada vez que se elimine un documento",
|
||||||
|
|
@ -723,7 +724,7 @@
|
||||||
"about12": "Después de habilitarla, se permitirá el acceso a otros dispositivos de la misma LAN. La aplicación se cerrará automáticamente después de la modificación, por favor reinicie manualmente",
|
"about12": "Después de habilitarla, se permitirá el acceso a otros dispositivos de la misma LAN. La aplicación se cerrará automáticamente después de la modificación, por favor reinicie manualmente",
|
||||||
"about13": "Token API",
|
"about13": "Token API",
|
||||||
"about14": "El token debe ser autentificado al llamar a la API",
|
"about14": "El token debe ser autentificado al llamar a la API",
|
||||||
"about17": "No habilite el proxy cuando esté configurado como <code class='fn__code'>Conexión directa</code>. La aplicación se cerrará automáticamente después de la modificación, por favor reinicie manualmente",
|
"about17": "No habilite el proxy cuando esté configurado como <code class='fn__code'>Conexión directa</code>",
|
||||||
"checkUpdate": "Comprobar actualización",
|
"checkUpdate": "Comprobar actualización",
|
||||||
"currentVer": "Versión actual",
|
"currentVer": "Versión actual",
|
||||||
"visitAnnouncements": "<a href=\"https://github.com/siyuan-note/siyuan/releases\" target=\"_blank\">Ver los anuncios del sistema</a>",
|
"visitAnnouncements": "<a href=\"https://github.com/siyuan-note/siyuan/releases\" target=\"_blank\">Ver los anuncios del sistema</a>",
|
||||||
|
|
|
||||||
|
|
@ -612,6 +612,7 @@
|
||||||
"md38": "La longueur maximale du texte d'ancrage qui est automatiquement rendu lorsque le texte d'ancrage de la référence de bloc n'est pas personnalisé, la valeur par défaut est de <code class='fn__code'>96</code> caractères",
|
"md38": "La longueur maximale du texte d'ancrage qui est automatiquement rendu lorsque le texte d'ancrage de la référence de bloc n'est pas personnalisé, la valeur par défaut est de <code class='fn__code'>96</code> caractères",
|
||||||
"md39": "Adresse Servo PlantUML",
|
"md39": "Adresse Servo PlantUML",
|
||||||
"md40": "Laissez vide pour restaurer <code class='fn__code'>https://www.plantuml.com/plantuml/svg/~1/</code> par défaut",
|
"md40": "Laissez vide pour restaurer <code class='fn__code'>https://www.plantuml.com/plantuml/svg/~1/</code> par défaut",
|
||||||
|
"md41": "Prend en charge l'utilisation de / pour envelopper les expressions régulières, par exemple <code class='fn__code'>foo,/[0-9]+/</code> signifie exclure foo et les nombres",
|
||||||
"fileTree2": "L'arbre des Docs sélectionne automatiquement le document en cours lorsque l'on change d'onglet d'édition",
|
"fileTree2": "L'arbre des Docs sélectionne automatiquement le document en cours lorsque l'on change d'onglet d'édition",
|
||||||
"fileTree3": "Aucune confirmation requise lors de la suppression de documents",
|
"fileTree3": "Aucune confirmation requise lors de la suppression de documents",
|
||||||
"fileTree4": "Si non activé, une boîte de confirmation apparaîtra à chaque fois que vous supprimerez un document",
|
"fileTree4": "Si non activé, une boîte de confirmation apparaîtra à chaque fois que vous supprimerez un document",
|
||||||
|
|
@ -723,7 +724,7 @@
|
||||||
"about12": "Après l'activation, les autres appareils du même réseau local seront autorisés à accéder. L'application sera fermée automatiquement après modification, veuillez la redémarrer manuellement.",
|
"about12": "Après l'activation, les autres appareils du même réseau local seront autorisés à accéder. L'application sera fermée automatiquement après modification, veuillez la redémarrer manuellement.",
|
||||||
"about13": "API token",
|
"about13": "API token",
|
||||||
"about14": "Le token doit être authentifié lors de l'appel de l'API.",
|
"about14": "Le token doit être authentifié lors de l'appel de l'API.",
|
||||||
"about17": "N'activez pas le proxy lorsqu'il est défini sur <code class='fn__code'>Connexion directe</code>. L'application se fermera automatiquement après modification, merci de redémarrer manuellement",
|
"about17": "N'activez pas le proxy lorsqu'il est défini sur <code class='fn__code'>Connexion directe</code>.",
|
||||||
"checkUpdate": "Vérifier la mise à jour",
|
"checkUpdate": "Vérifier la mise à jour",
|
||||||
"currentVer": "Version actuelle",
|
"currentVer": "Version actuelle",
|
||||||
"visitAnnouncements": "<a href=\"https://github.com/siyuan-note/siyuan/releases\" target=\"_blank\">Voir les annonces du système</a>",
|
"visitAnnouncements": "<a href=\"https://github.com/siyuan-note/siyuan/releases\" target=\"_blank\">Voir les annonces du système</a>",
|
||||||
|
|
|
||||||
|
|
@ -612,6 +612,7 @@
|
||||||
"md38": "不自訂塊引錨文本時自動渲染錨文本的最大長度,預設為 <code class='fn__code'>96</code> 個字元",
|
"md38": "不自訂塊引錨文本時自動渲染錨文本的最大長度,預設為 <code class='fn__code'>96</code> 個字元",
|
||||||
"md39": "PlantUML 伺服地址",
|
"md39": "PlantUML 伺服地址",
|
||||||
"md40": "留空將恢復默認值 <code class='fn__code'>https://www.plantuml.com/plantuml/svg/~1</code>",
|
"md40": "留空將恢復默認值 <code class='fn__code'>https://www.plantuml.com/plantuml/svg/~1</code>",
|
||||||
|
"md41": "支持使用 / 包裹正則表達式,例如 <code class='fn__code'>foo,/[0-9]+/</code> 表示排除 foo 和數字",
|
||||||
"fileTree2": "在編輯器切換分頁時文檔樹會自動選中當前的文檔",
|
"fileTree2": "在編輯器切換分頁時文檔樹會自動選中當前的文檔",
|
||||||
"fileTree3": "刪除文檔時不需要確認",
|
"fileTree3": "刪除文檔時不需要確認",
|
||||||
"fileTree4": "不啟用時每次刪除文檔都會彈出確認框",
|
"fileTree4": "不啟用時每次刪除文檔都會彈出確認框",
|
||||||
|
|
@ -723,7 +724,7 @@
|
||||||
"about12": "啟用後將允許同一區域網內的其他設備進行存取。修改後會自動關閉應用,請手動重啟",
|
"about12": "啟用後將允許同一區域網內的其他設備進行存取。修改後會自動關閉應用,請手動重啟",
|
||||||
"about13": "API token",
|
"about13": "API token",
|
||||||
"about14": "調用 API 時需要通過該 token 進行鑒權",
|
"about14": "調用 API 時需要通過該 token 進行鑒權",
|
||||||
"about17": "設置為 <code class='fn__code'>直接連接</code> 時不啟用代理。修改後會自動關閉應用,請手動重啟",
|
"about17": "設置為 <code class='fn__code'>直接連接</code> 時不啟用代理",
|
||||||
"checkUpdate": "檢查更新",
|
"checkUpdate": "檢查更新",
|
||||||
"currentVer": "當前版本",
|
"currentVer": "當前版本",
|
||||||
"visitAnnouncements": "<a href=\"https://ld246.com/tag/siyuan-announcement\" target=\"_blank\">瀏覽系統公告</a>",
|
"visitAnnouncements": "<a href=\"https://ld246.com/tag/siyuan-announcement\" target=\"_blank\">瀏覽系統公告</a>",
|
||||||
|
|
|
||||||
|
|
@ -612,6 +612,7 @@
|
||||||
"md38": "不自定义块引锚文本时自动渲染锚文本的最大长度,默认为 <code class='fn__code'>96</code> 个字符",
|
"md38": "不自定义块引锚文本时自动渲染锚文本的最大长度,默认为 <code class='fn__code'>96</code> 个字符",
|
||||||
"md39": "PlantUML 伺服地址",
|
"md39": "PlantUML 伺服地址",
|
||||||
"md40": "留空将恢复默认值 <code class='fn__code'>https://www.plantuml.com/plantuml/svg/~1</code>",
|
"md40": "留空将恢复默认值 <code class='fn__code'>https://www.plantuml.com/plantuml/svg/~1</code>",
|
||||||
|
"md41": "支持使用 / 包裹正则表达式,例如 <code class='fn__code'>foo,/[0-9]+/</code> 表示排除 foo 和数字",
|
||||||
"fileTree2": "在编辑器页签切换时文档树会自动选中当前的文档",
|
"fileTree2": "在编辑器页签切换时文档树会自动选中当前的文档",
|
||||||
"fileTree3": "删除文档时不需要确认",
|
"fileTree3": "删除文档时不需要确认",
|
||||||
"fileTree4": "不启用时每次删除文档都会弹出确认框",
|
"fileTree4": "不启用时每次删除文档都会弹出确认框",
|
||||||
|
|
@ -723,7 +724,7 @@
|
||||||
"about12": "启用后将允许同一局域网内的其他设备进行访问。修改后会自动关闭应用,请手动重启",
|
"about12": "启用后将允许同一局域网内的其他设备进行访问。修改后会自动关闭应用,请手动重启",
|
||||||
"about13": "API token",
|
"about13": "API token",
|
||||||
"about14": "调用 API 时需要通过该 token 进行鉴权",
|
"about14": "调用 API 时需要通过该 token 进行鉴权",
|
||||||
"about17": "设置为 <code class='fn__code'>直接连接</code> 时不启用代理。修改后会自动关闭应用,请手动重启",
|
"about17": "设置为 <code class='fn__code'>直接连接</code> 时不启用代理",
|
||||||
"checkUpdate": "检查更新",
|
"checkUpdate": "检查更新",
|
||||||
"currentVer": "当前版本",
|
"currentVer": "当前版本",
|
||||||
"visitAnnouncements": "<a href=\"https://ld246.com/tag/siyuan-announcement\" target=\"_blank\">浏览系统公告</a>",
|
"visitAnnouncements": "<a href=\"https://ld246.com/tag/siyuan-announcement\" target=\"_blank\">浏览系统公告</a>",
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import {openByMobile, writeText} from "../protyle/util/compatibility";
|
||||||
import {showMessage} from "../dialog/message";
|
import {showMessage} from "../dialog/message";
|
||||||
import {Dialog} from "../dialog";
|
import {Dialog} from "../dialog";
|
||||||
import {confirmDialog} from "../dialog/confirmDialog";
|
import {confirmDialog} from "../dialog/confirmDialog";
|
||||||
|
import {setProxy} from "../util/onGetConfig";
|
||||||
|
|
||||||
export const about = {
|
export const about = {
|
||||||
element: undefined as Element,
|
element: undefined as Element,
|
||||||
|
|
@ -170,7 +171,7 @@ export const about = {
|
||||||
<span class="fn__space"></span>
|
<span class="fn__space"></span>
|
||||||
<input id="aboutPort" placeholder="Port" class="b3-text-field fn__flex-1 fn__block" value="${window.siyuan.config.system.networkProxy.port}" type="number"/>
|
<input id="aboutPort" placeholder="Port" class="b3-text-field fn__flex-1 fn__block" value="${window.siyuan.config.system.networkProxy.port}" type="number"/>
|
||||||
<span class="fn__space"></span>
|
<span class="fn__space"></span>
|
||||||
<button id="aboutConfim" class="b3-button b3-button--outline">${window.siyuan.languages.confirm}</button>
|
<button id="aboutConfirm" class="b3-button b3-button--outline">${window.siyuan.languages.confirm}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="b3-label">
|
<div class="b3-label">
|
||||||
|
|
@ -388,15 +389,15 @@ export const about = {
|
||||||
window.siyuan.config.system.downloadInstallPkg = downloadInstallPkgElement.checked;
|
window.siyuan.config.system.downloadInstallPkg = downloadInstallPkgElement.checked;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
about.element.querySelector("#aboutConfim").addEventListener("click", () => {
|
about.element.querySelector("#aboutConfirm").addEventListener("click", () => {
|
||||||
fetchPost("/api/system/setNetworkProxy", {
|
const scheme = (about.element.querySelector("#aboutScheme") as HTMLInputElement).value;
|
||||||
scheme: (about.element.querySelector("#aboutScheme") as HTMLInputElement).value,
|
const host = (about.element.querySelector("#aboutHost") as HTMLInputElement).value
|
||||||
host: (about.element.querySelector("#aboutHost") as HTMLInputElement).value,
|
const port = (about.element.querySelector("#aboutPort") as HTMLInputElement).value;
|
||||||
port: (about.element.querySelector("#aboutPort") as HTMLInputElement).value
|
fetchPost("/api/system/setNetworkProxy", {scheme, host, port}, () => {
|
||||||
}, () => {
|
window.siyuan.config.system.networkProxy.scheme = scheme
|
||||||
exportLayout(false, () => {
|
window.siyuan.config.system.networkProxy.host = host
|
||||||
exitSiYuan();
|
window.siyuan.config.system.networkProxy.port = port
|
||||||
});
|
setProxy()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -177,6 +177,7 @@ export const editor = {
|
||||||
<div class="fn__flex-1">
|
<div class="fn__flex-1">
|
||||||
${window.siyuan.languages.md35}
|
${window.siyuan.languages.md35}
|
||||||
<div class="b3-label__text">${window.siyuan.languages.md36}</div>
|
<div class="b3-label__text">${window.siyuan.languages.md36}</div>
|
||||||
|
<div class="b3-label__text">${window.siyuan.languages.md41}</div>
|
||||||
</div>
|
</div>
|
||||||
<span class="fn__space"></span>
|
<span class="fn__space"></span>
|
||||||
<input class="b3-text-field fn__flex-center fn__size200" id="virtualBlockRefExclude" value="${window.siyuan.config.editor.virtualBlockRefExclude}" />
|
<input class="b3-text-field fn__flex-center fn__size200" id="virtualBlockRefExclude" value="${window.siyuan.config.editor.virtualBlockRefExclude}" />
|
||||||
|
|
|
||||||
|
|
@ -90,12 +90,18 @@ const hasKeymap = (keymap: Record<string, IKeymapItem>, key1: "general" | "edito
|
||||||
|
|
||||||
export const setProxy = () => {
|
export const setProxy = () => {
|
||||||
/// #if !BROWSER
|
/// #if !BROWSER
|
||||||
const session = getCurrentWindow().webContents.session;
|
if ("" === window.siyuan.config.system.networkProxy.scheme) {
|
||||||
if (window.siyuan.config.system.networkProxy.scheme) {
|
console.log("network proxy [system]");
|
||||||
session.closeAllConnections().then(() => {
|
return
|
||||||
session.setProxy({proxyRules: `${window.siyuan.config.system.networkProxy.scheme}://${window.siyuan.config.system.networkProxy.host}:${window.siyuan.config.system.networkProxy.port}`}).then();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const session = getCurrentWindow().webContents.session;
|
||||||
|
session.closeAllConnections().then(() => {
|
||||||
|
const proxyURL = `${window.siyuan.config.system.networkProxy.scheme}://${window.siyuan.config.system.networkProxy.host}:${window.siyuan.config.system.networkProxy.port}`
|
||||||
|
session.setProxy({proxyRules: proxyURL}).then(
|
||||||
|
() => console.log("network proxy [" + proxyURL + "]"),
|
||||||
|
);
|
||||||
|
});
|
||||||
/// #endif
|
/// #endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -366,8 +366,8 @@ func setNetworkProxy(c *gin.Context) {
|
||||||
}
|
}
|
||||||
model.Conf.Save()
|
model.Conf.Save()
|
||||||
|
|
||||||
util.PushMsg(model.Conf.Language(42), 1000*15)
|
proxyURL := model.Conf.System.NetworkProxy.String()
|
||||||
time.Sleep(time.Second * 3)
|
util.SetNetworkProxy(proxyURL)
|
||||||
}
|
}
|
||||||
|
|
||||||
func addUIProcess(c *gin.Context) {
|
func addUIProcess(c *gin.Context) {
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
package model
|
package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"regexp"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
|
@ -97,13 +98,29 @@ func getVirtualRefKeywords(docName string) (ret []string) {
|
||||||
if "" != strings.TrimSpace(Conf.Editor.VirtualBlockRefExclude) {
|
if "" != strings.TrimSpace(Conf.Editor.VirtualBlockRefExclude) {
|
||||||
exclude := strings.ReplaceAll(Conf.Editor.VirtualBlockRefExclude, "\\,", "__comma@sep__")
|
exclude := strings.ReplaceAll(Conf.Editor.VirtualBlockRefExclude, "\\,", "__comma@sep__")
|
||||||
excludes := strings.Split(exclude, ",")
|
excludes := strings.Split(exclude, ",")
|
||||||
var tmp []string
|
var tmp, regexps []string
|
||||||
for _, e := range excludes {
|
for _, e := range excludes {
|
||||||
e = strings.ReplaceAll(e, "__comma@sep__", ",")
|
e = strings.ReplaceAll(e, "__comma@sep__", ",")
|
||||||
|
if strings.HasPrefix(e, "/") && strings.HasSuffix(e, "/") {
|
||||||
|
regexps = append(regexps, e[1:len(e)-1])
|
||||||
|
} else {
|
||||||
tmp = append(tmp, e)
|
tmp = append(tmp, e)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
excludes = tmp
|
excludes = tmp
|
||||||
ret = gulu.Str.ExcludeElem(ret, excludes)
|
ret = gulu.Str.ExcludeElem(ret, excludes)
|
||||||
|
if 0 < len(regexps) {
|
||||||
|
tmp = nil
|
||||||
|
for _, re := range regexps {
|
||||||
|
for _, str := range ret {
|
||||||
|
if ok, regErr := regexp.MatchString(re, str); !ok && nil == regErr {
|
||||||
|
tmp = append(tmp, str)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ret = tmp
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 虚拟引用排除当前文档名 https://github.com/siyuan-note/siyuan/issues/4537
|
// 虚拟引用排除当前文档名 https://github.com/siyuan-note/siyuan/issues/4537
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,8 @@ func SetNetworkProxy(proxyURL string) {
|
||||||
|
|
||||||
if "" != proxyURL {
|
if "" != proxyURL {
|
||||||
logging.LogInfof("use network proxy [%s]", proxyURL)
|
logging.LogInfof("use network proxy [%s]", proxyURL)
|
||||||
|
} else {
|
||||||
|
logging.LogInfof("use network proxy [system]")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue