diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy index e7fab76ff..930aaaa5a 100644 --- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy +++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy @@ -7,7 +7,7 @@ "id": "20200924100950-9op5xi1", "title": "Shortcuts", "type": "doc", - "updated": "20240426233832" + "updated": "20240428230146" }, "Children": [ { @@ -10745,7 +10745,7 @@ "Properties": { "colgroup": "||", "id": "20221105230832-4q1qwpt", - "updated": "20221105231226" + "updated": "20240428230146" }, "Children": [ { @@ -11109,7 +11109,7 @@ "Children": [ { "Type": "NodeText", - "Data": "Collapse/expand all subsets" + "Data": "Collapse/expand all sub-levels" } ] }, @@ -11152,6 +11152,60 @@ ] } ] + }, + { + "Type": "NodeTableRow", + "Data": "tr", + "Children": [ + { + "Type": "NodeTableCell", + "Data": "td", + "Children": [ + { + "Type": "NodeText", + "Data": "Expand and insert last child" + } + ] + }, + { + "Type": "NodeTableCell", + "Data": "td", + "Children": [ + { + "Type": "NodeText", + "Data": "​" + }, + { + "Type": "NodeTextMark", + "TextMarkType": "kbd", + "TextMarkTextContent": "Alt+Enter" + }, + { + "Type": "NodeText", + "Data": "​ / " + }, + { + "Type": "NodeTextMark", + "TextMarkType": "kbd", + "TextMarkTextContent": "⌥Enter" + }, + { + "Type": "NodeText", + "Data": "​" + } + ] + }, + { + "Type": "NodeTableCell", + "Data": "td", + "Children": [ + { + "Type": "NodeText", + "Data": "Cursor in folded item" + } + ] + } + ] } ] }, diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy index 31bdfcba6..a82a05fd0 100644 --- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy +++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy @@ -7,7 +7,7 @@ "id": "20200813004551-gm0pbn1", "title": "快捷键", "type": "doc", - "updated": "20240426233401" + "updated": "20240428230058" }, "Children": [ { @@ -10728,7 +10728,7 @@ "Properties": { "colgroup": "||", "id": "20221105225614-a4zp7mm", - "updated": "20221105230438" + "updated": "20240428230058" }, "Children": [ { @@ -11084,7 +11084,7 @@ "Children": [ { "Type": "NodeText", - "Data": "折叠/展开所有子集" + "Data": "折叠/展开所有子级" } ] }, @@ -11127,6 +11127,60 @@ ] } ] + }, + { + "Type": "NodeTableRow", + "Data": "tr", + "Children": [ + { + "Type": "NodeTableCell", + "Data": "td", + "Children": [ + { + "Type": "NodeText", + "Data": "展开并插入末尾子项" + } + ] + }, + { + "Type": "NodeTableCell", + "Data": "td", + "Children": [ + { + "Type": "NodeText", + "Data": "​" + }, + { + "Type": "NodeTextMark", + "TextMarkType": "kbd", + "TextMarkTextContent": "Alt+Enter" + }, + { + "Type": "NodeText", + "Data": "​ / " + }, + { + "Type": "NodeTextMark", + "TextMarkType": "kbd", + "TextMarkTextContent": "⌥Enter" + }, + { + "Type": "NodeText", + "Data": "​" + } + ] + }, + { + "Type": "NodeTableCell", + "Data": "td", + "Children": [ + { + "Type": "NodeText", + "Data": "光标在折叠项中" + } + ] + } + ] } ] }, diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy index 9f8c21106..582ebec16 100644 --- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy +++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy @@ -7,7 +7,7 @@ "id": "20211226122549-jktxego", "title": "快捷鍵", "type": "doc", - "updated": "20240426233618" + "updated": "20240428230152" }, "Children": [ { @@ -11147,7 +11147,7 @@ "Properties": { "colgroup": "||", "id": "20221105230755-x4ktugr", - "updated": "20221105231222" + "updated": "20240428230152" }, "Children": [ { @@ -11161,8 +11161,6 @@ { "Type": "NodeTableCell", "Data": "th", - "TableCellContentWidth": 6, - "TableCellContentMaxWidth": 21, "Children": [ { "Type": "NodeText", @@ -11173,8 +11171,6 @@ { "Type": "NodeTableCell", "Data": "th", - "TableCellContentWidth": 6, - "TableCellContentMaxWidth": 11, "Children": [ { "Type": "NodeText", @@ -11185,8 +11181,6 @@ { "Type": "NodeTableCell", "Data": "th", - "TableCellContentWidth": 6, - "TableCellContentMaxWidth": 14, "Children": [ { "Type": "NodeText", @@ -11205,8 +11199,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 6, - "TableCellContentMaxWidth": 21, "Children": [ { "Type": "NodeText", @@ -11217,8 +11209,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 6, - "TableCellContentMaxWidth": 11, "Children": [ { "Type": "NodeText", @@ -11238,8 +11228,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 14, - "TableCellContentMaxWidth": 14, "Children": [ { "Type": "NodeText", @@ -11256,8 +11244,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 10, - "TableCellContentMaxWidth": 21, "Children": [ { "Type": "NodeText", @@ -11268,8 +11254,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 6, - "TableCellContentMaxWidth": 11, "Children": [ { "Type": "NodeText", @@ -11289,8 +11273,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 14, - "TableCellContentMaxWidth": 14, "Children": [ { "Type": "NodeText", @@ -11307,8 +11289,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 10, - "TableCellContentMaxWidth": 21, "Children": [ { "Type": "NodeText", @@ -11319,8 +11299,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 11, - "TableCellContentMaxWidth": 11, "Children": [ { "Type": "NodeText", @@ -11349,8 +11327,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 14, - "TableCellContentMaxWidth": 14, "Children": [ { "Type": "NodeText", @@ -11367,8 +11343,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 21, - "TableCellContentMaxWidth": 21, "Children": [ { "Type": "NodeText", @@ -11383,8 +11357,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 11, - "TableCellContentMaxWidth": 11, "Children": [ { "Type": "NodeText", @@ -11413,8 +11385,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 14, - "TableCellContentMaxWidth": 14, "Children": [ { "Type": "NodeText", @@ -11431,8 +11401,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 8, - "TableCellContentMaxWidth": 21, "Children": [ { "Type": "NodeText", @@ -11447,8 +11415,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 11, - "TableCellContentMaxWidth": 11, "Children": [ { "Type": "NodeText", @@ -11477,8 +11443,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 14, - "TableCellContentMaxWidth": 14, "Children": [ { "Type": "NodeText", @@ -11495,8 +11459,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 19, - "TableCellContentMaxWidth": 21, "Children": [ { "Type": "NodeText", @@ -11507,8 +11469,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 6, - "TableCellContentMaxWidth": 11, "Children": [ { "Type": "NodeText", @@ -11528,8 +11488,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 12, - "TableCellContentMaxWidth": 14, "Children": [ { "Type": "NodeText", @@ -11546,20 +11504,16 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 19, - "TableCellContentMaxWidth": 21, "Children": [ { "Type": "NodeText", - "Data": "折疊/展開所有子集" + "Data": "折疊/展開所有子級" } ] }, { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 11, - "TableCellContentMaxWidth": 11, "Children": [ { "Type": "NodeText", @@ -11588,8 +11542,6 @@ { "Type": "NodeTableCell", "Data": "td", - "TableCellContentWidth": 12, - "TableCellContentMaxWidth": 14, "Children": [ { "Type": "NodeText", @@ -11598,6 +11550,60 @@ ] } ] + }, + { + "Type": "NodeTableRow", + "Data": "tr", + "Children": [ + { + "Type": "NodeTableCell", + "Data": "td", + "Children": [ + { + "Type": "NodeText", + "Data": "展開並插入末尾子項" + } + ] + }, + { + "Type": "NodeTableCell", + "Data": "td", + "Children": [ + { + "Type": "NodeText", + "Data": "​" + }, + { + "Type": "NodeTextMark", + "TextMarkType": "kbd", + "TextMarkTextContent": "Alt+Enter" + }, + { + "Type": "NodeText", + "Data": "​ / " + }, + { + "Type": "NodeTextMark", + "TextMarkType": "kbd", + "TextMarkTextContent": "⌥Enter" + }, + { + "Type": "NodeText", + "Data": "​" + } + ] + }, + { + "Type": "NodeTableCell", + "Data": "td", + "Children": [ + { + "Type": "NodeText", + "Data": "遊標在折疊項中" + } + ] + } + ] } ] }, diff --git a/app/src/config/bazaar.ts b/app/src/config/bazaar.ts index 63b4c9a12..db2dbb63b 100644 --- a/app/src/config/bazaar.ts +++ b/app/src/config/bazaar.ts @@ -530,8 +530,10 @@ export const bazaar = {
${window.siyuan.languages.currentVer}
v${data.version}
${dataObj.downloaded ? window.siyuan.languages.installDate : window.siyuan.languages.releaseDate}
${dataObj.downloaded ? data.hInstallDate : data.hUpdated}
+
+
${window.siyuan.languages.pkgSize}
${data.hSize}
-
${dataObj.downloaded ? window.siyuan.languages.installSize : window.siyuan.languages.pkgSize}
${dataObj.downloaded ? data.hInstallSize : data.hSize}
+
${window.siyuan.languages.installSize}
${data.hInstallSize}
diff --git a/kernel/bazaar/icon.go b/kernel/bazaar/icon.go index 4ab2fd850..b7e509c2e 100644 --- a/kernel/bazaar/icon.go +++ b/kernel/bazaar/icon.go @@ -89,6 +89,9 @@ func Icons() (icons []*Icon) { icon.OpenIssues = repo.OpenIssues icon.Size = repo.Size icon.HSize = humanize.BytesCustomCeil(uint64(icon.Size), 2) + icon.InstallSize = repo.InstallSize + icon.HInstallSize = humanize.BytesCustomCeil(uint64(icon.InstallSize), 2) + packageInstallSizeCache.SetDefault(icon.RepoURL, icon.InstallSize) icon.HUpdated = formatUpdated(icon.Updated) pkg := bazaarIndex[strings.Split(repoURL, "@")[0]] if nil != pkg { @@ -156,9 +159,14 @@ func InstalledIcons() (ret []*Icon) { continue } icon.HInstallDate = info.ModTime().Format("2006-01-02") - installSize, _ := util.SizeOfDirectory(installPath) - icon.InstallSize = installSize - icon.HInstallSize = humanize.BytesCustomCeil(uint64(installSize), 2) + if installSize, ok := packageInstallSizeCache.Get(icon.RepoURL); ok { + icon.InstallSize = installSize.(int64) + } else { + is, _ := util.SizeOfDirectory(installPath) + icon.InstallSize = is + packageInstallSizeCache.SetDefault(icon.RepoURL, is) + } + icon.HInstallSize = humanize.BytesCustomCeil(uint64(icon.InstallSize), 2) readmeFilename := getPreferredReadme(icon.Readme) readme, readErr := os.ReadFile(filepath.Join(installPath, readmeFilename)) if nil != readErr { diff --git a/kernel/bazaar/package.go b/kernel/bazaar/package.go index aa9f63841..636d923a5 100644 --- a/kernel/bazaar/package.go +++ b/kernel/bazaar/package.go @@ -121,11 +121,12 @@ type StagePackage struct { } type StageRepo struct { - URL string `json:"url"` - Updated string `json:"updated"` - Stars int `json:"stars"` - OpenIssues int `json:"openIssues"` - Size int64 `json:"size"` + URL string `json:"url"` + Updated string `json:"updated"` + Stars int `json:"stars"` + OpenIssues int `json:"openIssues"` + Size int64 `json:"size"` + InstallSize int64 `json:"installSize"` Package *StagePackage `json:"package"` } @@ -703,3 +704,5 @@ func disallowDisplayBazaarPackage(pkg *Package) bool { } var packageCache = gcache.New(6*time.Hour, 30*time.Minute) // [repoURL]*Package + +var packageInstallSizeCache = gcache.New(48*time.Hour, 6*time.Hour) // [repoURL]*int64 diff --git a/kernel/bazaar/plugin.go b/kernel/bazaar/plugin.go index c8ecf3c40..9bc6bd29d 100644 --- a/kernel/bazaar/plugin.go +++ b/kernel/bazaar/plugin.go @@ -94,6 +94,9 @@ func Plugins(frontend string) (plugins []*Plugin) { plugin.OpenIssues = repo.OpenIssues plugin.Size = repo.Size plugin.HSize = humanize.BytesCustomCeil(uint64(plugin.Size), 2) + plugin.InstallSize = repo.InstallSize + plugin.HInstallSize = humanize.BytesCustomCeil(uint64(plugin.InstallSize), 2) + packageInstallSizeCache.SetDefault(plugin.RepoURL, plugin.InstallSize) plugin.HUpdated = formatUpdated(plugin.Updated) pkg := bazaarIndex[strings.Split(repoURL, "@")[0]] if nil != pkg { @@ -194,9 +197,14 @@ func InstalledPlugins(frontend string, checkUpdate bool) (ret []*Plugin) { continue } plugin.HInstallDate = info.ModTime().Format("2006-01-02") - installSize, _ := util.SizeOfDirectory(installPath) - plugin.InstallSize = installSize - plugin.HInstallSize = humanize.BytesCustomCeil(uint64(installSize), 2) + if installSize, ok := packageInstallSizeCache.Get(plugin.RepoURL); ok { + plugin.InstallSize = installSize.(int64) + } else { + is, _ := util.SizeOfDirectory(installPath) + plugin.InstallSize = is + packageInstallSizeCache.SetDefault(plugin.RepoURL, is) + } + plugin.HInstallSize = humanize.BytesCustomCeil(uint64(plugin.InstallSize), 2) readmeFilename := getPreferredReadme(plugin.Readme) readme, readErr := os.ReadFile(filepath.Join(installPath, readmeFilename)) if nil != readErr { diff --git a/kernel/bazaar/template.go b/kernel/bazaar/template.go index ef813b4dd..d7f850fab 100644 --- a/kernel/bazaar/template.go +++ b/kernel/bazaar/template.go @@ -90,6 +90,9 @@ func Templates() (templates []*Template) { template.OpenIssues = repo.OpenIssues template.Size = repo.Size template.HSize = humanize.BytesCustomCeil(uint64(template.Size), 2) + template.InstallSize = repo.InstallSize + template.HInstallSize = humanize.BytesCustomCeil(uint64(template.InstallSize), 2) + packageInstallSizeCache.SetDefault(template.RepoURL, template.InstallSize) template.HUpdated = formatUpdated(template.Updated) pkg := bazaarIndex[strings.Split(repoURL, "@")[0]] if nil != pkg { @@ -157,9 +160,14 @@ func InstalledTemplates() (ret []*Template) { continue } template.HInstallDate = info.ModTime().Format("2006-01-02") - installSize, _ := util.SizeOfDirectory(installPath) - template.InstallSize = installSize - template.HInstallSize = humanize.BytesCustomCeil(uint64(installSize), 2) + if installSize, ok := packageInstallSizeCache.Get(template.RepoURL); ok { + template.InstallSize = installSize.(int64) + } else { + is, _ := util.SizeOfDirectory(installPath) + template.InstallSize = is + packageInstallSizeCache.SetDefault(template.RepoURL, is) + } + template.HInstallSize = humanize.BytesCustomCeil(uint64(template.InstallSize), 2) readmeFilename := getPreferredReadme(template.Readme) readme, readErr := os.ReadFile(filepath.Join(installPath, readmeFilename)) if nil != readErr { diff --git a/kernel/bazaar/theme.go b/kernel/bazaar/theme.go index a3d7fa7d2..c5d9d1222 100644 --- a/kernel/bazaar/theme.go +++ b/kernel/bazaar/theme.go @@ -91,6 +91,9 @@ func Themes() (ret []*Theme) { theme.OpenIssues = repo.OpenIssues theme.Size = repo.Size theme.HSize = humanize.BytesCustomCeil(uint64(theme.Size), 2) + theme.InstallSize = repo.InstallSize + theme.HInstallSize = humanize.BytesCustomCeil(uint64(theme.InstallSize), 2) + packageInstallSizeCache.SetDefault(theme.RepoURL, theme.InstallSize) theme.HUpdated = formatUpdated(theme.Updated) pkg := bazaarIndex[strings.Split(repoURL, "@")[0]] if nil != pkg { @@ -158,9 +161,14 @@ func InstalledThemes() (ret []*Theme) { continue } theme.HInstallDate = info.ModTime().Format("2006-01-02") - installSize, _ := util.SizeOfDirectory(installPath) - theme.InstallSize = installSize - theme.HInstallSize = humanize.BytesCustomCeil(uint64(installSize), 2) + if installSize, ok := packageInstallSizeCache.Get(theme.RepoURL); ok { + theme.InstallSize = installSize.(int64) + } else { + is, _ := util.SizeOfDirectory(installPath) + theme.InstallSize = is + packageInstallSizeCache.SetDefault(theme.RepoURL, is) + } + theme.HInstallSize = humanize.BytesCustomCeil(uint64(theme.InstallSize), 2) readmeFilename := getPreferredReadme(theme.Readme) readme, readErr := os.ReadFile(filepath.Join(installPath, readmeFilename)) if nil != readErr { diff --git a/kernel/bazaar/widget.go b/kernel/bazaar/widget.go index bea10a0fc..2d4b7a312 100644 --- a/kernel/bazaar/widget.go +++ b/kernel/bazaar/widget.go @@ -90,6 +90,9 @@ func Widgets() (widgets []*Widget) { widget.OpenIssues = repo.OpenIssues widget.Size = repo.Size widget.HSize = humanize.BytesCustomCeil(uint64(widget.Size), 2) + widget.InstallSize = repo.InstallSize + widget.HInstallSize = humanize.BytesCustomCeil(uint64(widget.InstallSize), 2) + packageInstallSizeCache.SetDefault(widget.RepoURL, widget.InstallSize) widget.HUpdated = formatUpdated(widget.Updated) pkg := bazaarIndex[strings.Split(repoURL, "@")[0]] if nil != pkg { @@ -155,9 +158,14 @@ func InstalledWidgets() (ret []*Widget) { continue } widget.HInstallDate = info.ModTime().Format("2006-01-02") - installSize, _ := util.SizeOfDirectory(installPath) - widget.InstallSize = installSize - widget.HInstallSize = humanize.BytesCustomCeil(uint64(installSize), 2) + if installSize, ok := packageInstallSizeCache.Get(widget.RepoURL); ok { + widget.InstallSize = installSize.(int64) + } else { + is, _ := util.SizeOfDirectory(installPath) + widget.InstallSize = is + packageInstallSizeCache.SetDefault(widget.RepoURL, is) + } + widget.HInstallSize = humanize.BytesCustomCeil(uint64(widget.InstallSize), 2) readmeFilename := getPreferredReadme(widget.Readme) readme, readErr := os.ReadFile(filepath.Join(installPath, readmeFilename)) if nil != readErr {