A web update

pull/22/head
雷二猛 2019-12-12 11:38:36 +08:00
parent d1d642fba7
commit 605ef9a214
2 changed files with 8 additions and 0 deletions

View File

@ -35,15 +35,22 @@ class ComTable extends React.Component {
ellipsis: true ellipsis: true
}, { }, {
title: '操作', title: '操作',
width: 200,
render: info => ( render: info => (
<span> <span>
<LinkButton onClick={() => store.showForm(info)}>编辑</LinkButton> <LinkButton onClick={() => store.showForm(info)}>编辑</LinkButton>
<Divider type="vertical"/> <Divider type="vertical"/>
<LinkButton onClick={() => this.handleDelete(info)}>删除</LinkButton> <LinkButton onClick={() => this.handleDelete(info)}>删除</LinkButton>
<Divider type="vertical"/>
<LinkButton onClick={() => this.handleConsole(info)}>Console</LinkButton>
</span> </span>
) )
}]; }];
handleConsole = (info) => {
window.open(`/api/host/ssh/${info.id}/?x-token=${localStorage.getItem('token')}`)
};
handleDelete = (text) => { handleDelete = (text) => {
Modal.confirm({ Modal.confirm({
title: '删除确认', title: '删除确认',

View File

@ -4,6 +4,7 @@ module.exports = function (app) {
app.use(proxy('/api/', { app.use(proxy('/api/', {
target: 'http://localhost:8000', target: 'http://localhost:8000',
changeOrigin: true, changeOrigin: true,
ws: true,
pathRewrite: { pathRewrite: {
'^/api': '' '^/api': ''
} }