mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-21 08:03:13 +09:00
Update all pages to use PageHeader
This commit is contained in:
1 parent
51657bea44
commit
1f47f6dfc9
6 files changed
+12
-10
No files matched your search
@@ -10,7 +10,7 @@ import React, {
|
|||||||
// } from "antd";
|
// } from "antd";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BaseWebPlugin, PageLayout, Control, ControlContext, notifyErrorHandler,
|
BaseWebPlugin, PageLayout, PageHeader, Control, ControlContext, notifyErrorHandler,
|
||||||
} from "@clusterio/web_ui";
|
} from "@clusterio/web_ui";
|
||||||
//%if multi_context // Subscribing requires multi context
|
//%if multi_context // Subscribing requires multi context
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ function MyTemplatePage() {
|
|||||||
//%endif
|
//%endif
|
||||||
|
|
||||||
return <PageLayout nav={[{ name: "__plugin_name__" }]}>
|
return <PageLayout nav={[{ name: "__plugin_name__" }]}>
|
||||||
<h2>__plugin_name__</h2>
|
<PageHeader title="__plugin_name__" />
|
||||||
//%if controller // Subscribing requires web content and the controller
|
//%if controller // Subscribing requires web content and the controller
|
||||||
Synced: {String(synced)} Data: {JSON.stringify([...subscribableData.values()])}
|
Synced: {String(synced)} Data: {JSON.stringify([...subscribableData.values()])}
|
||||||
//%endif
|
//%endif
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import React, {
|
|||||||
// } from "antd";
|
// } from "antd";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BaseWebPlugin, PageLayout, Control, ControlContext, notifyErrorHandler,
|
BaseWebPlugin, PageLayout, PageHeader, Control, ControlContext, notifyErrorHandler,
|
||||||
} from "@clusterio/web_ui";
|
} from "@clusterio/web_ui";
|
||||||
//%if multi_context // Subscribing requires multi context
|
//%if multi_context // Subscribing requires multi context
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ function MyTemplatePage() {
|
|||||||
//%endif
|
//%endif
|
||||||
|
|
||||||
return <PageLayout nav={[{ name: "__plugin_name__" }]}>
|
return <PageLayout nav={[{ name: "__plugin_name__" }]}>
|
||||||
<h2>__plugin_name__</h2>
|
<PageHeader title="__plugin_name__" />
|
||||||
//%if controller // Subscribing requires web content and the controller
|
//%if controller // Subscribing requires web content and the controller
|
||||||
Synced: {String(synced)} Data: {JSON.stringify([...subscribableData.values()])}
|
Synced: {String(synced)} Data: {JSON.stringify([...subscribableData.values()])}
|
||||||
//%endif
|
//%endif
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import type { PluginWebApi } from "@clusterio/lib";
|
|||||||
|
|
||||||
import ControlContext from "./ControlContext";
|
import ControlContext from "./ControlContext";
|
||||||
import PageLayout from "./PageLayout";
|
import PageLayout from "./PageLayout";
|
||||||
|
import PageHeader from "./PageHeader";
|
||||||
import notify from "../util/notify";
|
import notify from "../util/notify";
|
||||||
|
|
||||||
export default function PluginViewPage() {
|
export default function PluginViewPage() {
|
||||||
@@ -39,7 +40,7 @@ export default function PluginViewPage() {
|
|||||||
let pluginMeta = pluginList.find(p => p.name === pluginName);
|
let pluginMeta = pluginList.find(p => p.name === pluginName);
|
||||||
if (!pluginMeta) {
|
if (!pluginMeta) {
|
||||||
return <PageLayout nav={nav}>
|
return <PageLayout nav={nav}>
|
||||||
<h2>Plugin not found</h2>
|
<PageHeader title="Plugin not found" />
|
||||||
<p>Plugin with name {pluginName} was not found on the controller.</p>
|
<p>Plugin with name {pluginName} was not found on the controller.</p>
|
||||||
</PageLayout>;
|
</PageLayout>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import type { PluginWebApi } from "@clusterio/lib";
|
|||||||
import notify from "../util/notify";
|
import notify from "../util/notify";
|
||||||
import ControlContext from "./ControlContext";
|
import ControlContext from "./ControlContext";
|
||||||
import PageLayout from "./PageLayout";
|
import PageLayout from "./PageLayout";
|
||||||
|
import PageHeader from "./PageHeader";
|
||||||
|
|
||||||
const strcmp = new Intl.Collator(undefined, { numeric: true, sensitivity: "base" }).compare;
|
const strcmp = new Intl.Collator(undefined, { numeric: true, sensitivity: "base" }).compare;
|
||||||
|
|
||||||
@@ -47,7 +48,7 @@ export default function PluginsPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return <PageLayout nav={[{ name: "Plugins" }]}>
|
return <PageLayout nav={[{ name: "Plugins" }]}>
|
||||||
<h2>Plugins</h2>
|
<PageHeader title="Plugins" />
|
||||||
<Table
|
<Table
|
||||||
columns={[
|
columns={[
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useContext, useEffect, useState } from "react";
|
import React, { useContext, useEffect, useState } from "react";
|
||||||
|
|
||||||
import { BaseWebPlugin, PageLayout, ControlContext } from "@clusterio/web_ui";
|
import { BaseWebPlugin, PageLayout, PageHeader, ControlContext } from "@clusterio/web_ui";
|
||||||
import { DatabaseStatsRequest, DatabaseStatsResponse } from "../messages";
|
import { DatabaseStatsRequest, DatabaseStatsResponse } from "../messages";
|
||||||
|
|
||||||
import "./style.css";
|
import "./style.css";
|
||||||
@@ -18,7 +18,7 @@ function InventoryPage() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return <PageLayout nav={[{ name: "Inventory sync" }]}>
|
return <PageLayout nav={[{ name: "Inventory sync" }]}>
|
||||||
<h2>Inventory sync</h2>
|
<PageHeader title="Inventory sync" />
|
||||||
{statsData && <>
|
{statsData && <>
|
||||||
<p>Database size: {Math.round(statsData.databaseSize / 1000)}kB</p>
|
<p>Database size: {Math.round(statsData.databaseSize / 1000)}kB</p>
|
||||||
<p>Database entries: {statsData.databaseEntries}</p>
|
<p>Database entries: {statsData.databaseEntries}</p>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Input, Table, Typography } from "antd";
|
|||||||
|
|
||||||
import * as lib from "@clusterio/lib";
|
import * as lib from "@clusterio/lib";
|
||||||
import {
|
import {
|
||||||
BaseWebPlugin, PageLayout, Control, ControlContext,
|
BaseWebPlugin, PageLayout, PageHeader, Control, ControlContext,
|
||||||
notifyErrorHandler, useItemMetadata, useLocale,
|
notifyErrorHandler, useItemMetadata, useLocale,
|
||||||
} from "@clusterio/web_ui";
|
} from "@clusterio/web_ui";
|
||||||
import { GetStorageRequest, Item, SetStorageSubscriptionRequest, UpdateStorageEvent } from "../messages";
|
import { GetStorageRequest, Item, SetStorageSubscriptionRequest, UpdateStorageEvent } from "../messages";
|
||||||
@@ -60,7 +60,7 @@ function StoragePage() {
|
|||||||
let numberFormat = new Intl.NumberFormat("en-US");
|
let numberFormat = new Intl.NumberFormat("en-US");
|
||||||
|
|
||||||
return <PageLayout nav={[{ name: "Storage" }]}>
|
return <PageLayout nav={[{ name: "Storage" }]}>
|
||||||
<h2>Storage</h2>
|
<PageHeader title="Storage" />
|
||||||
<Paragraph>
|
<Paragraph>
|
||||||
<Input
|
<Input
|
||||||
placeholder="Search"
|
placeholder="Search"
|
||||||
|
|||||||
Reference in new issue
Block a user