提交 1.3.0 release
This commit is contained in:
parent
b6150c77f8
commit
bdebc18b88
@ -210,7 +210,9 @@ var DefaultMenu = []*model.Menu{
|
||||
model.NewMenu("job-run", "执行", "job",
|
||||
model.NewPermission("POST", "/jobs/:id/exec"),
|
||||
),
|
||||
model.NewMenu("job-change-status", "开启/关闭", "job"),
|
||||
model.NewMenu("job-change-status", "开启/关闭", "job",
|
||||
model.NewPermission("POST", "/jobs/:id/change-status"),
|
||||
),
|
||||
model.NewMenu("job-log", "日志", "job",
|
||||
model.NewPermission("GET", "/jobs/:id/logs/paging"),
|
||||
),
|
||||
@ -309,6 +311,9 @@ var DefaultMenu = []*model.Menu{
|
||||
model.NewMenu("user-change-password", "修改密码", "user",
|
||||
model.NewPermission("POST", "/users/:id/change-password"),
|
||||
),
|
||||
model.NewMenu("user-enable-disable", "启用/禁用", "user",
|
||||
model.NewPermission("PATCH", "/users/:id/status"),
|
||||
),
|
||||
model.NewMenu("user-reset-totp", "重置双因素认证", "user",
|
||||
model.NewPermission("POST", "/users/:id/reset-totp"),
|
||||
),
|
||||
@ -376,6 +381,7 @@ var DefaultMenu = []*model.Menu{
|
||||
model.NewPermission("GET", "/authorised/selected"),
|
||||
model.NewPermission("GET", "/assets"),
|
||||
model.NewPermission("GET", "/strategies"),
|
||||
model.NewPermission("GET", "/command-filters"),
|
||||
),
|
||||
model.NewMenu("user-group-unbind-asset", "移除", "user-group-authorised-asset",
|
||||
model.NewPermission("DELETE", "/authorised/:id"),
|
||||
@ -383,6 +389,36 @@ var DefaultMenu = []*model.Menu{
|
||||
|
||||
model.NewMenu("authorised", "授权策略", "root"),
|
||||
|
||||
model.NewMenu("command-filter", "命令过滤", "authorised",
|
||||
model.NewPermission("GET", "/command-filters/paging"),
|
||||
),
|
||||
model.NewMenu("command-filter-add", "增加", "command-filter",
|
||||
model.NewPermission("POST", "/command-filters"),
|
||||
),
|
||||
model.NewMenu("command-filter-del", "删除", "command-filter",
|
||||
model.NewPermission("DELETE", "/command-filters/:id"),
|
||||
),
|
||||
model.NewMenu("command-filter-edit", "编辑", "command-filter",
|
||||
model.NewPermission("GET", "/command-filters/:id"),
|
||||
model.NewPermission("PUT", "/command-filters/:id"),
|
||||
),
|
||||
model.NewMenu("command-filter-detail", "详情", "command-filter",
|
||||
model.NewPermission("GET", "/command-filters/:id"),
|
||||
),
|
||||
model.NewMenu("command-filter-rule", "规则", "command-filter-detail",
|
||||
model.NewPermission("GET", "/command-filter-rules/:id"),
|
||||
),
|
||||
model.NewMenu("command-filter-rule-add", "增加", "command-filter-rule",
|
||||
model.NewPermission("POST", "/command-filter-rules"),
|
||||
),
|
||||
model.NewMenu("command-filter-rule-put", "修改", "command-filter-rule",
|
||||
model.NewPermission("GET", "/command-filter-rules/:id"),
|
||||
model.NewPermission("PUT", "/command-filter-rules/:id"),
|
||||
),
|
||||
model.NewMenu("command-filter-rule-del", "删除", "command-filter-rule",
|
||||
model.NewPermission("DELETE", "/command-filter-rules/:id"),
|
||||
),
|
||||
|
||||
model.NewMenu("strategy", "授权策略", "authorised",
|
||||
model.NewPermission("GET", "/strategies/paging"),
|
||||
),
|
||||
@ -403,6 +439,10 @@ var DefaultMenu = []*model.Menu{
|
||||
model.NewMenu("setting", "系统设置", "root",
|
||||
model.NewPermission("GET", "/properties"),
|
||||
model.NewPermission("PUT", "/properties"),
|
||||
model.NewPermission("POST", "/ldap-user-sync"),
|
||||
model.NewPermission("GET", "/license"),
|
||||
model.NewPermission("POST", "/license"),
|
||||
model.NewPermission("GET", "/license/machine-id"),
|
||||
),
|
||||
model.NewMenu("info", "个人中心", "root"),
|
||||
}
|
||||
|
@ -51,7 +51,6 @@ const Credential = React.lazy(() => import("./components/asset/Credential"));
|
||||
|
||||
const Job = React.lazy(() => import("./components/devops/Job"));
|
||||
const LoginLog = React.lazy(() => import("./components/log-audit/LoginLog"));
|
||||
const StorageLog = React.lazy(() => import("./components/log-audit/StorageLog"));
|
||||
const Security = React.lazy(() => import("./components/security/Security"));
|
||||
const Storage = React.lazy(() => import("./components/devops/Storage"));
|
||||
|
||||
@ -99,7 +98,6 @@ const App = () => {
|
||||
<Route path="/online-session" element={<OnlineSession/>}/>
|
||||
<Route path="/offline-session" element={<OfflineSession/>}/>
|
||||
<Route path="/login-log" element={<LoginLog/>}/>
|
||||
<Route path="/storage-log" element={<StorageLog/>}/>
|
||||
<Route path="/info" element={<Info/>}/>
|
||||
<Route path="/setting" element={<Setting/>}/>
|
||||
<Route path="/job" element={<Job/>}/>
|
||||
|
@ -30,6 +30,8 @@ const STATE_CONNECTED = 3;
|
||||
const STATE_DISCONNECTING = 4;
|
||||
const STATE_DISCONNECTED = 5;
|
||||
|
||||
let clientState = STATE_IDLE;
|
||||
|
||||
const Guacd = () => {
|
||||
|
||||
let [searchParams] = useSearchParams();
|
||||
@ -46,13 +48,10 @@ const Guacd = () => {
|
||||
height = window.innerHeight;
|
||||
}
|
||||
|
||||
const [box, setBox] = useState({width: width, height: height});
|
||||
|
||||
let [guacd, setGuacd] = useState({});
|
||||
let [session, setSession] = useState({});
|
||||
let [clipboardText, setClipboardText] = useState('');
|
||||
let [fullScreened, setFullScreened] = useState(false);
|
||||
let [clientState, setClientState] = useState(STATE_IDLE);
|
||||
let [clipboardVisible, setClipboardVisible] = useState(false);
|
||||
let [fileSystemVisible, setFileSystemVisible] = useState(false);
|
||||
|
||||
@ -201,7 +200,7 @@ const Guacd = () => {
|
||||
});
|
||||
})
|
||||
} catch (e) {
|
||||
// console.error(e);
|
||||
console.error('复制剪贴板失败', e);
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -228,7 +227,6 @@ const Guacd = () => {
|
||||
} else {
|
||||
let reader = new Guacamole.BlobReader(stream, mimetype);
|
||||
reader.onend = () => {
|
||||
console.log(stream, mimetype, reader)
|
||||
setClipboardText(reader.getBlob());
|
||||
}
|
||||
}
|
||||
@ -264,7 +262,7 @@ const Guacd = () => {
|
||||
}
|
||||
|
||||
const onClientStateChange = (state, sessionId) => {
|
||||
setClientState(state);
|
||||
clientState = state;
|
||||
const key = 'message';
|
||||
switch (state) {
|
||||
case STATE_IDLE:
|
||||
@ -328,7 +326,6 @@ const Guacd = () => {
|
||||
}
|
||||
|
||||
const onError = (status) => {
|
||||
console.log('通道异常。', status);
|
||||
switch (status.code) {
|
||||
case 256:
|
||||
showMessage('未支持的访问');
|
||||
@ -439,10 +436,9 @@ const Guacd = () => {
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
<div className="container" style={{
|
||||
width: box.width,
|
||||
height: box.height,
|
||||
width: width,
|
||||
height: height,
|
||||
margin: '0 auto'
|
||||
}}>
|
||||
<div id="display"/>
|
||||
|
@ -1,171 +0,0 @@
|
||||
import React, {useState} from 'react';
|
||||
import {Button, Layout, Modal, Popconfirm} from "antd";
|
||||
import {ProTable} from "@ant-design/pro-components";
|
||||
import storageLogApi from "../../api/storage-log";
|
||||
import {Link} from "react-router-dom";
|
||||
import ColumnState, {useColumnState} from "../../hook/column-state";
|
||||
import Show from "../../dd/fi/show";
|
||||
|
||||
const api = storageLogApi;
|
||||
const {Content} = Layout;
|
||||
|
||||
const actionRef = React.createRef();
|
||||
|
||||
const StorageLog = () => {
|
||||
|
||||
let [total, setTotal] = useState(0);
|
||||
const [columnsStateMap, setColumnsStateMap] = useColumnState(ColumnState.STORAGE_LOG);
|
||||
|
||||
const columns = [
|
||||
{
|
||||
dataIndex: 'index',
|
||||
valueType: 'indexBorder',
|
||||
width: 48,
|
||||
},
|
||||
{
|
||||
title: '资产名称',
|
||||
key: 'assetName',
|
||||
dataIndex: 'assetName',
|
||||
hideInSearch: true,
|
||||
render: ((text, record) => {
|
||||
return <Link to={`/assets/${record['assetId']}`}>{text}</Link>
|
||||
})
|
||||
},
|
||||
{
|
||||
title: '文件/文件夹名称',
|
||||
key: 'fileName',
|
||||
dataIndex: 'fileName',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '操作类型',
|
||||
key: 'action',
|
||||
dataIndex: 'action',
|
||||
valueType: 'select',
|
||||
valueEnum: {
|
||||
rm: {text: '删除'},
|
||||
upload: {
|
||||
text: '上传',
|
||||
},
|
||||
download: {
|
||||
text: '下载',
|
||||
},
|
||||
mkdir: {
|
||||
text: '创建文件夹',
|
||||
},
|
||||
rename: {
|
||||
text: '重命名',
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作用户',
|
||||
key: 'userName',
|
||||
dataIndex: 'userName',
|
||||
hideInSearch: true,
|
||||
render: ((text, record) => {
|
||||
return <Link to={`/users/${record['userId']}`}>{text}</Link>
|
||||
})
|
||||
},
|
||||
{
|
||||
title: '操作日期',
|
||||
key: 'created',
|
||||
dataIndex: 'created',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
valueType: 'option',
|
||||
key: 'option',
|
||||
render: (text, record, _, action) => [
|
||||
<Show menu={'storage-log-del'} key={'storage-log-del'}>
|
||||
<Popconfirm
|
||||
key={'confirm-delete'}
|
||||
title="您确认要删除此行吗?"
|
||||
onConfirm={async () => {
|
||||
await api.deleteById(record.id);
|
||||
actionRef.current.reload();
|
||||
}}
|
||||
okText="确认"
|
||||
cancelText="取消"
|
||||
>
|
||||
<a key='delete' className='danger'>删除</a>
|
||||
</Popconfirm>
|
||||
</Show>,
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Content className="page-container">
|
||||
<ProTable
|
||||
columns={columns}
|
||||
actionRef={actionRef}
|
||||
columnsState={{
|
||||
value: columnsStateMap,
|
||||
onChange: setColumnsStateMap
|
||||
}}
|
||||
request={async (params = {}, sort, filter) => {
|
||||
|
||||
let field = '';
|
||||
let order = '';
|
||||
if (Object.keys(sort).length > 0) {
|
||||
field = Object.keys(sort)[0];
|
||||
order = Object.values(sort)[0];
|
||||
}
|
||||
|
||||
let queryParams = {
|
||||
pageIndex: params.current,
|
||||
pageSize: params.pageSize,
|
||||
action: params.action,
|
||||
field: field,
|
||||
order: order
|
||||
}
|
||||
let result = await api.getPaging(queryParams);
|
||||
setTotal(result['total']);
|
||||
return {
|
||||
data: result['items'],
|
||||
success: true,
|
||||
total: result['total']
|
||||
};
|
||||
}}
|
||||
rowKey="id"
|
||||
search={{
|
||||
labelWidth: 'auto',
|
||||
}}
|
||||
pagination={{
|
||||
pageSize: 10,
|
||||
}}
|
||||
dateFormatter="string"
|
||||
headerTitle="文件操作日志"
|
||||
toolBarRender={() => [
|
||||
<Show menu={'storage-log-clear'}>
|
||||
<Button key="button"
|
||||
type="danger"
|
||||
disabled={total === 0}
|
||||
onClick={async () => {
|
||||
Modal.confirm({
|
||||
title: '您确定要清空全部的文件操作日志吗?',
|
||||
content: '清空之后无法进行恢复,请慎重考虑。',
|
||||
okText: '确定',
|
||||
okType: 'danger',
|
||||
cancelText: '取消',
|
||||
onOk: async () => {
|
||||
await api.Clear();
|
||||
actionRef.current.reload();
|
||||
}
|
||||
});
|
||||
|
||||
}}>
|
||||
清空
|
||||
</Button>
|
||||
</Show>,
|
||||
]}
|
||||
/>
|
||||
</Content>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default StorageLog;
|
Loading…
Reference in New Issue
Block a user