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

This commit is contained in:
Vanessa 2023-06-04 19:27:58 +08:00
commit 00869d495b
11 changed files with 346 additions and 19 deletions

View file

@ -635,7 +635,6 @@
"sort": "Sort",
"enterFullscreen": "Enter Full Screen",
"exitFullscreen": "Exit Full Screen",
"clearUnused": "Unreferenced assets",
"clearAll": "Are you sure to clean up all unreferenced assets?",
"missingAssets": "Missing assets",
"unreferencedAssets": "Unreferenced assets",

View file

@ -635,7 +635,6 @@
"sort": "Ordenar",
"enterFullscreen": "Entrar en pantalla completa",
"exitFullscreen": "Salir de pantalla completa",
"clearUnused": "Activos no utilizados",
"clearAll": "¿Está seguro de limpiar todos los activos no referenciados?",
"missingAssets": "Activos faltantes",
"unreferencedAssets": "Activos sin referencia",

View file

@ -635,7 +635,6 @@
"sort": "Tri",
"enterFullscreen": "plein écran",
"exitFullscreen": "Quitter le plein écran",
"clearUnused": "assets non-référencés",
"clearAll": "Êtes-vous sûr de nettoyer tous les assets non référencés ?",
"missingAssets": "Actifs manquants",
"unreferencedAssets": "Actifs non référencés",

View file

@ -635,8 +635,7 @@
"sort": "排序",
"enterFullscreen": "進入全螢幕",
"exitFullscreen": "退出全螢幕",
"clearUnused": "未引用的資料",
"clearAll": "確認清理所有未引用的資料?",
"clearAll": "確認清理所有未引用的資料文件?",
"missingAssets": "丟失的資料文件",
"unreferencedAssets": "未引用的資料文件",
"paste": "貼上",

View file

@ -635,8 +635,7 @@
"sort": "排序",
"enterFullscreen": "进入全屏幕",
"exitFullscreen": "退出全屏幕",
"clearUnused": "未引用资源文件",
"clearAll": "确认清理所有未引用资源文件?",
"clearAll": "确认清理所有未引用的资源文件?",
"missingAssets": "丢失的资源文件",
"unreferencedAssets": "未引用的资源文件",
"paste": "粘贴",

View file

@ -6,7 +6,7 @@
"id": "20200924100744-br924ar",
"title": "Assets",
"type": "doc",
"updated": "20230505084035"
"updated": "20230604120806"
},
"Children": [
{
@ -497,6 +497,10 @@
"updated": "20210130103832"
},
"Children": [
{
"Type": "NodeText",
"Data": ""
},
{
"Type": "NodeTextMark",
"TextMarkType": "tag",
@ -504,7 +508,113 @@
},
{
"Type": "NodeText",
"Data": ": Using absolute paths (local or network paths) will not be included Clean up calculations."
"Data": ": Using absolute paths (local or network paths) will not be included Clean up calculations."
}
]
},
{
"ID": "20230604120616-qjigoyt",
"Type": "NodeHeading",
"HeadingLevel": 2,
"Properties": {
"id": "20230604120616-qjigoyt",
"updated": "20230604120623"
},
"Children": [
{
"Type": "NodeText",
"Data": "List missing assets"
}
]
},
{
"ID": "20230604120616-95dv931",
"Type": "NodeParagraph",
"Properties": {
"id": "20230604120616-95dv931",
"updated": "20230604120637"
},
"Children": [
{
"Type": "NodeText",
"Data": "You can view the missing resources in "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Settings"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Assets"
},
{
"Type": "NodeText",
"Data": ", and you can find the references in the global search after copying the path."
}
]
},
{
"ID": "20230604120616-tjs4mx0",
"Type": "NodeParagraph",
"Properties": {
"id": "20230604120616-tjs4mx0",
"updated": "20230604120806"
},
"Children": [
{
"Type": "NodeText",
"Data": ""
},
{
"Type": "NodeTextMark",
"TextMarkType": "tag",
"TextMarkTextContent": "Note"
},
{
"Type": "NodeText",
"Data": ": To search asset paths, you need to enable "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Settings"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Search"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Index"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Asset Path"
},
{
"Type": "NodeText",
"Data": "."
}
]
},

View file

@ -6,7 +6,7 @@
"id": "20200915214115-42b8zma",
"title": "资源文件",
"type": "doc",
"updated": "20230505083923"
"updated": "20230604120815"
},
"Children": [
{
@ -499,6 +499,10 @@
"updated": "20210512160659"
},
"Children": [
{
"Type": "NodeText",
"Data": ""
},
{
"Type": "NodeTextMark",
"TextMarkType": "tag",
@ -506,7 +510,113 @@
},
{
"Type": "NodeText",
"Data": ":使用绝对路径(本地路径或者是网络路径)不会纳入清理计算。"
"Data": "​:使用绝对路径(本地路径或者是网络路径)不会纳入清理计算。"
}
]
},
{
"ID": "20230604115545-plxx5iu",
"Type": "NodeHeading",
"HeadingLevel": 2,
"Properties": {
"id": "20230604115545-plxx5iu",
"updated": "20230604115551"
},
"Children": [
{
"Type": "NodeText",
"Data": "查看丢失资源"
}
]
},
{
"ID": "20230604115552-qqg9s4j",
"Type": "NodeParagraph",
"Properties": {
"id": "20230604115552-qqg9s4j",
"updated": "20230604115947"
},
"Children": [
{
"Type": "NodeText",
"Data": "在"
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "设置"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "资源"
},
{
"Type": "NodeText",
"Data": " 中可以查看丢失的资源,复制路径后可以在全局搜索中找到引用处。"
}
]
},
{
"ID": "20230604115950-hru51yy",
"Type": "NodeParagraph",
"Properties": {
"id": "20230604115950-hru51yy",
"updated": "20230604120815"
},
"Children": [
{
"Type": "NodeText",
"Data": ""
},
{
"Type": "NodeTextMark",
"TextMarkType": "tag",
"TextMarkTextContent": "注意"
},
{
"Type": "NodeText",
"Data": "​:搜索资源文件路径需要先启用 "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "设置"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "搜索"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "索引"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "资源文件路径"
},
{
"Type": "NodeText",
"Data": "​。"
}
]
},

View file

@ -5,7 +5,7 @@
"Properties": {
"id": "20211226123038-4umgpxy",
"title": "資料文件",
"updated": "20230505084013"
"updated": "20230604120825"
},
"Children": [
{
@ -482,6 +482,10 @@
"updated": "20211226123051"
},
"Children": [
{
"Type": "NodeText",
"Data": ""
},
{
"Type": "NodeTextMark",
"TextMarkType": "tag",
@ -489,7 +493,113 @@
},
{
"Type": "NodeText",
"Data": ":使用絕對路徑(本地路徑或者是網絡路徑)不會納入清理計算。"
"Data": "​:使用絕對路徑(本地路徑或者是網絡路徑)不會納入清理計算。"
}
]
},
{
"ID": "20230604120454-cxz64oc",
"Type": "NodeHeading",
"HeadingLevel": 2,
"Properties": {
"id": "20230604120454-cxz64oc",
"updated": "20230604120454"
},
"Children": [
{
"Type": "NodeText",
"Data": "查看丟失資源"
}
]
},
{
"ID": "20230604120454-k7wee90",
"Type": "NodeParagraph",
"Properties": {
"id": "20230604120454-k7wee90",
"updated": "20230604120520"
},
"Children": [
{
"Type": "NodeText",
"Data": "在"
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "設置"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "資料"
},
{
"Type": "NodeText",
"Data": "​中可以查看丟失的資源,複製路徑後可以在全局搜索中找到引用處。"
}
]
},
{
"ID": "20230604120454-m6jtopr",
"Type": "NodeParagraph",
"Properties": {
"id": "20230604120454-m6jtopr",
"updated": "20230604120825"
},
"Children": [
{
"Type": "NodeText",
"Data": ""
},
{
"Type": "NodeTextMark",
"TextMarkType": "tag",
"TextMarkTextContent": "注意"
},
{
"Type": "NodeText",
"Data": "​:搜索資源文件路徑需要先啟用 "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "設置"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "搜索"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "索引"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "資源文件路徑"
},
{
"Type": "NodeText",
"Data": "​。"
}
]
},

View file

@ -15,7 +15,7 @@ export const image = {
<div class="layout-tab-bar fn__flex">
<div class="item item--full item--focus" data-type="remove">
<div class="fn__flex-1"></div>
${window.siyuan.languages.clearUnused}
${window.siyuan.languages.unreferencedAssets}
<div class="fn__flex-1"></div>
</div>
<div class="item item--full" data-type="missing">
@ -57,7 +57,7 @@ export const image = {
while (target && !target.isEqualNode(image.element)) {
const type = target.getAttribute("data-type");
if (target.id === "removeAll") {
confirmDialog(window.siyuan.languages.clearUnused, `${window.siyuan.languages.clearAll}`, () => {
confirmDialog(window.siyuan.languages.deleteOpConfirm, `${window.siyuan.languages.clearAll}`, () => {
fetchPost("/api/asset/removeUnusedAssets", {}, response => {
getAllModels().asset.forEach(item => {
if (response.data.paths.includes(item.path)) {
@ -93,7 +93,7 @@ export const image = {
/// #endif
} else if (type === "clear") {
const pathString = target.parentElement.getAttribute("data-path");
confirmDialog(window.siyuan.languages.clearUnused, `${window.siyuan.languages.delete} <b>${pathPosix().basename(pathString)}</b>`, () => {
confirmDialog(window.siyuan.languages.deleteOpConfirm, `${window.siyuan.languages.delete} <b>${pathPosix().basename(pathString)}</b>`, () => {
fetchPost("/api/asset/removeUnusedAsset", {
path: pathString,
}, response => {

View file

@ -39,7 +39,7 @@ export const initConfigSearch = (element: HTMLElement, app: App) => {
"apiKeyTip", "apiProxy", "apiProxyTip", "apiBaseURL", "apiBaseURLTip"])),
// 图片
getLang(["assets", "clearUnused", "missingAssets"]),
getLang(["assets", "unreferencedAssets", "missingAssets"]),
// 导出
getLang(["paragraphBeginningSpace", "md4", "export", "export1", "export2", "export5", "export11",

View file

@ -694,8 +694,11 @@ func MissingAssets() (ret []string) {
}
luteEngine := util.NewLute()
for _, notebook := range notebooks {
dests := map[string]bool{}
if notebook.Closed {
continue
}
dests := map[string]bool{}
pages := pagedPaths(filepath.Join(util.DataDir, notebook.ID), 32)
for _, paths := range pages {
var trees []*parse.Tree
@ -738,7 +741,6 @@ func MissingAssets() (ret []string) {
ret = append(ret, dest)
continue
}
}
}