Documentation
¶
Index ¶
- Constants
- Variables
- func ThemeHandler(w http.ResponseWriter, r *http.Request)
- func ThemeMiddleware(next http.Handler) http.Handler
- func ThemeNameRetrieveFromCookie(r *http.Request) string
- func UncdnHandler(w http.ResponseWriter, r *http.Request)
- type Config
- type Dashboard
- type MenuItem
- type ThemeNameContextKey
- type User
Constants ¶
View Source
const MENU_TYPE_MODAL = "modal"
View Source
const MENU_TYPE_OFFCANVAS = "offcanvas"
View Source
const THEME_CERULEAN = "cerulean"
View Source
const THEME_COSMO = "cosmo"
View Source
const THEME_CYBORG = "cyborg"
View Source
const THEME_DARKLY = "darkly"
View Source
const THEME_DEFAULT = "bootstrap"
View Source
const THEME_FLATLY = "flatly"
View Source
const THEME_JOURNAL = "journal"
View Source
const THEME_LITERA = "litera"
View Source
const THEME_LUMEN = "lumen"
View Source
const THEME_LUX = "lux"
View Source
const THEME_MATERIA = "materia"
View Source
const THEME_MINTY = "minty"
View Source
const THEME_MORPH = "morph"
View Source
const THEME_PULSE = "pulse"
View Source
const THEME_QUARTZ = "quartz"
View Source
const THEME_SANDSTONE = "sandstone"
View Source
const THEME_SIMPLEX = "simplex"
View Source
const THEME_SKETCHY = "sketchy"
View Source
const THEME_SLATE = "slate"
View Source
const THEME_SOLAR = "solar"
View Source
const THEME_SPACELAB = "spacelab"
View Source
const THEME_SUPERHERO = "superhero"
View Source
const THEME_UNITED = "united"
View Source
const THEME_VAPOR = "vapor"
View Source
const THEME_YETI = "yeti"
View Source
const THEME_ZEPHYR = "zephyr"
Variables ¶
View Source
var THEME_COOKIE_KEY = "theme"
Functions ¶
func ThemeHandler ¶ added in v0.0.12
func ThemeHandler(w http.ResponseWriter, r *http.Request)
ThemeHandler checks for the supplied theme and sets the theme name in the session
func ThemeNameRetrieveFromCookie ¶ added in v0.0.12
func UncdnHandler ¶ added in v0.0.12
func UncdnHandler(w http.ResponseWriter, r *http.Request)
Types ¶
type Config ¶
type Config struct {
Content string
FaviconURL string
HTTPRequest *http.Request
LogoURL string
// Should the menu text be shown
MenuShowText bool
// The menu items to display in the main menu
MenuItems []MenuItem
// MenuType can be MENU_TYPE_OFFCANVAS or MENU_TYPE_MODAL
MenuType string
// Optional. The URL of the logo image
LogoImageURL string
// Optional. Raw HTML of the logo, if set will be used instead of logoImageURL
LogoRawHtml string
// Optional. The redirect URL of the logo image
LogoRedirectURL string
NavbarBackgroundColorMode string
NavbarBackgroundColor string
NavbarTextColor string
// Optional. The URL of the login page to use (if user is not provided)
LoginURL string
// Optional. The URL of the register page to use (if user is not provided)
RegisterURL string
// Optional. Menu for Quick Access
QuickAccessMenu []MenuItem
RedirectTime string
RedirectUrl string
Scripts []string
ScriptURLs []string
Styles []string
StyleURLs []string
// Optional. The theme to be activated on the dashboard (default will be used otherwise)
Theme string
// Optional. The URL of the theme switcher endpoint to use
ThemeHandlerUrl string
// Optional. The theme names to be visible in the theme switcher, the key is the theme, the value is the name (can be customized, default will be used otherwise)
ThemesRestrict map[string]string
Title string
UncdnHandlerEndpoint string
User User
UserMenu []MenuItem
}
type Dashboard ¶
type Dashboard struct {
// contains filtered or unexported fields
}
func NewDashboard ¶
NewDashboard creates a new Dashboard instance based on the given configuration.
The function takes a Config struct as its parameter and returns a pointer to a Dashboard struct.
Parameters: - config: A Config struct containing the configuration for the dashboard.
Returns: - A pointer to a Dashboard struct.
func (*Dashboard) DashboardLayoutMenu ¶ added in v0.4.0
func (*Dashboard) SetMenuItems ¶ added in v1.6.1
func (*Dashboard) SetUserMenuItems ¶ added in v1.6.1
type MenuItem ¶
type MenuItem struct {
Title string
URL string
Target string
Icon string
Sequence int
Children []MenuItem
}
MenuItem is a menu item for the dashboard.
type ThemeNameContextKey ¶ added in v0.0.12
type ThemeNameContextKey struct{}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.