diff --git a/sysom_web/config/routes.js b/sysom_web/config/routes.js
index 7386c8328e73edc40ed17b9429aff93196ad818a..e221b20845cdf39ede83b059af6ec89fe3da5e6b 100644
--- a/sysom_web/config/routes.js
+++ b/sysom_web/config/routes.js
@@ -37,6 +37,11 @@ export default [
name: 'list',
component: './host/List',
},
+ {
+ path: '/host/cluster',
+ name: 'cluster',
+ component: './host/cluster',
+ },
{
path: '/host/terminal/:ip?',
component: './host/Terminal',
diff --git a/sysom_web/src/locales/zh-CN/menu.js b/sysom_web/src/locales/zh-CN/menu.js
index 2ce9914ef6555a6a7ef1cabe9f4af445e69e6a43..00673c814be68d8100d1c492951c8269f062df1d 100644
--- a/sysom_web/src/locales/zh-CN/menu.js
+++ b/sysom_web/src/locales/zh-CN/menu.js
@@ -2,6 +2,7 @@ export default {
'menu.welcome': '首页',
'menu.host': '主机管理',
'menu.host.list': '主机列表',
+ 'menu.host.cluster': '集群列表',
'menu.host.terminal': '主机终端',
'menu.monitor': '监控中心',
'menu.monitor.': '监控中心',
diff --git a/sysom_web/src/locales/zh-CN/pages.js b/sysom_web/src/locales/zh-CN/pages.js
index 7eb2bc2b86b607414dfa1463edaca0534908bef6..1333a93bb6af6c724406681016a858ccff5bbe2a 100644
--- a/sysom_web/src/locales/zh-CN/pages.js
+++ b/sysom_web/src/locales/zh-CN/pages.js
@@ -55,6 +55,12 @@ export default {
'pages.hostTable.createForm.newHost': '新建主机',
'pages.hostTable.host': '此为必填项',
'pages.hostTable.createForm.editHost': '编辑主机',
+ 'pages.clusterTable.title': '集群管理',
+ 'pages.clusterTable.clusterName': '集群名称',
+ 'pages.clusterTable.clusterCreatedAt': '创建时间',
+ 'pages.clusterTable.clusterOption': '操作',
+ 'pages.clusterTable.delete': '删除',
+ 'pages.clusterTable.hostCount': '主机数量',
'pages.IssueTable.createIssue': '新增方案',
'pages.journal.audit.title': '日志列表',
'pages.journal.audit.created_at': '时间',
diff --git a/sysom_web/src/pages/host/cluster/index.jsx b/sysom_web/src/pages/host/cluster/index.jsx
new file mode 100644
index 0000000000000000000000000000000000000000..e0f2399448c6924d792e33432aa70a3922537e82
--- /dev/null
+++ b/sysom_web/src/pages/host/cluster/index.jsx
@@ -0,0 +1,115 @@
+import { PageContainer } from '@ant-design/pro-layout';
+import { Popconfirm, Table, Space } from 'antd';
+import { useState, useRef, useEffect } from 'react';
+import { useIntl, FormattedMessage } from 'umi';
+import ProTable from '@ant-design/pro-table';
+import { getClusterList } from '../service';
+import Cluster from '../components/ClusterForm';
+/**
+ * 集群列表页面
+ */
+const ClusterList = () => {
+ const intl = useIntl();
+
+ const columns = [
+ {
+ title: ,
+ dataIndex: 'cluster_name',
+ valueType: 'textarea',
+ // hideInSearch: true,
+ },
+ {
+ title: ,
+ dataIndex: 'hosts',
+ valueType: 'textarea',
+ hideInSearch: true,
+ render: (_, record) => (
+ {record.hosts.length}
+ )
+ },
+ {
+ title: (
+
+ ),
+ dataIndex: 'created_at',
+ valueType: 'dateTime',
+ hideInSearch: true,
+ },
+ {
+ title: ,
+ key: 'option',
+ dataIndex: 'option',
+ valueType: 'option',
+ render: (_, record) => [
+
+ {
+ await handleDeleteHost(record);
+ actionRef.current?.reload();
+ }}>
+
+
+ ,
+ ],
+ },
+ ]
+
+ return (
+
+ [
+ { }} />,
+ ]}
+ columns={columns}
+ rowSelection={{
+ selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
+ defaultSelectedRowKeys: [1],
+ }}
+ tableAlertRender={({ selectedRowKeys, selectedRows, onCleanSelected }) => (
+
+
+ 已选 {selectedRowKeys.length} 项
+ {/*
+ 取消选择
+ */}
+
+
+ )}
+ tableAlertOptionRender={({ selectedRowKeys, selectedRows, onCleanSelected }) => {
+ return (
+
+ {
+ // await onDeleteHandler(selectedRows);
+ // onCleanSelected();
+ // actionRef.current?.reload();
+ }}
+ >
+ 批量删除
+
+ {
+ // await onBulkExportHostHandler(selectedRows);
+ // onCleanSelected();
+ }}
+ >
+ 导出数据
+
+
+ );
+ }}
+ />
+
+ )
+}
+
+export default ClusterList;
\ No newline at end of file
diff --git a/sysom_web/src/pages/host/service.js b/sysom_web/src/pages/host/service.js
index d822be46ff5789134f5ab2e2e59c92d533cb7aca..c0d74ed4a5926bbdf846fa469bcd8e94ba72f0ec 100644
--- a/sysom_web/src/pages/host/service.js
+++ b/sysom_web/src/pages/host/service.js
@@ -24,6 +24,18 @@ export async function getCluster(options) {
return results
}
+/**
+ * 获取集群列表
+ * @param {*} options
+ * @returns
+ */
+export async function getClusterList(options) {
+ return request(CLUSTER_URL, {
+ method: 'GET',
+ ...(options || {}),
+ });
+}
+
export async function addCluster(body, token, options) {
return request(CLUSTER_URL, {
method: 'POST',
@@ -50,7 +62,7 @@ export async function getHostName(options) {
...(options || {}),
});
const array = msg.data
- console.log(msg,array);
+ console.log(msg, array);
const results = array?.map(item => {
return {
label: item.hostname,