diff --git a/spug_web/src/pages/host/Detail.js b/spug_web/src/pages/host/Detail.js index 4f38bba..7a24adb 100644 --- a/spug_web/src/pages/host/Detail.js +++ b/spug_web/src/pages/host/Detail.js @@ -2,6 +2,7 @@ import React, { useState, useEffect, useRef } from 'react'; import { observer } from 'mobx-react'; import { Drawer, Descriptions, List, Button, Input, Select, DatePicker, Tag, message } from 'antd'; import { EditOutlined, SaveOutlined, PlusOutlined, SyncOutlined } from '@ant-design/icons'; +import { AuthButton } from 'components'; import { http } from 'libs'; import store from './store'; import lds from 'lodash'; @@ -136,7 +137,7 @@ export default observer(function () { , ]) : ( - + } onClick={() => setEdit(true)}>编辑 )} title={扩展信息}> diff --git a/spug_web/src/pages/host/Group.js b/spug_web/src/pages/host/Group.js index 524efb5..413d9ab 100644 --- a/spug_web/src/pages/host/Group.js +++ b/spug_web/src/pages/host/Group.js @@ -12,9 +12,10 @@ import { EditOutlined, DeleteOutlined, CopyOutlined, - ScissorOutlined + ScissorOutlined, + LoadingOutlined } from '@ant-design/icons'; -import { LoadingOutlined } from '@ant-design/icons'; +import { AuthFragment } from 'components'; import { hasPermission, http } from 'libs'; import store from './store'; import lds from 'lodash'; @@ -108,7 +109,7 @@ export default observer(function () { } function handleRightClick(v) { - if (hasPermission('host.group.edit')) { + if (hasPermission('admin')) { store.group = v.node; setVisible(true) } @@ -147,12 +148,14 @@ export default observer(function () { }> + extra={( + + + )}> - } onClick={openTerminal}>Web 终端}> + } onClick={openTerminal}>Web 终端}> 首页 主机管理 diff --git a/spug_web/src/pages/ssh/FileManager.js b/spug_web/src/pages/ssh/FileManager.js index bbabd24..440308c 100644 --- a/spug_web/src/pages/ssh/FileManager.js +++ b/spug_web/src/pages/ssh/FileManager.js @@ -13,6 +13,7 @@ import { HomeOutlined, UploadOutlined } from '@ant-design/icons'; +import { AuthButton, Action } from 'components'; import { http, uniqueId, X_TOKEN } from 'libs'; import lds from 'lodash'; import styles from './index.module.less' @@ -62,18 +63,18 @@ class FileManager extends React.Component { title: '属性', key: 'attr', render: info => `${info.kind}${info.code}`, - width: 120 + width: 110 }, { title: '操作', - width: 80, + width: 100, align: 'right', key: 'action', render: info => info.kind === '-' ? ( - - this.handleDownload(info.name)}/> - - this.handleDelete(info.name)}/> - + + } onClick={() => this.handleDownload(info.name)}/> + } + onClick={() => this.handleDelete(info.name)}/> + ) : null }]; @@ -210,8 +211,13 @@ class FileManager extends React.Component { checkedChildren="开启" unCheckedChildren="关闭" onChange={v => this.setState({showDot: v})}/> - + } + onClick={this.handleUpload}>上传文件 {this.state.uploading && ( diff --git a/spug_web/src/pages/ssh/index.js b/spug_web/src/pages/ssh/index.js index 522811b..a81e340 100644 --- a/spug_web/src/pages/ssh/index.js +++ b/spug_web/src/pages/ssh/index.js @@ -7,7 +7,7 @@ import React, { useEffect, useState } from 'react'; import { observer } from 'mobx-react'; import { Tabs, Tree, Button, Spin } from 'antd'; import { FolderOutlined, FolderOpenOutlined, CloudServerOutlined } from '@ant-design/icons'; -import { NotFound } from 'components'; +import { NotFound, AuthButton } from 'components'; import Terminal from './Terminal'; import FileManager from './FileManager'; import { http, hasPermission } from 'libs'; @@ -103,11 +103,13 @@ function WebSSH(props) { type="editable-card" onTabClick={key => setActiveId(key)} onEdit={handleRemove} - tabBarExtraContent={}> + icon={}>文件管理器}> {hosts.map(item => (