* 优化图标和LOGO

* 修改登录页面动画的速度为3

* 增加对websocket的异常处理

* 修复了用户组和用户名唯一判断错误的问题

* 提示版本号

* 修复readme错别字

* 修复单词拼写错误的问题

* 修复代码格式

* 修改Windows资产属性名称

* Docker 打包流程增加 upx 压缩

* 升级依赖文件,修改sqlite驱动为 github.com/glebarez/sqlite

* 修复第一次查询「授权令牌」的错误

* 移除无关代码

* 修改docker打包脚本

* 增加打包脚本

* 增加微信群

* 修复单词拼写错误的问题

* 修复代码格式

* 修改Windows资产属性名称

* Docker 打包流程增加 upx 压缩

* 修改docker打包脚本

* - 替换 sqlite 驱动为 github.com/glebarez/sqlite
- 修复数据库锁定的问题
- 修复部分代码不完善的问题
- 修复策略显示不完整的问题
- 修复编辑文件换行符的问题
- 优化guacd连接
This commit is contained in:
dushixiang
2022-03-29 22:40:26 +08:00
committed by GitHub
parent 3ec6e5332e
commit 04f8d0079b
42 changed files with 436 additions and 568 deletions

View File

@ -5,8 +5,7 @@ import request from "../common/request";
import {message} from "antd/es";
import {withRouter} from "react-router-dom";
import {LockOutlined, OneToOneOutlined, UserOutlined} from '@ant-design/icons';
import Particles from "react-tsparticles";
import Background from '../images/bg.png'
import Background from '../images/bg.jpg'
import {setToken} from "../utils/utils";
const {Title} = Typography;
@ -109,90 +108,7 @@ class LoginForm extends Component {
render() {
return (
<div className='login-bg'
style={{width: this.state.width, height: this.state.height}}>
<Particles
id="tsparticles"
options={{
background: {
color: {
// value: "#0d47a1",
},
image: `url(${Background})`,
repeat: 'no-repeat',
size: '100% 100%'
},
fpsLimit: 60,
interactivity: {
events: {
onClick: {
enable: true,
mode: "push",
},
onHover: {
enable: true,
mode: "repulse",
},
resize: true,
},
modes: {
bubble: {
distance: 400,
duration: 2,
opacity: 0.8,
size: 40,
},
push: {
quantity: 4,
},
repulse: {
distance: 200,
duration: 0.4,
},
},
},
particles: {
color: {
value: "#ffffff",
},
links: {
color: "#ffffff",
distance: 150,
enable: true,
opacity: 0.5,
width: 1,
},
collisions: {
enable: true,
},
move: {
direction: "none",
enable: true,
outMode: "bounce",
random: false,
speed: 3,
straight: false,
},
number: {
density: {
enable: true,
value_area: 800,
},
value: 80,
},
opacity: {
value: 0.5,
},
shape: {
type: "circle",
},
size: {
random: true,
value: 5,
},
},
detectRetina: true,
}}
/>
style={{width: this.state.width, height: this.state.height, background: `url(${Background})`}}>
<Card className='login-card' title={null}>
<div style={{textAlign: "center", margin: '15px auto 30px auto', color: '#1890ff'}}>
<Title level={1}>Next Terminal</Title>

View File

@ -127,7 +127,7 @@ class Access extends Component {
sendClipboard(data) {
if (this.state.session['paste'] === '0') {
message.warn('禁止粘贴');
// message.warn('禁止粘贴');
return
}
let writer;
@ -338,7 +338,7 @@ class Access extends Component {
clientClipboardReceived = (stream, mimetype) => {
if (this.state.session['copy'] === '0') {
message.warn('禁止复制');
// message.warn('禁止复制');
return
}
let reader;

View File

@ -82,7 +82,9 @@ class Term extends Component {
document.body.oncopy = (event) => {
event.preventDefault();
if (this.state.session['copy'] === '0') {
message.warn('禁止复制')
// message.warn('禁止复制')
return false;
}else {
if (event.clipboardData) {
return event.clipboardData.setData('text', '');
} else {
@ -90,13 +92,12 @@ class Term extends Component {
return window.clipboardData.setData("text", '');
}
}
return true;
}
document.body.onpaste = (event) => {
event.preventDefault();
if (this.state.session['paste'] === '0') {
message.warn('禁止粘贴')
// message.warn('禁止粘贴')
return false;
}
return true;

View File

@ -412,7 +412,7 @@ Windows需要对远程应用程序的名称使用特殊的符号。
<Panel header={<Text strong>映射网络驱动器</Text>} key="storage">
<Form.Item
name="enable-drive"
label="启用映射网络驱动器"
label="启用"
valuePropName="checked"
>
<Switch checkedChildren="开启" unCheckedChildren="关闭"
@ -424,7 +424,7 @@ Windows需要对远程应用程序的名称使用特殊的符号。
enableDrive ?
<Form.Item
name="drive-path"
label="映射网络驱动器"
label="映射空间"
tooltip='用于文件传输的映射网络驱动器,为空时使用操作人的默认空间'
>
<Select onChange={null} allowClear placeholder='为空时使用操作人的默认空间'>
@ -456,7 +456,7 @@ Windows需要对远程应用程序的名称使用特殊的符号。
setSshMode(value)
}}>
<Option value="">guacd</Option>
<Option value="native">原生</Option>
<Option value="naive">原生</Option>
</Select>
</Form.Item>
</Panel>

View File

@ -18,7 +18,6 @@ import {
import {
CheckCircleOutlined,
CodeOutlined,
DesktopOutlined,
ExclamationCircleOutlined,
SyncOutlined,
TagsOutlined,
@ -195,14 +194,6 @@ class MyAsset extends Component {
style={{width: 200}}
/>
<Search
ref={this.inputRefOfIp}
placeholder="资产IP"
allowClear
onSearch={this.handleSearchByIp}
style={{width: 200}}
/>
<Select mode="multiple"
allowClear
value={this.state.selectedTags}
@ -302,9 +293,6 @@ class MyAsset extends Component {
<Descriptions.Item label={<div><CodeOutlined/> 资产协议</div>}>
<strong>{item['protocol']}</strong>
</Descriptions.Item>
<Descriptions.Item label={<div><DesktopOutlined/> 主机地址</div>}>
<strong>{item['ip'] + ':' + item['port']}</strong>
</Descriptions.Item>
<Descriptions.Item label={<div><TagsOutlined/> 标签</div>}>
<strong>{this.renderTags(item['tags'])}</strong>
</Descriptions.Item>

View File

@ -9,7 +9,7 @@ const formItemLayout = {
const StorageModal = ({title, visible, handleOk, handleCancel, confirmLoading, model}) => {
const [form] = Form.useForm();
if(!model){
if (!model) {
model = {
isShare: false
}
@ -46,11 +46,13 @@ const StorageModal = ({title, visible, handleOk, handleCancel, confirmLoading, m
<Input autoComplete="off" placeholder="网盘的名称"/>
</Form.Item>
<Form.Item label="是否共享" name='isShare' rules={[{required: true, message: '请选择是否共享'}]} valuePropName="checked">
<Switch checkedChildren="是" unCheckedChildren="否" />
<Form.Item label="是否共享" name='isShare' rules={[{required: true, message: '请选择是否共享'}]}
valuePropName="checked">
<Switch checkedChildren="是" unCheckedChildren="否"/>
</Form.Item>
<Form.Item label="大小限制" name='limitSize' rules={[{required: true, message: '请输入大小限制'}]}>
<Form.Item label="大小限制" name='limitSize' rules={[{required: true, message: '请输入大小限制'}]}
tooltip='无限制请填写-1'>
<Input type={'number'} min={-1} suffix="MB"/>
</Form.Item>

View File

@ -25,7 +25,6 @@ class Setting extends Component {
state = {
refs: [],
properties: {},
ldapUserSyncLoading: false
}
rdpSettingFormRef = React.createRef();
@ -33,8 +32,8 @@ class Setting extends Component {
vncSettingFormRef = React.createRef();
guacdSettingFormRef = React.createRef();
mailSettingFormRef = React.createRef();
ldapSettingFormRef = React.createRef();
logSettingFormRef = React.createRef();
otherSettingFormRef = React.createRef();
componentDidMount() {
// eslint-disable-next-line no-extend-native
@ -43,7 +42,15 @@ class Setting extends Component {
};
this.setState({
refs: [this.rdpSettingFormRef, this.sshSettingFormRef, this.vncSettingFormRef, this.guacdSettingFormRef, this.mailSettingFormRef, this.logSettingFormRef]
refs: [
this.rdpSettingFormRef,
this.sshSettingFormRef,
this.vncSettingFormRef,
this.guacdSettingFormRef,
this.mailSettingFormRef,
this.logSettingFormRef,
this.otherSettingFormRef
]
}, this.getProperties)
}
@ -121,26 +128,6 @@ class Setting extends Component {
reader.readAsText(files[0]);
}
ldapUserSync = async () => {
const id = 'ldap-user-sync'
try {
this.setState({
ldapUserSyncLoading: true
});
message.info({content: '同步中...', key: id, duration: 5});
let result = await request.post(`/properties/ldap-user-sync`);
if (result.code !== 1) {
message.error({content: result.message, key: id, duration: 10});
return;
}
message.success({content: '同步成功。', key: id, duration: 3});
} finally {
this.setState({
ldapUserSyncLoading: false
});
}
}
render() {
return (
<>
@ -551,7 +538,7 @@ class Setting extends Component {
</TabPane>
<TabPane tab="日志配置" key="log">
<Title level={3}>其他配置</Title>
<Title level={3}>日志配置</Title>
<Form ref={this.logSettingFormRef} name="log" onFinish={this.changeProperties}
layout="vertical">
@ -593,6 +580,28 @@ class Setting extends Component {
</Form>
</TabPane>
<TabPane tab="其他配置" key="other">
<Title level={3}>其他配置</Title>
<Form ref={this.otherSettingFormRef} name="other" onFinish={this.changeProperties}
layout="vertical">
<Form.Item
{...formItemLayout}
name="user-default-storage-size"
label="用户空间默认大小"
tooltip='无限制请填写-1'
>
<Input type={'number'} min={-1} suffix="MB"/>
</Form.Item>
<Form.Item {...formTailLayout}>
<Button type="primary" htmlType="submit">
更新
</Button>
</Form.Item>
</Form>
</TabPane>
<TabPane tab="备份与恢复" key="backup">
<Title level={3}>备份与恢复</Title>

View File

@ -280,7 +280,7 @@ class User extends Component {
let result = await request.delete('/users/' + id);
if (result.code === 1) {
message.success('操作成功', 3);
await this.loadTableData(this.state.queryParams);
this.loadTableData(this.state.queryParams);
} else {
message.error(result.message, 10);
}

View File

@ -425,8 +425,11 @@ class UserShareSelectedAsset extends Component {
<div>
<p>上传{renderStatus(item['strategy']['upload'])}</p>
<p>下载{renderStatus(item['strategy']['download'])}</p>
<p>编辑{renderStatus(item['strategy']['edit'])}</p>
<p>删除{renderStatus(item['strategy']['delete'])}</p>
<p>{renderStatus(item['strategy']['rename'])}</p>
<p>重命{renderStatus(item['strategy']['rename'])}</p>
<p>复制{renderStatus(item['strategy']['copy'])}</p>
<p>粘贴{renderStatus(item['strategy']['paste'])}</p>
</div>
);
}

BIN
web/src/images/bg.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB