diff --git a/packages/web_ui/src/components/PluginsPage.tsx b/packages/web_ui/src/components/PluginsPage.tsx
index e8b4121e..52e7d85c 100644
--- a/packages/web_ui/src/components/PluginsPage.tsx
+++ b/packages/web_ui/src/components/PluginsPage.tsx
@@ -1,9 +1,8 @@
import React, { useContext, useEffect, useState } from "react";
-import { Space, Table, Typography } from "antd";
+import { Space, Table, Tooltip, Typography } from "antd";
import CloseCircleFilled from "@ant-design/icons/CloseCircleFilled";
-import InfoCircleFilled from "@ant-design/icons/InfoCircleFilled";
-import type { PluginWebApi, PluginWebEnvInfo } from "@clusterio/lib";
+import type { PluginWebApi } from "@clusterio/lib";
import notify from "../util/notify";
import { useAccount } from "../model/account";
@@ -28,8 +27,7 @@ type PluginRow = {
title: string;
/** Not present for plugins the controller hasn't loaded */
meta?: PluginWebApi;
- info?: PluginWebEnvInfo;
- package?: any;
+ webError?: string;
status?: PluginStatus;
};
@@ -38,31 +36,15 @@ function pluginPath(plugin: PluginRow) {
return `/plugins/${encodeURIComponent(plugin.meta?.name ?? plugin.key)}/view`;
}
-function WebUiStatus(props: { plugin: PluginRow }) {
- const control = useContext(ControlContext);
- const { meta } = props.plugin;
- if (!meta) {
- return Not on controller;
- }
- if (!meta.enabled) {
- return <> Disabled on controller>;
- }
- if (!meta.web.main && !meta.web.error) {
- return No web module;
- }
- if (!meta.web.error && !control.pluginInfos.has(meta.name)) {
- return <> Reload page to load>;
- }
- if (!props.plugin.package) {
- return <> Error loading module>;
- }
- if (props.plugin.package.version !== meta.version) {
- return <> Version mis-matched>;
- }
- return <>Loaded {meta.version}>;
+/** Shown with the versions when the plugin's web code failed to load */
+function WebError(props: { error: string }) {
+ return
+
+ Web interface failed to load
+
+
;
}
-
export default function PluginsPage() {
const control = useContext(ControlContext);
const account = useAccount();
@@ -95,14 +77,12 @@ export default function PluginsPage() {
let tableContents: PluginRow[] = [];
for (let meta of pluginList) {
const key = pluginStatusKey(meta);
- const loaded = control.loadedPlugins.get(meta.name);
- const info = loaded ?? control.pluginInfos.get(meta.name);
+ const info = control.pluginInfos.get(meta.name);
tableContents.push({
key,
title: info ? info.title : meta.name,
meta,
- info,
- package: loaded?.package,
+ webError: meta.enabled ? meta.web.error ?? info?.error : undefined,
status: statuses.get(key),
});
}
@@ -151,16 +131,12 @@ export default function PluginsPage() {
{
title: "Versions",
key: "versions",
- render: (_, plugin) => (plugin.status
- ?
- : plugin.meta?.version
- ),
- },
- {
- title: "Web UI Status",
- key: "web",
- render: (_, plugin) => ,
- responsive: ["sm"],
+ render: (_, plugin) => <>
+ {plugin.status
+ ?
+ : plugin.meta?.version}
+ {plugin.webError && }
+ >,
},
{
key: "actions",