mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-29 21:08:49 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
9b3350a092
8 changed files with 78 additions and 14 deletions
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"returnDesktop": "Press back again again to exit.",
|
||||
"returnDesktop": "Press back again to desktop",
|
||||
"enterNew": "Enter to create",
|
||||
"enterNewTip": "No documents found, Enter to create a new document.",
|
||||
"searchTip1": "to navigate",
|
||||
|
|
@ -1157,6 +1157,7 @@
|
|||
"196": "Do not set the workspace under the path of a third-party sync disk, otherwise the data will be damaged (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun, etc.)",
|
||||
"197": "Currently the editor is in read-only mode. If you need to edit content, please switch to edit mode",
|
||||
"198": "This is not a valid Data archive. If the archive was exported from [Doc tree], please import it from [Doc tree]",
|
||||
"199": "This is not a valid .sy.zip archive. If the archive was exported from [Settings], please import it from [Settings]"
|
||||
"199": "This is not a valid .sy.zip archive. If the archive was exported from [Settings], please import it from [Settings]",
|
||||
"200": "The response time of the global search is slow. It is recommended to adjust [Settings - Search - Number of search results displayed] to 64 or a smaller value. For more suggestions, please refer to the performance optimization chapter of the user guide"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"returnDesktop": "Presiona atrás de nuevo para salir.",
|
||||
"returnDesktop": "Presiona volver de nuevo al escritorio",
|
||||
"enterNew": "Ingresar para crear",
|
||||
"enterNewTip": "No se encontraron documentos, ingrese para crear un nuevo documento.",
|
||||
"searchTip1": "para navegar",
|
||||
|
|
@ -1157,6 +1157,7 @@
|
|||
"196": "No configure el espacio de trabajo bajo la ruta de un disco de sincronización de terceros, de lo contrario, los datos se dañarán (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun, etc.)",
|
||||
"197": "Actualmente, el editor se encuentra en modo de solo lectura. Si necesita editar contenido, cambie al modo de edición",
|
||||
"198": "Este no es un archivo data.zip válido. Si el archivo se exportó de [Árbol de documentos], importalo de [Árbol de documentos]",
|
||||
"199": "Este no es un archivo .sy.zip válido. Si el archivo se exportó desde [Configuración], impórtelo desde [Configuración]"
|
||||
"199": "Este no es un archivo .sy.zip válido. Si el archivo se exportó desde [Configuración], impórtelo desde [Configuración]",
|
||||
"200": "El tiempo de respuesta de la búsqueda global es lento. Se recomienda ajustar [Configuración - Búsqueda - Número de resultados de búsqueda mostrados] a 64 o un valor menor. Para obtener más sugerencias, consulte el capítulo de optimización del rendimiento de la guía del usuario"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"returnDesktop": "Appuyez à nouveau pour quitter.",
|
||||
"returnDesktop": "Appuyez à nouveau sur le bureau",
|
||||
"enterNew": "Entrez pour créer",
|
||||
"enterNewTip": "Aucun document trouvé, entrez pour créer un nouveau document.",
|
||||
"searchTip1": "pour naviguer",
|
||||
|
|
@ -1157,6 +1157,7 @@
|
|||
"196": "Ne définissez pas l'espace de travail sous le chemin d'un disque de synchronisation tiers, sinon les données seront endommagées (iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun, etc.)",
|
||||
"197": "Actuellement, l'éditeur est en mode lecture seule. Si vous devez modifier le contenu, veuillez passer en mode édition",
|
||||
"198": "Ceci n'est pas une archive data.zip valide. Si l'archive a été exportée depuis [Doc tree], veuillez l'importer depuis [Doc tree]",
|
||||
"199": "Ceci n'est pas une archive .sy.zip valide. Si l'archive a été exportée depuis [Paramètres], veuillez l'importer depuis [Paramètres]"
|
||||
"199": "Ceci n'est pas une archive .sy.zip valide. Si l'archive a été exportée depuis [Paramètres], veuillez l'importer depuis [Paramètres]",
|
||||
"200": "Le temps de réponse de la recherche globale est lent. Il est recommandé d'ajuster [Paramètres - Recherche - Nombre de résultats de recherche affichés] à 64 ou à une valeur inférieure. Pour plus de suggestions, veuillez vous référer au chapitre sur l'optimisation des performances de la notice"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"returnDesktop": "再按一次退出應用",
|
||||
"returnDesktop": "再按一次返回桌面",
|
||||
"enterNew": "回車創建",
|
||||
"enterNewTip": "搜索結果為空,回車創建新文檔",
|
||||
"searchTip1": "導航",
|
||||
|
|
@ -1157,6 +1157,7 @@
|
|||
"196": "請勿將工作空間設置在第三方同步盤路徑下,否則數據會被損壞(iCloud/OneDrive/Dropbox/Google Drive/堅果雲/百度網盤/騰訊微雲等)",
|
||||
"197": "目前編輯器正處於只讀模式狀態,如果需要編輯內容,請切換到編輯模式",
|
||||
"198": "這不是一個有效的 Data 壓縮包。如果該數據包是從 [文檔樹] 導出的,請從 [文檔樹] 導入",
|
||||
"199": "這不是一個有效的 .sy.zip 壓縮包。如果該數據包是從 [設置] 中導出的,請從 [設置] 中導入"
|
||||
"199": "這不是一個有效的 .sy.zip 壓縮包。如果該數據包是從 [設置] 中導出的,請從 [設置] 中導入",
|
||||
"200": "全局搜索響應時間較慢,建議將 [設置 - 搜索 - 搜索結果顯示數] 調整為 64 或更小的值,更多建議請參考用戶指南性能優化章節"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"returnDesktop": "再按一次退出应用",
|
||||
"returnDesktop": "再按一次返回桌面",
|
||||
"enterNew": "回车创建",
|
||||
"enterNewTip": "搜索结果为空,回车创建新文档",
|
||||
"searchTip1": "导航",
|
||||
|
|
@ -956,6 +956,9 @@
|
|||
"openSource": "访问 GitHub 项目",
|
||||
"resetWindow": "重置窗口并退出程序",
|
||||
"quit": "退出程序"
|
||||
},
|
||||
"_performance": {
|
||||
|
||||
},
|
||||
"_kernel": {
|
||||
"0": "查询笔记本失败",
|
||||
|
|
@ -1157,6 +1160,7 @@
|
|||
"196": "请勿将工作空间设置在第三方同步盘路径下,否则数据会被损坏(iCloud/OneDrive/Dropbox/Google Drive/坚果云/百度网盘/腾讯微云等)",
|
||||
"197": "目前编辑器正处于只读模式状态,如果需要编辑内容,请切换到编辑模式",
|
||||
"198": "这不是一个有效的 Data 压缩包。如果该数据包是从 [文档树] 导出的,请从 [文档树] 导入",
|
||||
"199": "这不是一个有效的 .sy.zip 压缩包。如果该数据包是从 [设置] 中导出的,请从 [设置] 中导入"
|
||||
"199": "这不是一个有效的 .sy.zip 压缩包。如果该数据包是从 [设置] 中导出的,请从 [设置] 中导入",
|
||||
"200": "全局搜索响应时间较慢,建议将 [设置 - 搜索 - 搜索结果显示数] 调整为 64 或更小的值,更多建议请参考用户指南性能优化章节"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -416,9 +416,21 @@
|
|||
}
|
||||
|
||||
const walk = (dir, files = []) => {
|
||||
let dirFiles;
|
||||
const fs = require('fs')
|
||||
try {
|
||||
if (!fs.existsSync(dir)) {
|
||||
console.log("dir [" + dir + "] not exists")
|
||||
return files
|
||||
}
|
||||
|
||||
dirFiles = fs.readdirSync(dir)
|
||||
} catch (e) {
|
||||
console.error("read dir [" + dir + "] failed: ", e)
|
||||
return files
|
||||
}
|
||||
|
||||
const path = require('path')
|
||||
const dirFiles = fs.readdirSync(dir)
|
||||
for (const f of dirFiles) {
|
||||
let stat = fs.lstatSync(dir + path.sep + f)
|
||||
if (stat.isSymbolicLink()) {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,10 @@ package model
|
|||
|
||||
import (
|
||||
"net/http"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/gin-gonic/gin"
|
||||
|
|
@ -230,3 +233,41 @@ func CheckAuth(c *gin.Context) {
|
|||
|
||||
c.Next()
|
||||
}
|
||||
|
||||
var timingAPIs = map[string]int{
|
||||
"/api/search/fullTextSearchBlock": 200, // Monitor the search performance and suggest solutions https://github.com/siyuan-note/siyuan/issues/7873
|
||||
}
|
||||
|
||||
func Timing(c *gin.Context) {
|
||||
p := c.Request.URL.Path
|
||||
tip, ok := timingAPIs[p]
|
||||
if !ok {
|
||||
c.Next()
|
||||
return
|
||||
}
|
||||
|
||||
timing := 15 * 1000
|
||||
if timingEnv := os.Getenv("SIYUAN_PERFORMANCE_TIMING"); "" != timingEnv {
|
||||
val, err := strconv.Atoi(timingEnv)
|
||||
if nil == err {
|
||||
timing = val
|
||||
}
|
||||
}
|
||||
|
||||
now := time.Now().UnixMilli()
|
||||
c.Next()
|
||||
elapsed := int(time.Now().UnixMilli() - now)
|
||||
if timing < elapsed {
|
||||
logging.LogWarnf("[%s] elapsed [%dms]", c.Request.RequestURI, elapsed)
|
||||
util.PushMsg(Conf.Language(tip), 7000)
|
||||
}
|
||||
}
|
||||
|
||||
func Recover(c *gin.Context) {
|
||||
defer func() {
|
||||
logging.Recover()
|
||||
c.Status(500)
|
||||
}()
|
||||
|
||||
c.Next()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,9 +51,12 @@ func Serve(fastMode bool) {
|
|||
gin.SetMode(gin.ReleaseMode)
|
||||
ginServer := gin.New()
|
||||
ginServer.MaxMultipartMemory = 1024 * 1024 * 32 // 插入较大的资源文件时内存占用较大 https://github.com/siyuan-note/siyuan/issues/5023
|
||||
ginServer.Use(gin.Recovery())
|
||||
ginServer.Use(corsMiddleware()) // 后端服务支持 CORS 预检请求验证 https://github.com/siyuan-note/siyuan/pull/5593
|
||||
ginServer.Use(gzip.Gzip(gzip.DefaultCompression, gzip.WithExcludedExtensions([]string{".pdf", ".mp3", ".wav", ".ogg", ".mov", ".weba", ".mkv", ".mp4", ".webm"})))
|
||||
ginServer.Use(
|
||||
model.Timing,
|
||||
model.Recover,
|
||||
corsMiddleware(), // 后端服务支持 CORS 预检请求验证 https://github.com/siyuan-note/siyuan/pull/5593
|
||||
gzip.Gzip(gzip.DefaultCompression, gzip.WithExcludedExtensions([]string{".pdf", ".mp3", ".wav", ".ogg", ".mov", ".weba", ".mkv", ".mp4", ".webm"})),
|
||||
)
|
||||
|
||||
cookieStore.Options(sessions.Options{
|
||||
Path: "/",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue