mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-24 16:23:12 +09:00
Make host name on instance page clickable
This commit is contained in:
1 parent
99990c7a0d
commit
d6b0e88dda
1 file changed
+4
-2
@@ -1,5 +1,5 @@
|
|||||||
import React, { useContext, useState } from "react";
|
import React, { useContext, useState } from "react";
|
||||||
import { useNavigate, useParams } from "react-router-dom";
|
import { Link, useNavigate, useParams } from "react-router-dom";
|
||||||
import { Alert, Button, Descriptions, Dropdown, Menu, MenuProps, Modal, Space, Spin, Typography } from "antd";
|
import { Alert, Button, Descriptions, Dropdown, Menu, MenuProps, Modal, Space, Spin, Typography } from "antd";
|
||||||
import type { ItemType } from "antd/es/menu/hooks/useItems";
|
import type { ItemType } from "antd/es/menu/hooks/useItems";
|
||||||
import DeleteOutlined from "@ant-design/icons/DeleteOutlined";
|
import DeleteOutlined from "@ant-design/icons/DeleteOutlined";
|
||||||
@@ -42,7 +42,9 @@ function InstanceDescription(props: InstanceDescriptionProps) {
|
|||||||
<Descriptions.Item label="Host">
|
<Descriptions.Item label="Host">
|
||||||
{!assigned
|
{!assigned
|
||||||
? <em>Unassigned</em>
|
? <em>Unassigned</em>
|
||||||
: host?.name ?? instance.assignedHost
|
: <Link to={`/hosts/${host?.id ?? instance.assignedHost}/view`}>
|
||||||
|
<Typography.Link>{host?.name ?? instance.assignedHost}</Typography.Link>
|
||||||
|
</Link>
|
||||||
}
|
}
|
||||||
{account.hasPermission("core.instance.assign") && <AssignInstanceModal
|
{account.hasPermission("core.instance.assign") && <AssignInstanceModal
|
||||||
id={instance.id}
|
id={instance.id}
|
||||||
|
|||||||
Reference in new issue
Block a user