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

This commit is contained in:
Vanessa 2024-12-24 19:49:34 +08:00
commit 47f79a6289
7 changed files with 32 additions and 30 deletions

View file

@ -6,7 +6,7 @@
"id": "20201204184532-3qm9l8n",
"title": "Template snippet",
"type": "doc",
"updated": "20241213215714"
"updated": "20241224162810"
},
"Children": [
{
@ -57,7 +57,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20210104091444-jy56z0p",
"updated": "20241213215714"
"updated": "20241224162810"
},
"Children": [
{
@ -215,7 +215,7 @@
"ListData": {},
"Properties": {
"id": "20210104091444-mwbvc9m",
"updated": "20241213215714"
"updated": "20241224162810"
},
"Children": [
{
@ -484,7 +484,7 @@
},
"Properties": {
"id": "20210504093232-vukp34t",
"updated": "20240403151002"
"updated": "20241224162810"
},
"Children": [
{
@ -516,7 +516,7 @@
"IsFencedCodeBlock": true,
"Properties": {
"id": "20241213215606-a1mq6zf",
"updated": "20241213215606"
"updated": "20241224162810"
},
"Children": [
{
@ -528,7 +528,7 @@
},
{
"Type": "NodeCodeBlockCode",
"Data": " .action{querySQL \"SELECT * FROM spans LIMIT ?\" \"3\"}\n"
"Data": " .action{querySpans \"SELECT * FROM spans LIMIT ?\" \"3\"}\n"
},
{
"Type": "NodeCodeBlockFenceCloseMarker",

View file

@ -6,7 +6,7 @@
"id": "20201204181006-7bkppue",
"title": "模板片段",
"type": "doc",
"updated": "20241213215655"
"updated": "20241224162826"
},
"Children": [
{
@ -69,7 +69,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20210104091309-fhb549c",
"updated": "20241213215655"
"updated": "20241224162826"
},
"Children": [
{
@ -237,7 +237,7 @@
"ListData": {},
"Properties": {
"id": "20210104091309-gjkg3u5",
"updated": "20241213215655"
"updated": "20241224162826"
},
"Children": [
{
@ -506,7 +506,7 @@
},
"Properties": {
"id": "20210504093313-4aoyxd0",
"updated": "20241213215416"
"updated": "20241224162826"
},
"Children": [
{
@ -538,7 +538,7 @@
"IsFencedCodeBlock": true,
"Properties": {
"id": "20241213215337-rhkoc8k",
"updated": "20241213215416"
"updated": "20241224162826"
},
"Children": [
{
@ -550,7 +550,7 @@
},
{
"Type": "NodeCodeBlockCode",
"Data": " .action{querySQL \"SELECT * FROM spans LIMIT ?\" \"3\"}\n"
"Data": " .action{querySpans \"SELECT * FROM spans LIMIT ?\" \"3\"}\n"
},
{
"Type": "NodeCodeBlockFenceCloseMarker",

View file

@ -6,7 +6,7 @@
"id": "20211226123004-dplpw0o",
"title": "範本片段",
"type": "doc",
"updated": "20241213215707"
"updated": "20241224162821"
},
"Children": [
{
@ -53,7 +53,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20211226123024-eyagqur",
"updated": "20241213215707"
"updated": "20241224162821"
},
"Children": [
{
@ -208,7 +208,7 @@
"ListData": {},
"Properties": {
"id": "20211226123024-pjvw31z",
"updated": "20241213215707"
"updated": "20241224162821"
},
"Children": [
{
@ -477,7 +477,7 @@
},
"Properties": {
"id": "20211226123024-69kddle",
"updated": "20240403150944"
"updated": "20241224162821"
},
"Children": [
{
@ -509,7 +509,7 @@
"IsFencedCodeBlock": true,
"Properties": {
"id": "20241213215524-9an3khb",
"updated": "20241213215524"
"updated": "20241224162821"
},
"Children": [
{
@ -521,7 +521,7 @@
},
{
"Type": "NodeCodeBlockCode",
"Data": " .action{querySQL \"SELECT * FROM spans LIMIT ?\" \"3\"}\n"
"Data": " .action{querySpans \"SELECT * FROM spans LIMIT ?\" \"3\"}\n"
},
{
"Type": "NodeCodeBlockFenceCloseMarker",

View file

@ -7,7 +7,7 @@
"id": "20240530101000-6x9ivi7",
"title": "テンプレートスニペット",
"type": "doc",
"updated": "20241213215720"
"updated": "20241224162728"
},
"Children": [
{
@ -66,7 +66,7 @@
"Properties": {
"ID": "20240530101000-5nvn9ad",
"id": "20240530101000-pi05yzt",
"updated": "20241213215720"
"updated": "20241224162728"
},
"Children": [
{
@ -226,7 +226,7 @@
"ListData": {},
"Properties": {
"id": "20240530101000-by5hqnb",
"updated": "20241213215720"
"updated": "20241224162728"
},
"Children": [
{
@ -495,7 +495,7 @@
},
"Properties": {
"id": "20240530101000-238ctfi",
"updated": "20240530101000"
"updated": "20241224162728"
},
"Children": [
{
@ -527,7 +527,7 @@
"IsFencedCodeBlock": true,
"Properties": {
"id": "20241213215619-gkqs282",
"updated": "20241213215619"
"updated": "20241224162728"
},
"Children": [
{
@ -539,7 +539,7 @@
},
{
"Type": "NodeCodeBlockCode",
"Data": " .action{querySQL \"SELECT * FROM spans LIMIT ?\" \"3\"}\n"
"Data": " .action{querySpans \"SELECT * FROM spans LIMIT ?\" \"3\"}\n"
},
{
"Type": "NodeCodeBlockFenceCloseMarker",

View file

@ -57,6 +57,9 @@ func statAsset(c *gin.Context) {
if strings.Contains(p, ":") {
p = strings.TrimPrefix(p, "/")
}
if strings.Contains(p, "?") {
p = p[:strings.Index(p, "?")]
}
} else {
ret.Code = 1
return

View file

@ -116,6 +116,9 @@ func NetAssets2LocalAssets(rootID string, onlyImg bool, originalURL string) (err
if strings.Contains(u, ":") {
u = strings.TrimPrefix(u, "/")
}
if strings.Contains(u, "?") {
u = u[:strings.Index(u, "?")]
}
if !gulu.File.IsExist(u) || gulu.File.IsDir(u) {
continue

View file

@ -154,8 +154,6 @@ func ListNotebooks() (ret []*Box, err error) {
sort.Slice(ret, func(i, j int) bool {
return util.PinYinCompare(ret[j].Name, ret[i].Name)
})
case util.SortModeUpdatedASC:
case util.SortModeUpdatedDESC:
case util.SortModeAlphanumASC:
sort.Slice(ret, func(i, j int) bool {
return util.NaturalCompare(ret[i].Name, ret[j].Name)
@ -166,12 +164,10 @@ func ListNotebooks() (ret []*Box, err error) {
})
case util.SortModeCustom:
sort.Slice(ret, func(i, j int) bool { return ret[i].Sort < ret[j].Sort })
case util.SortModeRefCountASC:
case util.SortModeRefCountDESC:
case util.SortModeCreatedASC:
sort.Slice(ret, func(i, j int) bool { return util.NaturalCompare(ret[j].ID, ret[i].ID) })
sort.Slice(ret, func(i, j int) bool { return ret[i].ID < ret[j].ID })
case util.SortModeCreatedDESC:
sort.Slice(ret, func(i, j int) bool { return util.NaturalCompare(ret[j].ID, ret[i].ID) })
sort.Slice(ret, func(i, j int) bool { return ret[i].ID > ret[j].ID })
}
return
}