diff --git a/sysom_web/config/routes.js b/sysom_web/config/routes.js
index d4348e06..d08b9c31 100644
--- a/sysom_web/config/routes.js
+++ b/sysom_web/config/routes.js
@@ -27,7 +27,22 @@ export default [
{
path: '/host',
name: 'host',
- component: './Host',
+ // component: './Host',
+ routes: [
+ {
+ path: '/host',
+ redirect: '/host/list',
+ },
+ {
+ path: '/host/list',
+ name: 'list',
+ component: './host/List',
+ },
+ {
+ path: '/host/terminal/:id?',
+ component: './host/Terminal',
+ }
+ ],
},
{
path: '/monitor',
@@ -41,11 +56,11 @@ export default [
path: 'dashboard',
name: 'dashboard',
hideInBreadcrumb:true,
- component: './monitor/SystemDashboard',
+ component: './Monitor/SystemDashboard',
},
{
path: 'dashboard/:host?',
- component: './monitor/SystemDashboard',
+ component: './Monitor/SystemDashboard',
},
{
component: './404',
@@ -63,7 +78,7 @@ export default [
{
path: '/vmcore/list',
name: 'list',
- component: './vmcore/list',
+ component: './vmcore/List',
},
{
path: '/vmcore/detail/:id?',
@@ -72,12 +87,11 @@ export default [
{
path: '/vmcore/match',
name: 'match',
- component: './vmcore/match',
+ component: './vmcore/Match',
},
{
- path: '/vmcore/analyse',
- name: 'analyse',
- component: './vmcore/analyse',
+ path: '/vmcore/analyse/:id?',
+ component: './vmcore/Analyse',
},
],
},
@@ -92,12 +106,12 @@ export default [
{
path: '/diagnose/io',
name: 'io',
- component: './diagnose/io',
+ component: './diagnose/Io',
},
{
path: '/diagnose/net',
name: 'net',
- component: './diagnose/net',
+ component: './diagnose/Net',
},
],
},
diff --git a/sysom_web/src/locales/zh-CN/menu.js b/sysom_web/src/locales/zh-CN/menu.js
index 542c6892..3183d720 100644
--- a/sysom_web/src/locales/zh-CN/menu.js
+++ b/sysom_web/src/locales/zh-CN/menu.js
@@ -1,6 +1,8 @@
export default {
'menu.welcome': '首页',
'menu.host': '主机管理',
+ 'menu.host.list': '主机列表',
+ 'menu.host.terminal': '主机终端',
'menu.monitor': '监控中心',
'menu.monitor.': '监控中心',
'menu.monitor.dashboard': '系统监控',
diff --git a/sysom_web/src/pages/monitor/SystemDashboard.jsx b/sysom_web/src/pages/Monitor/SystemDashboard.jsx
similarity index 98%
rename from sysom_web/src/pages/monitor/SystemDashboard.jsx
rename to sysom_web/src/pages/Monitor/SystemDashboard.jsx
index c4c1dd3b..737e3af8 100644
--- a/sysom_web/src/pages/monitor/SystemDashboard.jsx
+++ b/sysom_web/src/pages/Monitor/SystemDashboard.jsx
@@ -5,7 +5,7 @@ import { Card, Statistic } from 'antd';
import { Space, Row, Col } from 'antd';
import { useIntl, useRequest, useParams, FormattedMessage } from 'umi';
import { useState } from 'react'
-import { getHost } from '../Host/service';
+import { getHost } from '../host/service';
const ServerList = (props) => {
diff --git a/sysom_web/src/pages/diagnose/io/IOResults.js b/sysom_web/src/pages/diagnose/Io/IOResults.js
similarity index 100%
rename from sysom_web/src/pages/diagnose/io/IOResults.js
rename to sysom_web/src/pages/diagnose/Io/IOResults.js
diff --git a/sysom_web/src/pages/diagnose/io/IOTableList.jsx b/sysom_web/src/pages/diagnose/Io/IOTableList.jsx
similarity index 100%
rename from sysom_web/src/pages/diagnose/io/IOTableList.jsx
rename to sysom_web/src/pages/diagnose/Io/IOTableList.jsx
diff --git a/sysom_web/src/pages/diagnose/io/index.jsx b/sysom_web/src/pages/diagnose/Io/index.jsx
similarity index 100%
rename from sysom_web/src/pages/diagnose/io/index.jsx
rename to sysom_web/src/pages/diagnose/Io/index.jsx
diff --git a/sysom_web/src/pages/diagnose/net/NetTableList.jsx b/sysom_web/src/pages/diagnose/Net/NetTableList.jsx
similarity index 100%
rename from sysom_web/src/pages/diagnose/net/NetTableList.jsx
rename to sysom_web/src/pages/diagnose/Net/NetTableList.jsx
diff --git a/sysom_web/src/pages/diagnose/net/NetworkFlow.js b/sysom_web/src/pages/diagnose/Net/NetworkFlow.js
similarity index 100%
rename from sysom_web/src/pages/diagnose/net/NetworkFlow.js
rename to sysom_web/src/pages/diagnose/Net/NetworkFlow.js
diff --git a/sysom_web/src/pages/diagnose/net/PacketLoss.js b/sysom_web/src/pages/diagnose/Net/PacketLoss.js
similarity index 100%
rename from sysom_web/src/pages/diagnose/net/PacketLoss.js
rename to sysom_web/src/pages/diagnose/Net/PacketLoss.js
diff --git a/sysom_web/src/pages/diagnose/net/index.jsx b/sysom_web/src/pages/diagnose/Net/index.jsx
similarity index 100%
rename from sysom_web/src/pages/diagnose/net/index.jsx
rename to sysom_web/src/pages/diagnose/Net/index.jsx
diff --git a/sysom_web/src/pages/Host/index.jsx b/sysom_web/src/pages/host/List/index.jsx
similarity index 96%
rename from sysom_web/src/pages/Host/index.jsx
rename to sysom_web/src/pages/host/List/index.jsx
index 5dba8518..d00c5b15 100644
--- a/sysom_web/src/pages/Host/index.jsx
+++ b/sysom_web/src/pages/host/List/index.jsx
@@ -5,8 +5,8 @@ import { useIntl, FormattedMessage } from 'umi';
import { PageContainer } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table';
import { ModalForm, ProFormText, ProFormTextArea, ProFormSelect } from '@ant-design/pro-form';
-import { getCluster, getHost, addHost, deleteHost } from './service';
-import Cluster from './components/ClusterForm';
+import { getCluster, getHost, addHost, deleteHost } from '../service';
+import Cluster from '../components/ClusterForm';
const handleAddHost = async (fields) => {
const hide = message.loading('正在添加');
@@ -124,6 +124,11 @@ const HostList = () => {
}}>
+ ,
+
+
+ 终端
+
],
},
diff --git a/sysom_web/src/pages/host/Terminal/index.jsx b/sysom_web/src/pages/host/Terminal/index.jsx
new file mode 100644
index 00000000..c4fdd870
--- /dev/null
+++ b/sysom_web/src/pages/host/Terminal/index.jsx
@@ -0,0 +1,12 @@
+import WebConsole from '@/pages/host/components/WebConsole'
+
+const Terminal = (props) => {
+ const userId = localStorage.getItem('userId');
+ return (
+ <>
+
+ >
+ )
+};
+
+export default Terminal
diff --git a/sysom_web/src/pages/Host/_mock.js b/sysom_web/src/pages/host/_mock.js
similarity index 100%
rename from sysom_web/src/pages/Host/_mock.js
rename to sysom_web/src/pages/host/_mock.js
diff --git a/sysom_web/src/pages/Host/components/ClusterForm.jsx b/sysom_web/src/pages/host/components/ClusterForm.jsx
similarity index 100%
rename from sysom_web/src/pages/Host/components/ClusterForm.jsx
rename to sysom_web/src/pages/host/components/ClusterForm.jsx
diff --git a/sysom_web/src/pages/vmcore/analyse/index.jsx b/sysom_web/src/pages/host/components/WebConsole/index.jsx
similarity index 85%
rename from sysom_web/src/pages/vmcore/analyse/index.jsx
rename to sysom_web/src/pages/host/components/WebConsole/index.jsx
index 5939a947..7a754ab8 100644
--- a/sysom_web/src/pages/vmcore/analyse/index.jsx
+++ b/sysom_web/src/pages/host/components/WebConsole/index.jsx
@@ -6,22 +6,23 @@ import { Terminal } from 'xterm';
import { WebLinksAddon } from 'xterm-addon-web-links';
import { FitAddon } from 'xterm-addon-fit';
import { AttachAddon } from 'xterm-addon-attach';
+import styles from './index.less';
const WebConsole = (props) => {
const divRef = useRef(null);
let socket = null;
const initTerminal = () => {
- const terminal = new Terminal({
- cursorBlink: true,
- });
- socket = new WebSocket(`ws://127.0.0.1:8001/ws/ssh/2/?user_id=1`);
+ socket = new WebSocket(`ws://127.0.0.1:8001/ws/ssh/${props.id}/?user_id=${props.user_id}`);
socket.onopen = () => {
terminal.focus();
};
socket.onerror = () => {
message.error('连接出错')
};
+ const terminal = new Terminal({
+ cursorBlink: true,
+ });
const webLinksAddon = new WebLinksAddon();
const fitAddon = new FitAddon();
const attachAddon = new AttachAddon(socket);
@@ -45,7 +46,7 @@ const WebConsole = (props) => {
return (
- ;
+
)
};
diff --git a/sysom_web/src/pages/host/components/WebConsole/index.less b/sysom_web/src/pages/host/components/WebConsole/index.less
new file mode 100644
index 00000000..0e91a3e4
--- /dev/null
+++ b/sysom_web/src/pages/host/components/WebConsole/index.less
@@ -0,0 +1,7 @@
+@import '~antd/es/style/themes/default.less';
+
+.webconsole{
+ margin-top: 10px;
+ height: 600px;
+ width: 100%;
+}
diff --git a/sysom_web/src/pages/Host/service.js b/sysom_web/src/pages/host/service.js
similarity index 100%
rename from sysom_web/src/pages/Host/service.js
rename to sysom_web/src/pages/host/service.js
diff --git a/sysom_web/src/pages/vmcore/Analyse/index.jsx b/sysom_web/src/pages/vmcore/Analyse/index.jsx
new file mode 100644
index 00000000..80885d08
--- /dev/null
+++ b/sysom_web/src/pages/vmcore/Analyse/index.jsx
@@ -0,0 +1,12 @@
+import WebConsole from '@/pages/host/components/WebConsole'
+
+const VmcoreAnalyse = (props) => {
+ const userId = localStorage.getItem('userId');
+ return (
+ <>
+
+ >
+ )
+};
+
+export default VmcoreAnalyse
diff --git a/sysom_web/src/pages/vmcore/Detail/index.jsx b/sysom_web/src/pages/vmcore/Detail/index.jsx
index 923dbbbb..781d900d 100644
--- a/sysom_web/src/pages/vmcore/Detail/index.jsx
+++ b/sysom_web/src/pages/vmcore/Detail/index.jsx
@@ -78,9 +78,7 @@ const VmcoreDetail = (props) => {