Documentation
¶
Overview ¶
Package web implements the HTML templating and web frontend configuration
Index ¶
- Variables
- func Init(rawConfig json.RawMessage) error
- func RenderTemplate(rw http.ResponseWriter, file string, page *Page)
- func ServeFiles() http.Handler
- func StaticFileExists(path string) bool
- type Build
- type ClusterConfig
- type JobListConfig
- type JobViewConfig
- type MetricConfig
- type NodeListConfig
- type Page
- type PlotConfiguration
- type SubClusterConfig
- type WebConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var UIDefaults = WebConfig{ JobList: JobListConfig{ UsePaging: false, ShowFootprint: false, }, NodeList: NodeListConfig{ UsePaging: false, }, JobView: JobViewConfig{ ShowPolarPlot: true, ShowFootprint: false, ShowRoofline: true, ShowStatTable: true, }, MetricConfig: MetricConfig{ JobListMetrics: []string{"cpu_load", "flops_any", "mem_bw", "mem_used"}, JobViewPlotMetrics: []string{"cpu_load", "flops_any", "mem_bw", "mem_used"}, JobViewTableMetrics: []string{"flops_any", "mem_bw", "mem_used"}, }, PlotConfiguration: PlotConfiguration{ ColorBackground: true, PlotsPerRow: 3, LineWidth: 3, ColorScheme: []string{"#00bfff", "#0000ff", "#ff00ff", "#ff0000", "#ff8000", "#ffff00", "#80ff00"}, }, }
View Source
var UIDefaultsMap map[string]any
Functions ¶
func Init ¶ added in v1.5.0
func Init(rawConfig json.RawMessage) error
func RenderTemplate ¶
func RenderTemplate(rw http.ResponseWriter, file string, page *Page)
func ServeFiles ¶
func StaticFileExists ¶ added in v1.5.0
StaticFileExists checks whether a static file exists in the embedded frontend FS.
Types ¶
type ClusterConfig ¶ added in v1.5.0
type ClusterConfig struct {
Name string `json:"name"`
JobListMetrics []string `json:"job-list-metrics"`
JobViewPlotMetrics []string `json:"job-view-plot-metrics"`
JobViewTableMetrics []string `json:"job-view-table-metrics"`
SubClusters []SubClusterConfig `json:"sub-clusters"`
}
type JobListConfig ¶ added in v1.5.0
type JobViewConfig ¶ added in v1.5.0
type MetricConfig ¶ added in v1.5.0
type MetricConfig struct {
JobListMetrics []string `json:"job-list-metrics"`
JobViewPlotMetrics []string `json:"job-view-plot-metrics"`
JobViewTableMetrics []string `json:"job-view-table-metrics"`
Clusters []ClusterConfig `json:"clusters"`
}
type NodeListConfig ¶ added in v1.5.0
type NodeListConfig struct {
UsePaging bool `json:"use-paging"`
}
type Page ¶
type Page struct {
Title string // Page title
MsgType string // For generic use in message boxes
Message string // For generic use in message boxes
User schema.User // Information about the currently logged in user (Full User Info)
Roles map[string]schema.Role // Available roles for frontend render checks
Build Build // Latest information about the application
Clusters []string // List of all cluster names
SubClusters map[string][]string // Map per cluster of all subClusters for use in the Header
FilterPresets map[string]any // For pages with the Filter component, this can be used to set initial filters.
Infos map[string]any // For generic use (e.g. username for /monitoring/user/<id>, job id for /monitoring/job/<id>)
Config map[string]any // UI settings for the currently logged in user (e.g. line width, ...)
Resampling *config.ResampleConfig // If not nil, defines resampling trigger and resolutions
Redirect string // The originally requested URL, for intermediate login handling
}
type PlotConfiguration ¶ added in v1.5.0
type SubClusterConfig ¶ added in v1.5.0
type WebConfig ¶ added in v1.5.0
type WebConfig struct {
JobList JobListConfig `json:"job-list"`
NodeList NodeListConfig `json:"node-list"`
JobView JobViewConfig `json:"job-view"`
MetricConfig MetricConfig `json:"metric-config"`
PlotConfiguration PlotConfiguration `json:"plot-configuration"`
}
Click to show internal directories.
Click to hide internal directories.