mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-30 05:18:49 +01:00
🎨 Improve network img convert to local https://github.com/siyuan-note/siyuan/issues/13936
This commit is contained in:
parent
5143121ac4
commit
8e90578a21
13 changed files with 40 additions and 14 deletions
|
|
@ -1584,6 +1584,7 @@
|
|||
"251": "مجموع الأصول غير المستخدمة [%d]، [%d] فقط منها مدرج هنا",
|
||||
"252": "\uD83D\uDEA8 قد يقوم Microsoft Defender بحذف النواة عن طريق الخطأ، وحذف البيانات وتقليل الأداء بشكل كبير. يُوصى بإضافة مسار التثبيت ومسار مساحة العمل الخاصة بـ SiYuan إلى قائمة الاستثناءات<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">إضافة</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">تجاهل</button>",
|
||||
"253": "جارٍ ضغط الملف [%s]، يرجى الانتظار...",
|
||||
"254": "[Region ID] معرّف المنطقة غير صحيح، يرجى الرجوع إلى وثائق مزود خدمة S3 لتكوين معرّف المنطقة"
|
||||
"254": "[Region ID] معرّف المنطقة غير صحيح، يرجى الرجوع إلى وثائق مزود خدمة S3 لتكوين معرّف المنطقة",
|
||||
"255": "قام الموقع المستهدف بتمكين حماية الروابط المباشرة، لذلك لا يمكن تنزيل [%d] من الموارد"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1584,6 +1584,7 @@
|
|||
"251": "Insgesamt ungenutzte Assets [%d], hier nur [%d] aufgeführt",
|
||||
"252": "\uD83D\uDEA8 Microsoft Defender kann fälschlicherweise den Kernel löschen, Daten löschen und die Leistung erheblich verringern. Es wird empfohlen, den SiYuan-Installationspfad und den Arbeitsbereichspfad zur Ausschlussliste hinzuzufügen<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">Hinzufügen</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">Ignorieren</button>",
|
||||
"253": "Datei [%s] wird komprimiert, bitte warten...",
|
||||
"254": "[Region ID] Falsche Regions-ID, bitte konsultieren Sie die Dokumentation des S3-Dienstanbieters zur Konfiguration der Regions-ID"
|
||||
"254": "[Region ID] Falsche Regions-ID, bitte konsultieren Sie die Dokumentation des S3-Dienstanbieters zur Konfiguration der Regions-ID",
|
||||
"255": "Die Zielseite hat den Hotlink-Schutz aktiviert, daher ist es nicht möglich, [%d] Ressourcen herunterzuladen"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1584,6 +1584,7 @@
|
|||
"251": "Total unused assets [%d], only [%d] listed here",
|
||||
"252": "\uD83D\uDEA8 Microsoft Defender may mistakenly delete the kernel, delete data, and significantly reduce performance. It is recommended to add the SiYuan installation path and workspace path to the exclusion list<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">Add</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">Ignore</button>",
|
||||
"253": "Compressing file [%s], please wait...",
|
||||
"254": "[Region ID] Incorrect Region ID, please refer to the S3 service provider's documentation to configure the Region ID"
|
||||
"254": "[Region ID] Incorrect Region ID, please refer to the S3 service provider's documentation to configure the Region ID",
|
||||
"255": "The target site has enabled hotlink protection, so it is not possible to download [%d] resources"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1584,6 +1584,7 @@
|
|||
"251": "Total de activos no utilizados [%d], solo [%d] listados aquí",
|
||||
"252": "\uD83D\uDEA8 Microsoft Defender puede eliminar por error el núcleo, eliminar datos y reducir significativamente el rendimiento. Se recomienda agregar la ruta de instalación y el espacio de trabajo de SiYuan a la lista de exclusiones<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">Agregar</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">Ignorar</button>",
|
||||
"253": "Comprimiendo el archivo [%s], por favor espere...",
|
||||
"254": "[Region ID] ID de región incorrecto, por favor consulte la documentación del proveedor de servicios S3 para configurar el ID de región"
|
||||
"254": "[Region ID] ID de región incorrecto, por favor consulte la documentación del proveedor de servicios S3 para configurar el ID de región",
|
||||
"255": "El sitio de destino ha activado la protección contra hotlinking, por lo que no es posible descargar [%d] recursos"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1584,6 +1584,7 @@
|
|||
"251": "Total des actifs inutilisés [%d], seulement [%d] listés ici",
|
||||
"252": "\uD83D\uDEA8 Microsoft Defender peut supprimer par erreur le noyau, supprimer des données et réduire considérablement les performances. Il est recommandé d'ajouter le chemin d'installation et l'espace de travail de SiYuan à la liste des exclusions<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">Ajouter</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">Ignorer</button>",
|
||||
"253": "Compression du fichier [%s], veuillez patienter...",
|
||||
"254": "[Region ID] ID de région incorrect, veuillez consulter la documentation du fournisseur de services S3 pour configurer l'ID de région"
|
||||
"254": "[Region ID] ID de région incorrect, veuillez consulter la documentation du fournisseur de services S3 pour configurer l'ID de région",
|
||||
"255": "Le site cible a activé la protection contre le hotlinking, il est donc impossible de télécharger [%d] ressources"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1584,6 +1584,7 @@
|
|||
"251": "סך כל הנכסים שלא נעשה בהם שימוש [%d], רק [%d] מופיעים כאן",
|
||||
"252": "\uD83D\uDEA8 Microsoft Defender עלול למחוק בטעות את הליבה, למחוק נתונים ולהפחית משמעותית את הביצועים. מומלץ להוסיף את נתיב ההתקנה ונתיב סביבת העבודה של SiYuan לרשימת החריגים<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">הוסף</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">התעלם</button>",
|
||||
"253": "דוחס את הקובץ [%s], אנא המתן...",
|
||||
"254": "[Region ID] מזהה האזור שגוי, אנא עיין בתיעוד ספק שירותי S3 כדי להגדיר את מזהה האזור"
|
||||
"254": "[Region ID] מזהה האזור שגוי, אנא עיין בתיעוד ספק שירותי S3 כדי להגדיר את מזהה האזור",
|
||||
"255": "האתר היעד הפעיל הגנה על קישורים חמים, ולכן לא ניתן להוריד [%d] משאבים"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1584,6 +1584,7 @@
|
|||
"251": "Totale risorse inutilizzate [%d], qui elencate solo [%d]",
|
||||
"252": "\uD83D\uDEA8 Microsoft Defender potrebbe eliminare erroneamente il kernel, eliminare i dati e ridurre significativamente le prestazioni. Si consiglia di aggiungere il percorso di installazione e lo spazio di lavoro di SiYuan all'elenco delle esclusioni<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">Aggiungi</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">Ignora</button>",
|
||||
"253": "Compressione del file [%s], attendere prego...",
|
||||
"254": "[Region ID] ID regione non corretto, si prega di consultare la documentazione del fornitore di servizi S3 per configurare l'ID regione"
|
||||
"254": "[Region ID] ID regione non corretto, si prega di consultare la documentazione del fornitore di servizi S3 per configurare l'ID regione",
|
||||
"255": "Il sito di destinazione ha abilitato la protezione hotlink, quindi non è possibile scaricare [%d] risorse"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1584,6 +1584,7 @@
|
|||
"251": "未使用のアセットの合計 [%d]、ここにリストされているのは [%d] のみ",
|
||||
"252": "\uD83D\uDEA8 Microsoft Defender は、カーネルを誤って削除したり、データを削除したり、パフォーマンスを大幅に低下させたりする可能性があります。SiYuan のインストールパスとワークスペースパスを除外リストに追加することをお勧めします<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">追加</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">無視</button>",
|
||||
"253": "ファイル [%s] を圧縮しています、お待ちください...",
|
||||
"254": "[Region ID] リージョンIDが正しくありません。S3サービスプロバイダーのドキュメントを参照してリージョンIDを設定してください"
|
||||
"254": "[Region ID] リージョンIDが正しくありません。S3サービスプロバイダーのドキュメントを参照してリージョンIDを設定してください",
|
||||
"255": "ターゲットサイトはホットリンク保護を有効にしているため、[%d] 個のリソースをダウンロードできません"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1584,6 +1584,7 @@
|
|||
"251": "Łączna liczba nieużywanych zasobów [%d], tutaj wymieniono tylko [%d]",
|
||||
"252": "\uD83D\uDEA8 Microsoft Defender może błędnie usunąć jądro, usunąć dane i znacznie obniżyć wydajność. Zaleca się dodanie ścieżki instalacji i przestrzeni roboczej SiYuan do listy wykluczeń<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">Dodaj</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">Ignoruj</button>",
|
||||
"253": "Kompresja pliku [%s], proszę czekać...",
|
||||
"254": "[Region ID] Nieprawidłowy identyfikator regionu, proszę zapoznać się z dokumentacją dostawcy usług S3 w celu skonfigurowania identyfikatora regionu"
|
||||
"254": "[Region ID] Nieprawidłowy identyfikator regionu, proszę zapoznać się z dokumentacją dostawcy usług S3 w celu skonfigurowania identyfikatora regionu",
|
||||
"255": "Docelowa strona włączyła ochronę przed hotlinkowaniem, [%d] zasobów nie można pobrać"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1584,6 +1584,7 @@
|
|||
"251": "Всего неиспользованных активов [%d], здесь перечислены только [%d]",
|
||||
"252": "\uD83D\uDEA8 Microsoft Defender может ошибочно удалить ядро, удалить данные и значительно снизить производительность. Рекомендуется добавить путь установки и рабочее пространство SiYuan в список исключений<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">Добавить</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">Игнорировать</button>",
|
||||
"253": "Сжатие файла [%s], пожалуйста, подождите...",
|
||||
"254": "[Region ID] Неправильный идентификатор региона, пожалуйста, обратитесь к документации поставщика услуг S3 для настройки идентификатора региона"
|
||||
"254": "[Region ID] Неправильный идентификатор региона, пожалуйста, обратитесь к документации поставщика услуг S3 для настройки идентификатора региона",
|
||||
"255": "Целевой сайт включил защиту от хотлинков, [%d] ресурсов невозможно скачать"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1584,6 +1584,7 @@
|
|||
"251": "未引用資源一共 ${x} 個,這裡僅列出 ${y} 個",
|
||||
"252": "\uD83D\uDEA8 Microsoft Defender 可能會誤殺內核、誤刪數據和嚴重降低運行性能,建議將思源安裝路徑和工作空間路徑添加到排除列表<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">添加</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">忽略</button>",
|
||||
"253": "正在壓縮文件 [%s],請稍等...",
|
||||
"254": "[Region ID] 不正確,請參考 S3 服務提供商的文檔配置地域 ID"
|
||||
"254": "[Region ID] 不正確,請參考 S3 服務提供商的文檔配置地域 ID",
|
||||
"255": "目標站點啟用了防盜鏈,[%d] 個資源無法下載"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1584,6 +1584,7 @@
|
|||
"251": "未引用资源一共 [%d] 个,这里仅列出 [%d] 个",
|
||||
"252": "\uD83D\uDEA8 Microsoft Defender 可能会误杀内核、误删数据和严重降低运行性能,建议将思源安装路径和工作空间路径添加到排除列表<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">添加</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">忽略</button>",
|
||||
"253": "正在压缩文件 [%s],请稍等...",
|
||||
"254": "[Region ID] 不正确,请参考 S3 服务提供商的文档配置地域 ID"
|
||||
"254": "[Region ID] 不正确,请参考 S3 服务提供商的文档配置地域 ID",
|
||||
"255": "目标站点启用了防盗链,[%d] 个资源无法下载"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ func NetAssets2LocalAssets(rootID string, onlyImg bool, originalURL string) (err
|
|||
EnableInsecureSkipVerify().
|
||||
SetProxy(httpclient.ProxyFromEnvironment)
|
||||
|
||||
forbiddenCount := 0
|
||||
destNodes := getRemoteAssetsLinkDestsInTree(tree, onlyImg)
|
||||
for _, destNode := range destNodes {
|
||||
dests := getRemoteAssetsLinkDests(destNode, onlyImg)
|
||||
|
|
@ -172,6 +173,10 @@ func NetAssets2LocalAssets(rootID string, onlyImg bool, originalURL string) (err
|
|||
request.SetHeader("Referer", originalURL) // 改进浏览器剪藏扩展转换本地图片成功率 https://github.com/siyuan-note/siyuan/issues/7464
|
||||
}
|
||||
resp, reqErr := request.Get(u)
|
||||
if http.StatusForbidden == resp.StatusCode || http.StatusUnauthorized == resp.StatusCode {
|
||||
forbiddenCount++
|
||||
}
|
||||
|
||||
if strings.Contains(strings.ToLower(resp.GetContentType()), "text/html") {
|
||||
// 忽略超链接网页 `Convert network assets to local` no longer process webpage https://github.com/siyuan-note/siyuan/issues/9965
|
||||
continue
|
||||
|
|
@ -242,14 +247,23 @@ func NetAssets2LocalAssets(rootID string, onlyImg bool, originalURL string) (err
|
|||
}
|
||||
}
|
||||
|
||||
util.PushClearMsg(msgId)
|
||||
if 0 < files {
|
||||
util.PushUpdateMsg(msgId, Conf.Language(113), 7000)
|
||||
msgId = util.PushMsg(Conf.Language(113), 7000)
|
||||
if err = writeTreeUpsertQueue(tree); err != nil {
|
||||
return
|
||||
}
|
||||
util.PushUpdateMsg(msgId, fmt.Sprintf(Conf.Language(120), files), 5000)
|
||||
|
||||
if 0 < forbiddenCount {
|
||||
util.PushErrMsg(fmt.Sprintf(Conf.Language(255), forbiddenCount), 5000)
|
||||
}
|
||||
} else {
|
||||
util.PushUpdateMsg(msgId, Conf.Language(121), 3000)
|
||||
if 0 < forbiddenCount {
|
||||
util.PushErrMsg(fmt.Sprintf(Conf.Language(255), forbiddenCount), 5000)
|
||||
} else {
|
||||
util.PushMsg(Conf.Language(121), 3000)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue