- 增加一定时间内登录失败次数的限制

- 增加离线会话保存时间限制
- 完成需求「使会话详情的路径栏可写」close 69
- 修复bug「Ubuntu系统RDP不能正常显示」close 66
- 修复bug「使用guacd接入ssh时,第一个按键被忽略」 close 70
This commit is contained in:
dushixiang
2021-02-23 18:50:13 +08:00
parent 6e2f9e9d90
commit cc9ed70822
15 changed files with 176 additions and 44 deletions

View File

@ -314,9 +314,6 @@ class Access extends Component {
};
onKeyDown = (keysym) => {
// if (this.state.clipboardVisible || this.state.fileSystemVisible) {
// return true;
// }
this.state.client.sendKeyEvent(1, keysym);
if (keysym === 65288) {
return false;
@ -426,6 +423,7 @@ class Access extends Component {
const sink = new Guacamole.InputSink();
display.appendChild(sink.getElement());
sink.focus();
// Keyboard
const keyboard = new Guacamole.Keyboard(sink.getElement());
@ -582,7 +580,7 @@ class Access extends Component {
<Draggable>
<Affix style={{position: 'absolute', top: 50, right: 100}}>
<Button icon={<ExpandOutlined/>} onClick={() => {
<Button icon={<ExpandOutlined/>} disabled={this.state.clientState !== STATE_CONNECTED} onClick={() => {
this.fullScreen();
}}/>
</Affix>
@ -590,7 +588,7 @@ class Access extends Component {
<Draggable>
<Affix style={{position: 'absolute', top: 50, right: 150}}>
<Button icon={<CopyTwoTone/>} onClick={() => {
<Button icon={<CopyTwoTone/>} disabled={this.state.clientState !== STATE_CONNECTED} onClick={() => {
this.setState({
clipboardVisible: true
});
@ -603,7 +601,7 @@ class Access extends Component {
<>
<Draggable>
<Affix style={{position: 'absolute', top: 100, right: 100}}>
<Button icon={<AppstoreTwoTone/>} onClick={() => {
<Button icon={<AppstoreTwoTone/>} disabled={this.state.clientState !== STATE_CONNECTED} onClick={() => {
this.setState({
fileSystemVisible: true,
});
@ -613,8 +611,8 @@ class Access extends Component {
<Draggable>
<Affix style={{position: 'absolute', top: 100, right: 150}}>
<Dropdown overlay={menu} trigger={['click']} placement="bottomLeft">
<Button icon={<DesktopOutlined/>}/>
<Dropdown overlay={menu} trigger={['click']} placement="bottomLeft">
<Button icon={<DesktopOutlined/>} disabled={this.state.clientState !== STATE_CONNECTED}/>
</Dropdown>
</Affix>
</Draggable>
@ -626,7 +624,7 @@ class Access extends Component {
<>
<Draggable>
<Affix style={{position: 'absolute', top: 100, right: 100}}>
<Button icon={<AppstoreTwoTone/>} onClick={() => {
<Button icon={<AppstoreTwoTone/>} disabled={this.state.clientState !== STATE_CONNECTED} onClick={() => {
this.setState({
fileSystemVisible: true,
});

View File

@ -37,6 +37,7 @@ class FileSystem extends Component {
state = {
sessionId: undefined,
currentDirectory: '/',
currentDirectoryInput: '/',
files: [],
loading: false,
selectedRowKeys: [],
@ -126,6 +127,7 @@ class FileSystem extends Component {
this.setState({
files: items,
currentDirectory: key,
currentDirectoryInput: key,
selectedRow: {},
selectedRowKeys: []
})
@ -189,6 +191,16 @@ class FileSystem extends Component {
return undefined;
};
handleCurrentDirectoryInputChange = (event) => {
this.setState({
currentDirectoryInput: event.target.value
})
}
handleCurrentDirectoryInputPressEnter = (event) => {
this.loadFiles(event.target.value);
}
render() {
const columns = [
@ -315,10 +327,11 @@ class FileSystem extends Component {
const title = (
<Row justify="space-around" align="middle" gutter={24}>
<Col span={16} key={1}>
{this.state.currentDirectory}
<Col span={20} key={1}>
<Input value={this.state.currentDirectoryInput} onChange={this.handleCurrentDirectoryInputChange}
onPressEnter={this.handleCurrentDirectoryInputPressEnter}/>
</Col>
<Col span={8} key={2} style={{textAlign: 'right'}}>
<Col span={4} key={2} style={{textAlign: 'right'}}>
<Space>
<Tooltip title="创建文件夹">
<Button type="primary" size="small" icon={<FolderAddOutlined/>}
@ -383,7 +396,6 @@ class FileSystem extends Component {
if (record['path'] === '..') {
// 获取当前目录的上级目录
let currentDirectory = this.state.currentDirectory;
console.log(currentDirectory)
let parentDirectory = currentDirectory.substring(0, currentDirectory.lastIndexOf('/'));
this.loadFiles(parentDirectory);
} else {

View File

@ -546,6 +546,21 @@ class Setting extends Component {
</> : null
}
<Form.Item
{...formItemLayout}
name="session-saved-limit"
label="会话录屏保存时长"
initialValue=""
>
<Select onChange={null}>
<Option value="">永久</Option>
<Option value="30">30</Option>
<Option value="60">60</Option>
<Option value="180">180</Option>
<Option value="360">360</Option>
</Select>
</Form.Item>
<Form.Item {...formTailLayout}>
<Button type="primary" htmlType="submit">
更新