소스 검색

update example

cg33 6 년 전
부모
커밋
7d45043641
1개의 변경된 파일15개의 추가작업 그리고 15개의 파일을 삭제
  1. 15 15
      index.go

+ 15 - 15
index.go

@@ -52,7 +52,7 @@ func DashboardPage() (types.Panel, error) {
 		SetIcon("ion-ios-people-outline"). // svg is ok
 		GetContent()
 
-	var size = map[string]string{"md": "3", "sm": "6", "xs": "12"}
+	var size = types.SizeMD(3).SM(6).XS(12)
 	infoboxCol1 := colComp.SetSize(size).SetContent(infobox1).GetContent()
 	infoboxCol2 := colComp.SetSize(size).SetContent(infobox2).GetContent()
 	infoboxCol3 := colComp.SetSize(size).SetContent(infobox3).GetContent()
@@ -100,7 +100,7 @@ func DashboardPage() (types.Panel, error) {
 		SetFooter(`<div class="clearfix"><a href="javascript:void(0)" class="btn btn-sm btn-info btn-flat pull-left">处理订单</a><a href="javascript:void(0)" class="btn btn-sm btn-default btn-flat pull-right">查看所有新订单</a> </div>`).
 		GetContent()
 
-	tableCol := colComp.SetSize(map[string]string{"md": "8"}).SetContent(row1 + boxInfo).GetContent()
+	tableCol := colComp.SetSize(types.SizeMD(8)).SetContent(row1 + boxInfo).GetContent()
 
 	/**************************
 	 * Product List
@@ -108,28 +108,28 @@ func DashboardPage() (types.Panel, error) {
 
 	productList := productlist.New().SetData([]map[string]string{
 		{
-			"img":         "http://adminlte.io/themes/AdminLTE/dist/img/default-50x50.gif",
+			"img":         "//adminlte.io/themes/AdminLTE/dist/img/default-50x50.gif",
 			"title":       "GoAdmin",
 			"has_tabel":   "true",
 			"labeltype":   "warning",
 			"label":       "free",
 			"description": `a framework help you build the dataviz system`,
 		}, {
-			"img":         "http://adminlte.io/themes/AdminLTE/dist/img/default-50x50.gif",
+			"img":         "//adminlte.io/themes/AdminLTE/dist/img/default-50x50.gif",
 			"title":       "GoAdmin",
 			"has_tabel":   "true",
 			"labeltype":   "warning",
 			"label":       "free",
 			"description": `a framework help you build the dataviz system`,
 		}, {
-			"img":         "http://adminlte.io/themes/AdminLTE/dist/img/default-50x50.gif",
+			"img":         "//adminlte.io/themes/AdminLTE/dist/img/default-50x50.gif",
 			"title":       "GoAdmin",
 			"has_tabel":   "true",
 			"labeltype":   "warning",
 			"label":       "free",
 			"description": `a framework help you build the dataviz system`,
 		}, {
-			"img":         "http://adminlte.io/themes/AdminLTE/dist/img/default-50x50.gif",
+			"img":         "//adminlte.io/themes/AdminLTE/dist/img/default-50x50.gif",
 			"title":       "GoAdmin",
 			"has_tabel":   "true",
 			"labeltype":   "warning",
@@ -143,7 +143,7 @@ func DashboardPage() (types.Panel, error) {
 		SetFooter(`<a href="javascript:void(0)" class="uppercase">View All Products</a>`).
 		GetContent()
 
-	newsCol := colComp.SetSize(map[string]string{"md": "4"}).SetContent(boxWarning).GetContent()
+	newsCol := colComp.SetSize(types.SizeMD(4)).SetContent(boxWarning).GetContent()
 
 	row5 := components.Row().SetContent(tableCol + newsCol).GetContent()
 
@@ -203,10 +203,10 @@ func DashboardPage() (types.Panel, error) {
 		SetPercent(50).
 		GetContent()
 
-	boxInternalCol1 := colComp.SetContent(lineChart).SetSize(map[string]string{"md": "8"}).GetContent()
+	boxInternalCol1 := colComp.SetContent(lineChart).SetSize(types.SizeMD(8)).GetContent()
 	boxInternalCol2 := colComp.
 		SetContent(template.HTML(title) + progressGroup + progressGroup1 + progressGroup2 + progressGroup3).
-		SetSize(map[string]string{"md": "4"}).
+		SetSize(types.SizeMD(4)).
 		GetContent()
 
 	boxInternalRow := components.Row().SetContent(boxInternalCol1 + boxInternalCol2).GetContent()
@@ -246,7 +246,7 @@ func DashboardPage() (types.Panel, error) {
 		SetColor("green").
 		GetContent()
 
-	size2 := map[string]string{"sm": "3", "xs": "6"}
+	size2 := types.SizeSM(3).XS(6)
 	boxInternalCol3 := colComp.SetContent(description1).SetSize(size2).GetContent()
 	boxInternalCol4 := colComp.SetContent(description2).SetSize(size2).GetContent()
 	boxInternalCol5 := colComp.SetContent(description3).SetSize(size2).GetContent()
@@ -259,7 +259,7 @@ func DashboardPage() (types.Panel, error) {
 		SetFooter(boxInternalRow2).
 		GetContent()
 
-	boxcol := colComp.SetContent(box).SetSize(map[string]string{"md": "12"}).GetContent()
+	boxcol := colComp.SetContent(box).SetSize(types.SizeMD(12)).GetContent()
 	row2 := components.Row().SetContent(boxcol).GetContent()
 
 	/**************************
@@ -317,9 +317,9 @@ func DashboardPage() (types.Panel, error) {
 
 	boxDanger := components.Box().SetTheme("danger").WithHeadBorder().SetHeader("Browser Usage").
 		SetBody(components.Row().
-			SetContent(colComp.SetSize(map[string]string{"md": "8"}).
+			SetContent(colComp.SetSize(types.SizeMD(8)).
 				SetContent(pie).
-				GetContent() + colComp.SetSize(map[string]string{"md": "4"}).
+				GetContent() + colComp.SetSize(types.SizeMD(4)).
 				SetContent(legend).
 				GetContent()).GetContent()).
 		SetFooter(`<p class="text-center"><a href="javascript:void(0)" class="uppercase">View All Users</a></p>`).
@@ -381,8 +381,8 @@ func DashboardPage() (types.Panel, error) {
 		SetBody(template.HTML(popupForm)).
 		GetContent()
 
-	col5 := colComp.SetSize(map[string]string{"md": "8"}).SetContent(tabs + template.HTML(buttonTest)).GetContent()
-	col6 := colComp.SetSize(map[string]string{"md": "4"}).SetContent(boxDanger + popup).GetContent()
+	col5 := colComp.SetSize(types.SizeMD(8)).SetContent(tabs + template.HTML(buttonTest)).GetContent()
+	col6 := colComp.SetSize(types.SizeMD(4)).SetContent(boxDanger + popup).GetContent()
 
 	row4 := components.Row().SetContent(col5 + col6).GetContent()