Jelajahi Sumber

fixed error

cg33 6 tahun lalu
induk
melakukan
f6906b91ce
2 mengubah file dengan 23 tambahan dan 32 penghapusan
  1. 22 31
      index.go
  2. 1 1
      tables/external.go

+ 22 - 31
index.go

@@ -63,42 +63,33 @@ func DashboardPage() (types.Panel, error) {
 	 * Box
 	/**************************/
 
-	table := components.Table().SetType("table").SetInfoList([]map[string]template.HTML{
+	table := components.Table().SetType("table").SetInfoList([]map[string]types.InfoItem{
 		{
-			"Order ID":   "OR9842",
-			"Item":       "Call of Duty IV",
-			"Status":     "shipped",
-			"Popularity": "90%",
+			"Order ID":   {Content: "OR9842"},
+			"Item":       {Content: "Call of Duty IV"},
+			"Status":     {Content: "shipped"},
+			"Popularity": {Content: "90%"},
 		}, {
-			"Order ID":   "OR9842",
-			"Item":       "Call of Duty IV",
-			"Status":     "shipped",
-			"Popularity": "90%",
+			"Order ID":   {Content: "OR9842"},
+			"Item":       {Content: "Call of Duty IV"},
+			"Status":     {Content: "shipped"},
+			"Popularity": {Content: "90%"},
 		}, {
-			"Order ID":   "OR9842",
-			"Item":       "Call of Duty IV",
-			"Status":     "shipped",
-			"Popularity": "90%",
+			"Order ID":   {Content: "OR9842"},
+			"Item":       {Content: "Call of Duty IV"},
+			"Status":     {Content: "shipped"},
+			"Popularity": {Content: "90%"},
 		}, {
-			"Order ID":   "OR9842",
-			"Item":       "Call of Duty IV",
-			"Status":     "shipped",
-			"Popularity": "90%",
-		},
-	}).SetThead([]map[string]string{
-		{
-			"head":     "Order ID",
-			"sortable": "0",
-		}, {
-			"head":     "Item",
-			"sortable": "0",
-		}, {
-			"head":     "Status",
-			"sortable": "0",
-		}, {
-			"head":     "Popularity",
-			"sortable": "0",
+			"Order ID":   {Content: "OR9842"},
+			"Item":       {Content: "Call of Duty IV"},
+			"Status":     {Content: "shipped"},
+			"Popularity": {Content: "90%"},
 		},
+	}).SetThead(types.Thead{
+		{Head: "Order ID"},
+		{Head: "Item"},
+		{Head: "Status"},
+		{Head: "Popularity"},
 	}).GetContent()
 
 	boxInfo := components.Box().

+ 1 - 1
tables/external.go

@@ -14,7 +14,7 @@ func GetExternalTable(ctx *context.Context) (externalTable table.Table) {
 	externalTable = table.NewDefaultTable(table.DefaultConfig())
 
 	info := externalTable.GetInfo()
-	info.AddField("ID", "id", db.Bigint).FieldSortable()
+	info.AddField("ID", "id", db.Int).FieldSortable()
 	info.AddField("Title", "title", db.Varchar)
 
 	info.SetTable("external").