From 605ef9a2147de510ed04e70d31e2a491376a439c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E4=BA=8C=E7=8C=9B?= Date: Thu, 12 Dec 2019 11:38:36 +0800 Subject: [PATCH] A web update --- spug_web/src/pages/host/Table.js | 7 +++++++ spug_web/src/setupProxy.js | 1 + 2 files changed, 8 insertions(+) diff --git a/spug_web/src/pages/host/Table.js b/spug_web/src/pages/host/Table.js index 2be1de8..95aeaa1 100644 --- a/spug_web/src/pages/host/Table.js +++ b/spug_web/src/pages/host/Table.js @@ -35,15 +35,22 @@ class ComTable extends React.Component { ellipsis: true }, { title: '操作', + width: 200, render: info => ( store.showForm(info)}>编辑 this.handleDelete(info)}>删除 + + this.handleConsole(info)}>Console ) }]; + handleConsole = (info) => { + window.open(`/api/host/ssh/${info.id}/?x-token=${localStorage.getItem('token')}`) + }; + handleDelete = (text) => { Modal.confirm({ title: '删除确认', diff --git a/spug_web/src/setupProxy.js b/spug_web/src/setupProxy.js index 3062cc4..5d9cbcb 100644 --- a/spug_web/src/setupProxy.js +++ b/spug_web/src/setupProxy.js @@ -4,6 +4,7 @@ module.exports = function (app) { app.use(proxy('/api/', { target: 'http://localhost:8000', changeOrigin: true, + ws: true, pathRewrite: { '^/api': '' }