Skip to content
This repository was archived by the owner on Apr 23, 2024. It is now read-only.

Latest commit

 

History

History
61 lines (39 loc) · 2.02 KB

general.md

File metadata and controls

61 lines (39 loc) · 2.02 KB

General Configuration

You could customize Admin with AdminConfig struct when initializing it, here are some general configurations:

type AdminConfig struct {
  SiteName       string
  DB             *gorm.DB
  Auth           Auth
  SessionManager session.ManagerInterface
  I18n           I18n
  AssetFS        assetfs.Interface
  *Transformer
}

Dashboard

QOR Admin provides a default dashboard page with some dummy text. If you want to customize the dashboard, you can create a file dashboard.tmpl in QOR view paths, QOR Admin will load it as Golang templates when rendering the dashboard page.

If you want to disable the dashboard, you can redirect it to some other page, for example:

Admin.GetRouter().Get("/", func(c *admin.Context) {
  http.Redirect(c.Writer, c.Request, "/admin/clients", http.StatusSeeOther)
})