增加发送快捷键的功能
This commit is contained in:
parent
c98b3adbe6
commit
287a8eb0f5
@ -7,8 +7,10 @@ import {
|
|||||||
Card,
|
Card,
|
||||||
Col,
|
Col,
|
||||||
Drawer,
|
Drawer,
|
||||||
|
Dropdown,
|
||||||
Form,
|
Form,
|
||||||
Input,
|
Input,
|
||||||
|
Menu,
|
||||||
message,
|
message,
|
||||||
Modal,
|
Modal,
|
||||||
Row,
|
Row,
|
||||||
@ -21,22 +23,26 @@ import qs from "qs";
|
|||||||
import request from "../../common/request";
|
import request from "../../common/request";
|
||||||
import {server, wsServer} from "../../common/constants";
|
import {server, wsServer} from "../../common/constants";
|
||||||
import {
|
import {
|
||||||
|
AppstoreTwoTone,
|
||||||
CloudDownloadOutlined,
|
CloudDownloadOutlined,
|
||||||
CloudUploadOutlined,
|
CloudUploadOutlined,
|
||||||
|
CopyOutlined,
|
||||||
DeleteOutlined,
|
DeleteOutlined,
|
||||||
|
DesktopOutlined,
|
||||||
|
FileZipOutlined,
|
||||||
FolderAddOutlined,
|
FolderAddOutlined,
|
||||||
LoadingOutlined,
|
LoadingOutlined,
|
||||||
ReloadOutlined,
|
ReloadOutlined,
|
||||||
UploadOutlined
|
UploadOutlined
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import CopyOutlined from "@ant-design/icons/lib/icons/CopyOutlined";
|
|
||||||
import FolderOpenOutlined from "@ant-design/icons/lib/icons/FolderOpenOutlined";
|
|
||||||
import Upload from "antd/es/upload";
|
import Upload from "antd/es/upload";
|
||||||
import {download, getToken} from "../../utils/utils";
|
import {download, getToken} from "../../utils/utils";
|
||||||
import './Access.css'
|
import './Access.css'
|
||||||
|
import Draggable from 'react-draggable';
|
||||||
|
|
||||||
const {TextArea} = Input;
|
const {TextArea} = Input;
|
||||||
const {DirectoryTree} = Tree;
|
const {DirectoryTree} = Tree;
|
||||||
|
const {SubMenu} = Menu;
|
||||||
|
|
||||||
const STATE_IDLE = 0;
|
const STATE_IDLE = 0;
|
||||||
const STATE_CONNECTING = 1;
|
const STATE_CONNECTING = 1;
|
||||||
@ -339,6 +345,7 @@ class Access extends Component {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(keysym)
|
||||||
this.state.client.sendKeyEvent(1, keysym);
|
this.state.client.sendKeyEvent(1, keysym);
|
||||||
if (keysym === 65288) {
|
if (keysym === 65288) {
|
||||||
return false;
|
return false;
|
||||||
@ -763,6 +770,15 @@ class Access extends Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sendCombinationKey = (keys) => {
|
||||||
|
for (let i = 0; i < keys.length; i++) {
|
||||||
|
this.state.client.sendKeyEvent(1, keys[i]);
|
||||||
|
}
|
||||||
|
for (let j = 0; j < keys.length; j++) {
|
||||||
|
this.state.client.sendKeyEvent(0, keys[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
||||||
const title = (
|
const title = (
|
||||||
@ -799,6 +815,23 @@ class Access extends Component {
|
|||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const menu = (
|
||||||
|
<Menu>
|
||||||
|
<Menu.Item key="1" icon={<CopyOutlined/>} onClick={this.showClipboard}>
|
||||||
|
剪贴板
|
||||||
|
</Menu.Item>
|
||||||
|
<Menu.Item key="2" icon={<FileZipOutlined/>} onClick={this.showFileSystem}>
|
||||||
|
文件管理
|
||||||
|
</Menu.Item>
|
||||||
|
<SubMenu title="发送快捷键" icon={<DesktopOutlined/>}>
|
||||||
|
<Menu.Item
|
||||||
|
onClick={() => this.sendCombinationKey(['65507', '65513', '65535'])}>Ctrl+Alt+Delete</Menu.Item>
|
||||||
|
<Menu.Item
|
||||||
|
onClick={() => this.sendCombinationKey(['65507', '65513', '65288'])}>Ctrl+Alt+Backspace</Menu.Item>
|
||||||
|
</SubMenu>
|
||||||
|
</Menu>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
@ -850,32 +883,29 @@ class Access extends Component {
|
|||||||
</Upload>
|
</Upload>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
|
|
||||||
|
<Draggable>
|
||||||
<Affix style={{position: 'absolute', top: 50, right: 100}}>
|
<Affix style={{position: 'absolute', top: 50, right: 100}}>
|
||||||
<Button
|
<Dropdown overlay={menu} trigger={['click']} placement="bottomLeft">
|
||||||
shape="circle"
|
<Button icon={<AppstoreTwoTone/>}/>
|
||||||
icon={<CopyOutlined/>}
|
</Dropdown>
|
||||||
onClick={() => {
|
|
||||||
this.showClipboard();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
</Affix>
|
</Affix>
|
||||||
|
</Draggable>
|
||||||
|
|
||||||
{
|
{/*{*/}
|
||||||
this.state.protocol === 'ssh' || this.state.protocol === 'rdp' ?
|
{/* this.state.protocol === 'ssh' || this.state.protocol === 'rdp' ?*/}
|
||||||
<Affix style={{position: 'absolute', top: 50, right: 50}}>
|
{/* <Affix style={{position: 'absolute', top: 50, right: 50}}>*/}
|
||||||
<Button
|
{/* <Button*/}
|
||||||
shape="circle"
|
{/* shape="circle"*/}
|
||||||
icon={<FolderOpenOutlined/>}
|
{/* icon={<FolderOpenOutlined/>}*/}
|
||||||
onClick={() => {
|
{/* onClick={() => {*/}
|
||||||
this.showFileSystem();
|
{/* this.showFileSystem();*/}
|
||||||
}}
|
{/* }}*/}
|
||||||
>
|
{/* >*/}
|
||||||
</Button>
|
{/* </Button>*/}
|
||||||
</Affix>
|
{/* </Affix>*/}
|
||||||
: null
|
{/* : null*/}
|
||||||
}
|
{/*}*/}
|
||||||
|
|
||||||
|
|
||||||
<Drawer
|
<Drawer
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import React, {useState} from 'react';
|
import React, {useState} from 'react';
|
||||||
import {Form, Input, InputNumber, Modal, Radio, Select, Tooltip} from "antd/lib/index";
|
import {Form, Input, InputNumber, Modal, Radio, Select, Tooltip} from "antd/lib/index";
|
||||||
import {isEmpty} from "../../utils/utils";
|
|
||||||
|
|
||||||
const {TextArea} = Input;
|
const {TextArea} = Input;
|
||||||
const {Option} = Select;
|
const {Option} = Select;
|
||||||
|
@ -281,10 +281,8 @@ class OfflineSession extends Component {
|
|||||||
key: 'action',
|
key: 'action',
|
||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
let disabled = true;
|
let disabled = true;
|
||||||
let color = '#d9d9d9'
|
|
||||||
if (record['recording'] && record['recording'] === '1') {
|
if (record['recording'] && record['recording'] === '1') {
|
||||||
disabled = false
|
disabled = false
|
||||||
color = ''
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user