mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-21 16:13:12 +09:00
1 parent
d6b0e88dda
commit
bcda88710e
1 file changed
+12
-5
@@ -1,6 +1,6 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { Link, useNavigate } from "react-router-dom";
|
||||||
import { message, Button, Space, Table } from "antd";
|
import { message, Button, Space, Table, Typography } from "antd";
|
||||||
import CopyOutlined from "@ant-design/icons/CopyOutlined";
|
import CopyOutlined from "@ant-design/icons/CopyOutlined";
|
||||||
import type { SizeType } from "antd/es/config-provider/SizeContext";
|
import type { SizeType } from "antd/es/config-provider/SizeContext";
|
||||||
import type { ColumnsType } from "antd/es/table";
|
import type { ColumnsType } from "antd/es/table";
|
||||||
@@ -55,7 +55,14 @@ export default function InstanceList(props: InstanceListProps) {
|
|||||||
{
|
{
|
||||||
title: "Assigned Host",
|
title: "Assigned Host",
|
||||||
key: "assignedHost",
|
key: "assignedHost",
|
||||||
render: (_, instance) => hostName(instance.assignedHost),
|
render: (_, instance) => <Link
|
||||||
|
to={`/hosts/${instance.assignedHost}/view`}
|
||||||
|
onClick={e => e.stopPropagation()}
|
||||||
|
>
|
||||||
|
<Typography.Link>
|
||||||
|
{hostName(instance.assignedHost)}
|
||||||
|
</Typography.Link>
|
||||||
|
</Link>,
|
||||||
sorter: (a, b) => strcmp(hostName(a.assignedHost), hostName(b.assignedHost)),
|
sorter: (a, b) => strcmp(hostName(a.assignedHost), hostName(b.assignedHost)),
|
||||||
responsive: ["sm"],
|
responsive: ["sm"],
|
||||||
},
|
},
|
||||||
@@ -68,10 +75,10 @@ export default function InstanceList(props: InstanceListProps) {
|
|||||||
{publicAddress}
|
{publicAddress}
|
||||||
<Button
|
<Button
|
||||||
type="text"
|
type="text"
|
||||||
icon={<CopyOutlined/>}
|
icon={<CopyOutlined />}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
navigator.clipboard.writeText(publicAddress??"");
|
navigator.clipboard.writeText(publicAddress ?? "");
|
||||||
message.success("Copied public address!");
|
message.success("Copied public address!");
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in new issue
Block a user