mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 07:30:41 +09:00
Add PluginsContext to web_ui
Add a React context to access the plugins loaded in the web interface. The info, /api/plugins metadata and webpack container is provided for each plugin.
This commit is contained in:
1 parent
d0befe5944
commit
3a3a7597bf
3 files changed
+28
-16
No files matched your search
@@ -7,6 +7,7 @@ import { logger } from "@clusterio/lib/logging";
|
||||
import basename from "../basename";
|
||||
import SiteLayout from "./SiteLayout";
|
||||
import ControlContext from "./ControlContext";
|
||||
import PluginsContext from "./PluginsContext";
|
||||
import LoginForm from "./LoginForm";
|
||||
|
||||
import { Card, Spin } from "antd";
|
||||
@@ -77,9 +78,11 @@ export default function App(props) {
|
||||
|
||||
return (
|
||||
<ControlContext.Provider value={props.control}>
|
||||
<BrowserRouter basename={basename}>
|
||||
{page}
|
||||
</BrowserRouter>
|
||||
<PluginsContext.Provider value={props.plugins}>
|
||||
<BrowserRouter basename={basename}>
|
||||
{page}
|
||||
</BrowserRouter>
|
||||
</PluginsContext.Provider>
|
||||
</ControlContext.Provider>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import React from "react";
|
||||
|
||||
export default React.createContext();
|
||||
Reference in new issue
Block a user