Browse Source

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

Vanessa 7 months ago
parent
commit
47f79a6289

+ 6 - 6
app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20201204184532-3qm9l8n.sy

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

+ 6 - 6
app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20201204181006-7bkppue.sy

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

+ 6 - 6
app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226123004-dplpw0o.sy

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

+ 6 - 6
app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-6x9ivi7.sy

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

+ 3 - 0
kernel/api/asset.go

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

+ 3 - 0
kernel/model/assets.go

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

+ 2 - 6
kernel/model/box.go

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