mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 07:43:12 +09:00
Make web pages pluggable
Refactor the page handling of the web interface to allow plugins to add their own pages.
This commit is contained in:
1 parent
73c713462c
commit
3d26371fa9
3 files changed
+67
-41
No files matched your search
@@ -439,6 +439,21 @@ class BaseControlPlugin {
|
||||
* form.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Plugin supplied pages
|
||||
* @typedef {Object} module:Lib/plugin~Page
|
||||
* @property {string} path - URL path to this page.
|
||||
* @property {string=} sidebarPath -
|
||||
* If present and this path matches one of the pages in the sidebar it
|
||||
* will cause that sidebar entry to be highlighted as active.
|
||||
* @property {string=} sidebarName -
|
||||
* If present creates an entry in the sidebar for this page with the
|
||||
* given text.
|
||||
* @property {ReactNode} content -
|
||||
* A react node which is rendered when this page is navigated to.
|
||||
* Should render a PageLayout.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Base class for web interface plugins
|
||||
*
|
||||
@@ -477,6 +492,13 @@ class BaseWebPlugin {
|
||||
* @type {Array<module:lib/plugin~LoginForm>}
|
||||
*/
|
||||
this.loginForms = [];
|
||||
|
||||
/**
|
||||
* List of pages provided by this plugin
|
||||
*
|
||||
* @type {Array<module:lib/plugin~Page>}
|
||||
*/
|
||||
this.pages = [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user