mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 18:02:30 +08:00
feat(apps): minor progress
This commit is contained in:
@ -26,13 +26,18 @@ type AppPlugin struct {
|
||||
Enabled bool `json:"-"`
|
||||
}
|
||||
|
||||
func (p *AppPlugin) Load(decoder *json.Decoder, pluginDir string) error {
|
||||
if err := decoder.Decode(&p); err != nil {
|
||||
func (app *AppPlugin) Load(decoder *json.Decoder, pluginDir string) error {
|
||||
if err := decoder.Decode(&app); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
p.PluginDir = pluginDir
|
||||
p.initFrontendPlugin()
|
||||
Apps[p.Id] = p
|
||||
if app.Css != nil {
|
||||
app.Css.Dark = evalRelativePluginUrlPath(app.Css.Dark, app.Id)
|
||||
app.Css.Light = evalRelativePluginUrlPath(app.Css.Light, app.Id)
|
||||
}
|
||||
|
||||
app.PluginDir = pluginDir
|
||||
app.initFrontendPlugin()
|
||||
Apps[app.Id] = app
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user