mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 16:13:12 +09:00
Let plugins add actions to page dropdowns
Adds control.hooks.pageActions. A plugin returns a function per page (ControllerPage, HostViewPage, InstanceViewPage, UserViewPage) that is called during render and returns menu items. Keys are prefixed with the plugin name. Plugin items go after the built-in ones and before stop and delete. The user page and instance templates get a More dropdown only when a plugin adds actions. Closes #1243 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8692ea3941
commit
86befd1231
10 files changed
+180
-9
No files matched your search
@@ -12,6 +12,7 @@ import { InputInstanceTemplate } from "./components/InputInstance";
|
||||
import { InputTargetVersion, InputPartialVersion, InputFullVersion } from "./components/InputVersion";
|
||||
import { Control, ControlConnector } from "./util/websocket";
|
||||
import { loadedPluginSetKey } from "./util/pluginSet";
|
||||
import { pageActionsFromHooks } from "./util/plugin_actions";
|
||||
import * as WebPlugin from "./BaseWebPlugin";
|
||||
import { pages } from "./pages";
|
||||
|
||||
@@ -209,6 +210,7 @@ export default async function bootstrap() {
|
||||
|
||||
control.inputComponents = await inputComponentsFromHooks(control);
|
||||
control.extensionComponents = await extensionComponentsFromHooks(control);
|
||||
control.pageActions = await pageActionsFromHooks(control.hooks);
|
||||
control.loginForms = await loginFormsFromHooks(control);
|
||||
control.pages = await pagesFromHooks(control);
|
||||
|
||||
|
||||
Reference in new issue
Block a user