自定义页面


    1. package datamodel
    2. import (
    3. "github.com/GoAdminGroup/go-admin/modules/config"
    4. template2 "github.com/GoAdminGroup/go-admin/template"
    5. "github.com/GoAdminGroup/go-admin/template/types"
    6. "html/template"
    7. )
    8. components := template2.Get(config.Get().THEME)
    9. colComp := components.Col()
    10. infobox := components.InfoBox().
    11. SetText("CPU TRAFFIC").
    12. SetColor("blue").
    13. SetNumber("41,410").
    14. SetIcon("ion-ios-gear-outline").
    15. var size = map[string]string{"md": "3", "sm": "6", "xs": "12"}
    16. infoboxCol1 := colComp.SetSize(size).SetContent(infobox).GetContent()
    17. row1 := components.Row().SetContent(infoboxCol1).GetContent()
    18. return types.Panel{
    19. Content: row1,
    20. Title: "Dashboard",
    21. Description: "this is a example",
    22. }