Convert inventory_sync to entrypoint functions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Opus 5.5 committed 2026-10-08 05:15:00 +00:00
1 parent b2705b8788
commit 1ca0c658b9
4 files changed
+215 -225

No files matched your search

+12 -12
View File
@@ -1,6 +1,6 @@
import React, { useContext, useEffect, useState } from "react";
import { BaseWebPlugin, PageLayout, PageHeader, ControlContext } from "@clusterio/web_ui";
import { PageLayout, PageHeader, ControlContext, type WebPluginContext } from "@clusterio/web_ui";
import { DatabaseStatsRequest, DatabaseStatsResponse } from "../messages.js";
import "./style.css";
@@ -27,15 +27,15 @@ function InventoryPage() {
</PageLayout>;
}
export class WebPlugin extends BaseWebPlugin {
async init() {
this.pages = [
{
path: "/inventory",
sidebarName: "Inventory sync",
permission: "inventory_sync.inventory.view",
content: <InventoryPage />,
},
];
}
export default async function(context: WebPluginContext) {
const { control, plugin } = context;
control.hooks.pages.attach(plugin.name, () => [
{
path: "/inventory",
sidebarName: "Inventory sync",
permission: "inventory_sync.inventory.view",
content: <InventoryPage />,
},
]);
}