mirror of
https://github.com/stashapp/stash.git
synced 2025-12-16 20:07:05 +03:00
UI plugin dependencies (#4307)
* Add requires field to UI plugin config * Use defer instead of async for useScript * Load plugins based on dependency * Document new field
This commit is contained in:
@@ -72,6 +72,10 @@ type PluginCSP struct {
|
||||
}
|
||||
|
||||
type UIConfig struct {
|
||||
// Requires is a list of plugin IDs that this plugin depends on.
|
||||
// These plugins will be loaded before this plugin.
|
||||
Requires []string `yaml:"requires"`
|
||||
|
||||
// Content Security Policy configuration for the plugin.
|
||||
CSP PluginCSP `yaml:"csp"`
|
||||
|
||||
@@ -239,6 +243,7 @@ func (c Config) toPlugin() *Plugin {
|
||||
Tasks: c.getPluginTasks(false),
|
||||
Hooks: c.getPluginHooks(false),
|
||||
UI: PluginUI{
|
||||
Requires: c.UI.Requires,
|
||||
ExternalScript: c.UI.getExternalScripts(),
|
||||
ExternalCSS: c.UI.getExternalCSS(),
|
||||
Javascript: c.UI.getJavascriptFiles(c),
|
||||
|
||||
@@ -42,6 +42,10 @@ type Plugin struct {
|
||||
}
|
||||
|
||||
type PluginUI struct {
|
||||
// Requires is a list of plugin IDs that this plugin depends on.
|
||||
// These plugins will be loaded before this plugin.
|
||||
Requires []string `json:"requires"`
|
||||
|
||||
// Content Security Policy configuration for the plugin.
|
||||
CSP PluginCSP `json:"csp"`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user