mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 07:33:12 +09:00
Sets restart required when a plugin is updated (#794)
* Template type for load plugin config * Add plugin update checking * Add restart icon to instance list * Add tests * Log package name when failing to read package json
This commit is contained in:
1 parent
41151d47f0
commit
73cc019d2f
11 files changed
+228
-49
No files matched your search
@@ -34,9 +34,10 @@ function ControllerControlButton({ canRestart, restartRequired }: ControllerCont
|
||||
actions.push({
|
||||
key: "restart",
|
||||
label: (
|
||||
<Tooltip title={restartRequired ? "Restart Required" : null}>
|
||||
Restart {restartRequired ? <ExclamationCircleOutlined style={{ color: "yellow" }}/> : undefined}
|
||||
</Tooltip>
|
||||
!restartRequired ? "Restart" : <Tooltip title={"Restart Required"}><Space>
|
||||
<ExclamationCircleOutlined style={{ color: "yellow" }}/>
|
||||
Restart
|
||||
</Space></Tooltip>
|
||||
),
|
||||
onClick: () => {
|
||||
control.send(
|
||||
|
||||
@@ -37,9 +37,10 @@ function HostControlButton({ hostId, canRestart, restartRequired }: HostControlB
|
||||
actions.push({
|
||||
key: "restart",
|
||||
label: (
|
||||
<Tooltip title={restartRequired ? "Restart Required" : null}>
|
||||
Restart {restartRequired ? <ExclamationCircleOutlined style={{ color: "yellow" }}/> : undefined}
|
||||
</Tooltip>
|
||||
!restartRequired ? "Restart" : <Tooltip title={"Restart Required"}><Space>
|
||||
<ExclamationCircleOutlined style={{ color: "yellow" }}/>
|
||||
Restart
|
||||
</Space></Tooltip>
|
||||
),
|
||||
onClick: () => {
|
||||
control.sendTo(
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import React from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { message, Button, Table } from "antd";
|
||||
import { message, Button, Table, Space } from "antd";
|
||||
import CopyOutlined from "@ant-design/icons/CopyOutlined";
|
||||
import type { SizeType } from "antd/es/config-provider/SizeContext";
|
||||
import type { ColumnsType } from "antd/es/table";
|
||||
|
||||
import { useAccount } from "../model/account";
|
||||
import { useSystems } from "../model/system";
|
||||
import { useHosts } from "../model/host";
|
||||
import { RestartRequired } from "./system_metrics";
|
||||
import InstanceStatusTag from "./InstanceStatusTag";
|
||||
import InstanceControlButton, { InstanceControlButtonPermissions } from "./InstanceControlButton";
|
||||
import * as lib from "@clusterio/lib";
|
||||
@@ -25,6 +27,7 @@ export default function InstanceList(props: InstanceListProps) {
|
||||
let account = useAccount();
|
||||
let navigate = useNavigate();
|
||||
let [hosts] = useHosts();
|
||||
const [systems] = useSystems();
|
||||
|
||||
function hostName(hostId?: number) {
|
||||
if (hostId === undefined) {
|
||||
@@ -50,12 +53,15 @@ export default function InstanceList(props: InstanceListProps) {
|
||||
{
|
||||
title: "Assigned Host",
|
||||
key: "assignedHost",
|
||||
render: (_, instance) => <Link
|
||||
to={`/hosts/${instance.assignedHost}/view`}
|
||||
onClick={e => e.stopPropagation()}
|
||||
>
|
||||
{hostName(instance.assignedHost)}
|
||||
</Link>,
|
||||
render: (_, instance) => <Space>
|
||||
<Link
|
||||
to={`/hosts/${instance.assignedHost}/view`}
|
||||
onClick={e => e.stopPropagation()}
|
||||
>
|
||||
{hostName(instance.assignedHost)}
|
||||
</Link>
|
||||
<RestartRequired system={instance.assignedHost ? systems.get(instance.assignedHost) : undefined}/>
|
||||
</Space>,
|
||||
sorter: (a, b) => strcmp(hostName(a.assignedHost), hostName(b.assignedHost)),
|
||||
responsive: ["sm"],
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user