Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2023-06-09 13:55:37 +08:00
commit 1061e89007
12 changed files with 28 additions and 23 deletions

View file

@ -943,6 +943,7 @@
"task.database.index.fix": "Execute database index fix",
"task.ocr.image": "Execute image OCR to extract text",
"task.history.generateDoc": "Execute GenerateDoc History",
"task.history.database.index.full": "Execute history database rebuild index",
"task.history.database.index.commit": "Execute history database index commit",
"task.database.index.embedBlock": "Execute database index embed block",
"task.reload.ui": "Execute reload UI",
@ -1005,7 +1006,7 @@
"43": "The maximum storage capacity of cloud space [%s] has been exceeded, and data upload cannot continue",
"44": "Parse template failed: %s",
"45": "Opening, please wait...",
"46": "The download of the [%s] failed due to network problems, please try again later",
"46": "Failed to install marketplace package [%s]: %s",
"47": "Uninstall failed: %s",
"48": "Only list the first [%d] sub-documents, if you need to adjust, please modify [Settings - Doc tree - Maximum number to list]",
"49": "Please specify the daily note save path in the Notebook Settings",

View file

@ -943,6 +943,7 @@
"task.database.index.fix": "Ejecutar corrección del índice de la base de datos",
"task.ocr.image": "Ejecutar OCR de imagen para extraer texto",
"task.history.generateDoc": "Ejecutar Historial GenerateDoc",
"task.history.database.index.full": "Ejecutar el índice de reconstrucción de la base de datos del historial",
"task.history.database.index.commit": "Ejecutar la confirmación del índice de la base de datos del historial",
"task.database.index.embedBlock": "Ejecutar bloque de incrustación de índice de base de datos",
"task.reload.ui": "IU de recarga de tareas",
@ -1005,7 +1006,7 @@
"43": "Se ha superado la capacidad máxima de almacenamiento del espacio en la nube [%s] y la carga de datos no puede continuar",
"44": "El proceso de análisis de la plantilla ha fallado: %s",
"45": "Abriendo, por favor espere...",
"46": "La descarga del [%s] falló debido a problemas de red, por favor inténtelo más tarde",
"46": "Error al instalar el paquete del mercado [%s]: %s",
"47": "Fallo en la desinstalación: %s",
"48": "Sólo se listan los primeros [%d] subdocumentos, si necesita ajustarlos, modifique [Configuración - Árbol de documentos - Número máximo a listar]",
"49": "Por favor, especifique la ruta de guardado de las notas diarias en la Configuración de la Libreta",

View file

@ -943,6 +943,7 @@
"task.database.index.fix": "Effectuer la correction de l'index de la base de données",
"task.ocr.image": "Exécute l'OCR d'image pour extraire le texte",
"task.history.generateDoc": "Exécuter l'historique de GenerateDoc",
"task.history.database.index.full": "Exécuter l'index de reconstruction de la base de données de l'historique",
"task.history.database.index.commit": "Effectuer la validation de l'index de la base de données d'historique",
"task.database.index.embedBlock": "Exécuter le bloc d'intégration d'index de base de données",
"task.reload.ui": "Interface utilisateur de rechargement de tâche",
@ -1005,7 +1006,7 @@
"43": "La capacité de stockage maximale de l'espace cloud [%s] a été dépassée et le téléchargement des données ne peut pas continuer",
"44": "L'analyse du template a échoué : %s",
"45": "En cours d'ouverture, veuillez patienter...",
"46": "Le téléchargement du [%s] a échoué en raison de problèmes de réseau, veuillez réessayer plus tard.",
"46": "Échec de l'installation du package du marché [%s]: %s",
"47": "La désinstallation a échoué : %s",
"48": "Seuls les premiers [%d] sous-documents sont listés, si vous avez besoin d'ajuster, veuillez modifier [Paramètres - Arbre des documents - Nombre maximum de documents à lister].",
"49": "Veuillez spécifier le chemin d'enregistrement des notes quotidiennes dans les paramètres du carnet de notes.",

View file

@ -943,6 +943,7 @@
"task.database.index.fix": "執行數據庫索引訂正",
"task.ocr.image": "執行圖片 OCR 提取文本",
"task.history.generateDoc": "執行生成文件歷史",
"task.history.database.index.full": "執行歷史數據庫重建索引",
"task.history.database.index.commit": "執行歷史數據庫索引提交",
"task.database.index.embedBlock": "執行數據庫索引嵌入塊",
"task.reload.ui": "執行重載界面",
@ -1005,7 +1006,7 @@
"43": "已超過雲端空間最大存儲容量 [%s],無法繼續上傳數據",
"44": "範本解析失敗:%s",
"45": "正在打開,請稍等...",
"46": "因為網路問題導致下載 [%s] 失敗,請稍後重試",
"46": "安裝集市包 [%s] 失敗:%s",
"47": "解除安裝失敗:%s",
"48": "僅列出前 [%d] 個子文檔,如需調整請修改 [設置 - 文檔樹 - 最大列出數量]",
"49": "請在筆記本設置中指定日記存放路徑",

View file

@ -943,6 +943,7 @@
"task.database.index.fix": "执行数据库索引订正",
"task.ocr.image": "执行图片 OCR 提取文本",
"task.history.generateDoc": "执行生成文件历史",
"task.history.database.index.full": "执行历史数据库重建索引",
"task.history.database.index.commit": "执行历史数据库索引提交",
"task.database.index.embedBlock": "执行数据库索引嵌入块",
"task.reload.ui": "执行重载界面",
@ -1007,7 +1008,7 @@
"43": "已超过云端空间最大存储容量 [%s],无法继续上传数据",
"44": "模板解析失败:%s",
"45": "正在打开,请稍等...",
"46": "因为网络问题导致下载 [%s] 失败,请稍后重试",
"46": "安装集市包 [%s] 失败:%s",
"47": "卸载失败:%s",
"48": "仅列出前 [%d] 个子文档,如需调整请修改 [设置 - 文档树 - 最大列出数量]",
"49": "请在笔记本设置中指定日记存放路径",

View file

@ -245,7 +245,6 @@ const boot = () => {
// 创建主窗体
const currentWindow = new BrowserWindow({
show: false,
backgroundColor: "#FFF", // 桌面端主窗体背景色设置为 `#FFF` Fix https://github.com/siyuan-note/siyuan/issues/4544
width: windowState.width,
height: windowState.height,
minWidth: 493,
@ -675,7 +674,6 @@ app.whenReady().then(() => {
const mainScreen = screen.getDisplayNearestPoint({x: mainBounds.x, y: mainBounds.y});
const win = new BrowserWindow({
show: true,
backgroundColor: "#FFF", // 桌面端主窗体背景色设置为 `#FFF` Fix https://github.com/siyuan-note/siyuan/issues/4544
trafficLightPosition: {x: 8, y: 13},
width: mainScreen.size.width * 0.7,
height: mainScreen.size.height * 0.9,

View file

@ -96,12 +96,7 @@ func reindexHistory(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
err := model.ReindexHistory()
if nil != err {
ret.Code = -1
ret.Msg = err.Error()
return
}
model.ReindexHistory()
}
func getNotebookHistory(c *gin.Context) {

View file

@ -535,11 +535,11 @@ func downloadPackage(repoURLHash string, pushProgress bool, systemID string) (da
}).Get(u)
if nil != err {
logging.LogErrorf("get bazaar package [%s] failed: %s", u, err)
return nil, errors.New("get bazaar package failed")
return nil, errors.New("get bazaar package failed, please check your network")
}
if 200 != resp.StatusCode {
logging.LogErrorf("get bazaar package [%s] failed: %d", u, resp.StatusCode)
return nil, errors.New("get bazaar package failed")
return nil, errors.New("get bazaar package failed: " + resp.Status)
}
data = buf.Bytes()
@ -575,7 +575,6 @@ func installPackage(data []byte, installPath string) (err error) {
unzipPath := filepath.Join(tmpPackage, name)
if err = gulu.Zip.Unzip(tmp, unzipPath); nil != err {
logging.LogErrorf("write file [%s] failed: %s", installPath, err)
err = errors.New("write file failed")
return
}

View file

@ -66,7 +66,7 @@ func InstallBazaarPlugin(repoURL, repoHash, pluginName string) error {
installPath := filepath.Join(util.DataDir, "plugins", pluginName)
err := bazaar.InstallPlugin(repoURL, repoHash, installPath, Conf.System.ID)
if nil != err {
return errors.New(fmt.Sprintf(Conf.Language(46), pluginName))
return errors.New(fmt.Sprintf(Conf.Language(46), pluginName, err))
}
return nil
}
@ -119,7 +119,7 @@ func InstallBazaarWidget(repoURL, repoHash, widgetName string) error {
installPath := filepath.Join(util.DataDir, "widgets", widgetName)
err := bazaar.InstallWidget(repoURL, repoHash, installPath, Conf.System.ID)
if nil != err {
return errors.New(fmt.Sprintf(Conf.Language(46), widgetName))
return errors.New(fmt.Sprintf(Conf.Language(46), widgetName, err))
}
return nil
}
@ -163,7 +163,7 @@ func InstallBazaarIcon(repoURL, repoHash, iconName string) error {
installPath := filepath.Join(util.IconsPath, iconName)
err := bazaar.InstallIcon(repoURL, repoHash, installPath, Conf.System.ID)
if nil != err {
return errors.New(fmt.Sprintf(Conf.Language(46), iconName))
return errors.New(fmt.Sprintf(Conf.Language(46), iconName, err))
}
Conf.Appearance.Icon = iconName
Conf.Save()
@ -214,7 +214,7 @@ func InstallBazaarTheme(repoURL, repoHash, themeName string, mode int, update bo
installPath := filepath.Join(util.ThemesPath, themeName)
err := bazaar.InstallTheme(repoURL, repoHash, installPath, Conf.System.ID)
if nil != err {
return errors.New(fmt.Sprintf(Conf.Language(46), themeName))
return errors.New(fmt.Sprintf(Conf.Language(46), themeName, err))
}
if !update {
@ -270,7 +270,7 @@ func InstallBazaarTemplate(repoURL, repoHash, templateName string) error {
installPath := filepath.Join(util.DataDir, "templates", templateName)
err := bazaar.InstallTemplate(repoURL, repoHash, installPath, Conf.System.ID)
if nil != err {
return errors.New(fmt.Sprintf(Conf.Language(46), templateName))
return errors.New(fmt.Sprintf(Conf.Language(46), templateName, err))
}
return nil
}

View file

@ -564,7 +564,12 @@ func getHistoryDir(suffix string, t time.Time) (ret string, err error) {
return
}
func ReindexHistory() (err error) {
func ReindexHistory() {
task.AppendTask(task.HistoryDatabaseIndexFull, fullReindexHistory)
return
}
func fullReindexHistory() {
historyDirs, err := os.ReadDir(util.HistoryDir)
if nil != err {
logging.LogErrorf("read history dir [%s] failed: %s", util.HistoryDir, err)

View file

@ -83,7 +83,8 @@ func FlushHistoryQueue() {
if err = execHistoryOp(op, tx, context); nil != err {
tx.Rollback()
logging.LogErrorf("queue operation failed: %s", err)
continue
util.PushMsg("History database index failed, please try to manually rebuild it in [Data history - File history]", 5000)
return
}
if err = commitHistoryTx(tx); nil != err {

View file

@ -90,6 +90,7 @@ const (
DatabaseIndexFix = "task.database.index.fix" // 数据库索引订正
OCRImage = "task.ocr.image" // 图片 OCR 提取文本
HistoryGenerateDoc = "task.history.generateDoc" // 生成文件历史
HistoryDatabaseIndexFull = "task.history.database.index.full" // 历史数据库重建索引
HistoryDatabaseIndexCommit = "task.history.database.index.commit" // 历史数据库索引提交
DatabaseIndexEmbedBlock = "task.database.index.embedBlock" // 数据库索引嵌入块
ReloadUI = "task.reload.ui" // 重载 UI
@ -103,6 +104,7 @@ var uniqueActions = []string{
DatabaseIndexCommit,
OCRImage,
HistoryGenerateDoc,
HistoryDatabaseIndexFull,
HistoryDatabaseIndexCommit,
DatabaseIndexEmbedBlock,
}