From 47063f4afc07e03b069e5d734d10a910864137bd Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 2 Dec 2022 11:27:41 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E8=87=AA=E5=8A=A8=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8C=85=E6=97=B6=E5=9C=A8=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=A0=8F=E6=98=BE=E7=A4=BA=E4=B8=8B=E8=BD=BD=E8=BF=9B=E5=BA=A6?= =?UTF-8?q?=20Fix=20https://github.com/siyuan-note/siyuan/issues/6763?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/appearance/langs/en_US.json | 2 +- app/appearance/langs/es_ES.json | 2 +- app/appearance/langs/fr_FR.json | 2 +- app/appearance/langs/zh_CHT.json | 2 +- app/appearance/langs/zh_CN.json | 2 +- kernel/go.sum | 2 -- kernel/model/updater.go | 19 +++++++++++-------- 7 files changed, 16 insertions(+), 15 deletions(-) diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json index a9e05eecb..7163a796d 100644 --- a/app/appearance/langs/en_US.json +++ b/app/appearance/langs/en_US.json @@ -966,7 +966,7 @@ "130": "Starting new version installer...", "131": "This operation is not supported, please go to the cloud storage provider management console to operate", "132": "The current search method does not support the replace operation, please use the [Keyword] or [Regex] search method", - "133": "TODO", + "133": "Downloading update installation package [%s]", "134": "In order to prevent the newly restored data from being overwritten by synchronization, the data synchronization function has been automatically suspended", "135": "Unable to decrypt data. Make sure to use the same key on multiple devices, then create a new cloud directory to sync", "136": "Initializing data repository key...", diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index 22092f6e0..25a12ff64 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -966,7 +966,7 @@ "130": "Iniciando instalador de nueva versión...", "131": "Esta solicitud no es compatible, vaya a la consola de administración del proveedor de almacenamiento en la nube para operar", "132": "El método de búsqueda actual no admite la operación de reemplazo, utilice el método de búsqueda [Palabra clave] o [Regex]", - "133": "TODO", + "133": "Descargando paquete de instalación de actualización [%s]", "134": "Para evitar que los datos recién restaurados sean sobrescritos por la sincronización, se ha suspendido automáticamente la función de sincronización de datos", "135": "No se pueden descifrar los datos. Asegúrese de usar la misma clave en varios dispositivos, luego cree un nuevo directorio en la nube para sincronizar", "136": "Inicializando la clave del repositorio de datos...", diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index 49010ddfa..702650537 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -966,7 +966,7 @@ "130": "Démarrage du programme d'installation de la nouvelle version...", "131": "Cette opération n'est pas prise en charge, veuillez vous rendre sur la console de gestion du fournisseur de stockage cloud pour opérer", "132": "La méthode de recherche actuelle ne prend pas en charge l'opération de remplacement, veuillez utiliser la méthode de recherche [Mot-clé] ou [Regex]", - "133": "TODO", + "133": "Téléchargement du package d'installation de la mise à jour [%s]", "134": "Afin d'éviter que les données nouvellement restaurées ne soient écrasées par la synchronisation, la fonction de synchronisation des données a été automatiquement suspendue", "135": "Impossible de déchiffrer les données. Assurez-vous d'utiliser la même clé sur plusieurs appareils, puis créez un nouveau répertoire cloud à synchroniser", "136": "Initialisation de la clé du référentiel de données...", diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json index 0892be438..9edf17004 100644 --- a/app/appearance/langs/zh_CHT.json +++ b/app/appearance/langs/zh_CHT.json @@ -966,7 +966,7 @@ "130": "正在啟動新版本安裝程序...", "131": "不支持該操作,請到雲端存儲提供商管理控制台進行操作", "132": "當前搜索方式下不支持替換操作,請使用 [關鍵字] 或 [正則表達式] 搜索方式", - "133": "TODO", + "133": "正在下載更新安裝包 [%s]", "134": "為避免剛恢復的數據被同步覆蓋,數據同步功能已被自動暫停", "135": "無法解密數據。請確保多個設備上使用相同的密鑰,然後創建新的雲端目錄進行同步", "136": "初始化數據倉庫密鑰...", diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json index 1f24f52b8..474fc1c72 100644 --- a/app/appearance/langs/zh_CN.json +++ b/app/appearance/langs/zh_CN.json @@ -966,7 +966,7 @@ "130": "正在启动新版本安装程序...", "131": "不支持该操作,请到云端存储提供商管理控制台进行操作", "132": "当前搜索方式下不支持替换操作,请使用 [关键字] 或 [正则表达式] 搜索方式", - "133": "TODO", + "133": "正在下载更新安装包 [%s]", "134": "为避免刚恢复的数据被同步覆盖,数据同步功能已被自动暂停", "135": "无法解密数据。请确保多个设备上使用相同的密钥,然后创建新的云端目录进行同步", "136": "初始化数据仓库密钥...", diff --git a/kernel/go.sum b/kernel/go.sum index 9fd7999d0..420221893 100644 --- a/kernel/go.sum +++ b/kernel/go.sum @@ -17,8 +17,6 @@ github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5 h1:8HdZozCsXS github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/88250/gulu v1.2.3-0.20221117052724-cd06804db798 h1:sR/s/Y9wyl79ZRCUERwLPo9zqaB3KhNRodCMTJ4ozEU= github.com/88250/gulu v1.2.3-0.20221117052724-cd06804db798/go.mod h1:I1qBzsksFL2ciGSuqDE7R3XW4BUMrfDgOvSXEk7FsAI= -github.com/88250/lute v1.7.5-0.20221127023213-58e68b736ec6 h1:PPvmmr+yKBI9pkGvbyTwYjEWySrd0zKLRV8z6mkJlTs= -github.com/88250/lute v1.7.5-0.20221127023213-58e68b736ec6/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA= github.com/88250/lute v1.7.5-0.20221129095549-dbe2b67d3205 h1:PqqI3Ny0WWvwGjHEGGQK2BObrBh8KP2oD3iq6Mg+kLg= github.com/88250/lute v1.7.5-0.20221129095549-dbe2b67d3205/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA= github.com/88250/pdfcpu v0.3.13 h1:touMWMZkCGalMIbEg9bxYp7rETM+zwb9hXjwhqi4I7Q= diff --git a/kernel/model/updater.go b/kernel/model/updater.go index ff43d3cfa..a9c19176f 100644 --- a/kernel/model/updater.go +++ b/kernel/model/updater.go @@ -138,12 +138,12 @@ func getUpdatePkg() (downloadPkgURLs []string, checksum string, err error) { } pkg := "siyuan-" + ver + "-" + suffix - url := "https://github.com/siyuan-note/siyuan/releases/download/v" + ver + "/" + pkg - downloadPkgURLs = append(downloadPkgURLs, url) - url = "https://ghproxy.com/" + url - downloadPkgURLs = append(downloadPkgURLs, url) - url = "https://release.b3log.org/siyuan/" + pkg - downloadPkgURLs = append(downloadPkgURLs, url) + b3logURL := "https://release.b3log.org/siyuan/" + pkg + downloadPkgURLs = append(downloadPkgURLs, b3logURL) + githubURL := "https://github.com/siyuan-note/siyuan/releases/download/v" + ver + "/" + pkg + ghproxyURL := "https://ghproxy.com/" + githubURL + downloadPkgURLs = append(downloadPkgURLs, ghproxyURL) + downloadPkgURLs = append(downloadPkgURLs, githubURL) checksums := result["checksums"].(map[string]interface{}) checksum = checksums[pkg].(string) @@ -173,9 +173,11 @@ func downloadInstallPkg(pkgURL, checksum string) (err error) { logging.LogInfof("downloading install package [%s]", pkgURL) client := req.C().SetTLSHandshakeTimeout(7 * time.Second).SetTimeout(10 * time.Minute) callback := func(info req.DownloadInfo) { - //logging.LogDebugf("downloading install package [%s %.2f%%]", pkgURL, float64(info.DownloadedSize)/float64(info.Response.ContentLength)*100.0) + progress := fmt.Sprintf("%.2f%%", float64(info.DownloadedSize)/float64(info.Response.ContentLength)*100.0) + // logging.LogDebugf("downloading install package [%s %s]", pkgURL, progress) + util.PushStatusBar(fmt.Sprintf(Conf.Language(133), progress)) } - _, err = client.R().SetOutputFile(savePath).SetDownloadCallback(callback).Get(pkgURL) + _, err = client.R().SetOutputFile(savePath).SetDownloadCallbackWithInterval(callback, 1*time.Second).Get(pkgURL) if nil != err { logging.LogErrorf("download install package [%s] failed: %s", pkgURL, err) return @@ -187,6 +189,7 @@ func downloadInstallPkg(pkgURL, checksum string) (err error) { return } logging.LogInfof("downloaded install package [%s] to [%s]", pkgURL, savePath) + util.PushStatusBar(Conf.Language(62)) return }