@electerm/electerm-react 2.8.16 → 2.10.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/common/constants.js +3 -3
- package/client/common/pre.js +1 -120
- package/client/components/ai/ai-config.jsx +26 -3
- package/client/components/ai/ai-history-item.jsx +46 -0
- package/client/components/ai/ai-history.jsx +104 -0
- package/client/components/bookmark-form/ai-bookmark-form.jsx +338 -0
- package/client/components/bookmark-form/bookmark-form.styl +1 -1
- package/client/components/bookmark-form/bookmark-schema.js +192 -0
- package/client/components/bookmark-form/common/ai-category-select.jsx +32 -0
- package/client/components/bookmark-form/common/category-select.jsx +2 -4
- package/client/components/bookmark-form/common/fields.jsx +0 -10
- package/client/components/bookmark-form/config/ftp.js +2 -0
- package/client/components/bookmark-form/config/rdp.js +0 -1
- package/client/components/bookmark-form/config/session-config.js +3 -1
- package/client/components/bookmark-form/config/spice.js +43 -0
- package/client/components/bookmark-form/config/vnc.js +1 -2
- package/client/components/bookmark-form/fix-bookmark-default.js +134 -0
- package/client/components/bookmark-form/index.jsx +74 -14
- package/client/components/common/notification.jsx +34 -2
- package/client/components/common/notification.styl +18 -2
- package/client/components/main/wrapper.styl +0 -7
- package/client/components/rdp/rdp-session.jsx +44 -11
- package/client/components/session/session.jsx +13 -3
- package/client/components/setting-panel/deep-link-control.jsx +3 -2
- package/client/components/setting-panel/keywords-transport.jsx +0 -1
- package/client/components/shortcuts/shortcut-editor.jsx +12 -36
- package/client/components/shortcuts/shortcut-handler.js +11 -5
- package/client/components/sidebar/index.jsx +11 -1
- package/client/components/spice/spice-session.jsx +296 -0
- package/client/components/spice/spice.styl +4 -0
- package/client/components/tabs/add-btn-menu.jsx +9 -2
- package/client/components/terminal/attach-addon-custom.js +20 -76
- package/client/components/terminal/terminal.jsx +34 -28
- package/client/components/terminal/transfer-client-base.js +232 -0
- package/client/components/terminal/trzsz-client.js +306 -0
- package/client/components/terminal/xterm-loader.js +109 -0
- package/client/components/terminal/zmodem-client.js +13 -166
- package/client/components/text-editor/simple-editor.jsx +1 -2
- package/client/components/vnc/vnc-session.jsx +1 -1
- package/client/entry/electerm.jsx +0 -2
- package/client/store/load-data.js +1 -1
- package/client/store/store.js +1 -1
- package/client/store/system-menu.js +10 -0
- package/package.json +1 -1
- package/client/common/trzsz.js +0 -46
- package/client/components/bookmark-form/common/wiki-alert.jsx +0 -9
- package/client/components/common/notification-with-details.jsx +0 -34
- package/client/components/terminal/fs.js +0 -59
|
@@ -61,6 +61,16 @@ export default Store => {
|
|
|
61
61
|
store.openSettingModal()
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
Store.prototype.onNewSshAI = function () {
|
|
65
|
+
const { store } = window
|
|
66
|
+
if (store.aiConfigMissing()) {
|
|
67
|
+
store.toggleAIConfig()
|
|
68
|
+
return
|
|
69
|
+
}
|
|
70
|
+
window.et.openBookmarkWithAIMode = true
|
|
71
|
+
store.onNewSsh()
|
|
72
|
+
}
|
|
73
|
+
|
|
64
74
|
Store.prototype.confirmExit = function (type) {
|
|
65
75
|
const { store } = window
|
|
66
76
|
let mod = null
|
package/package.json
CHANGED
package/client/common/trzsz.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { TrzszFilter } from 'trzsz'
|
|
2
|
-
import { chooseSaveDirectory } from './choose-save-folder'
|
|
3
|
-
|
|
4
|
-
const {
|
|
5
|
-
openDialog
|
|
6
|
-
} = window.api
|
|
7
|
-
|
|
8
|
-
window.newTrzsz = function (
|
|
9
|
-
writeToTerminal,
|
|
10
|
-
sendToServer,
|
|
11
|
-
terminalColumns,
|
|
12
|
-
isWindowsShell
|
|
13
|
-
) {
|
|
14
|
-
// create a trzsz filter
|
|
15
|
-
return new TrzszFilter({
|
|
16
|
-
// write the server output to the terminal
|
|
17
|
-
writeToTerminal,
|
|
18
|
-
// send the user input to the server
|
|
19
|
-
sendToServer,
|
|
20
|
-
// choose some files to be sent to the server
|
|
21
|
-
chooseSendFiles: async (directory) => {
|
|
22
|
-
const properties = [
|
|
23
|
-
'openFile',
|
|
24
|
-
'multiSelections',
|
|
25
|
-
'showHiddenFiles',
|
|
26
|
-
'noResolveAliases',
|
|
27
|
-
'treatPackageAsDirectory',
|
|
28
|
-
'dontAddToRecent'
|
|
29
|
-
]
|
|
30
|
-
if (directory) {
|
|
31
|
-
properties.push('openDirectory')
|
|
32
|
-
}
|
|
33
|
-
return openDialog({
|
|
34
|
-
title: 'Choose some files to send',
|
|
35
|
-
message: 'Choose some files to send',
|
|
36
|
-
properties
|
|
37
|
-
})
|
|
38
|
-
},
|
|
39
|
-
// choose a directory to save the received files
|
|
40
|
-
chooseSaveDirectory,
|
|
41
|
-
// the terminal columns
|
|
42
|
-
terminalColumns,
|
|
43
|
-
// there is a windows shell
|
|
44
|
-
isWindowsShell
|
|
45
|
-
})
|
|
46
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { notification } from './notification'
|
|
2
|
-
import { CopyOutlined } from '@ant-design/icons'
|
|
3
|
-
import { copy } from '../../common/clipboard'
|
|
4
|
-
|
|
5
|
-
export function showMsg (message, type = 'success', serverInfo = null, duration = 10, description = '') {
|
|
6
|
-
const handleCopy = () => {
|
|
7
|
-
if (serverInfo && serverInfo.url) {
|
|
8
|
-
copy(serverInfo.url)
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
let desc = description
|
|
13
|
-
if (serverInfo) {
|
|
14
|
-
desc = (
|
|
15
|
-
<div>
|
|
16
|
-
{description && <div>{description}</div>}
|
|
17
|
-
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
18
|
-
<span>URL: <b>{serverInfo.url}</b></span>
|
|
19
|
-
<CopyOutlined
|
|
20
|
-
className='pointer mg1l'
|
|
21
|
-
onClick={handleCopy}
|
|
22
|
-
/>
|
|
23
|
-
</div>
|
|
24
|
-
<div>Path: <b>{serverInfo.path}</b></div>
|
|
25
|
-
</div>
|
|
26
|
-
)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
notification[type]({
|
|
30
|
-
message,
|
|
31
|
-
description: desc,
|
|
32
|
-
duration
|
|
33
|
-
})
|
|
34
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export const open = (filePath, flag) => {
|
|
2
|
-
const fs = window.require('fs')
|
|
3
|
-
return new Promise((resolve, reject) => {
|
|
4
|
-
fs.open(filePath, flag, (err, fd) => {
|
|
5
|
-
if (err) {
|
|
6
|
-
return reject(err)
|
|
7
|
-
}
|
|
8
|
-
return resolve(fd)
|
|
9
|
-
})
|
|
10
|
-
})
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const close = (fd) => {
|
|
14
|
-
const fs = window.require('fs')
|
|
15
|
-
return new Promise((resolve, reject) => {
|
|
16
|
-
fs.close(fd, (err) => {
|
|
17
|
-
if (err) {
|
|
18
|
-
return reject(err)
|
|
19
|
-
}
|
|
20
|
-
return resolve(true)
|
|
21
|
-
})
|
|
22
|
-
})
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const exists = (filePath) => {
|
|
26
|
-
const fs = window.require('fs')
|
|
27
|
-
return new Promise((resolve, reject) => {
|
|
28
|
-
fs.access(filePath, (err) => {
|
|
29
|
-
if (err) {
|
|
30
|
-
return reject(err)
|
|
31
|
-
}
|
|
32
|
-
return resolve(true)
|
|
33
|
-
})
|
|
34
|
-
})
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const read = (fd, buffer, offset, length, position) => {
|
|
38
|
-
const fs = window.require('fs')
|
|
39
|
-
return new Promise((resolve, reject) => {
|
|
40
|
-
fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {
|
|
41
|
-
if (err) {
|
|
42
|
-
return reject(err)
|
|
43
|
-
}
|
|
44
|
-
return resolve(buffer.subarray(0, bytesRead))
|
|
45
|
-
})
|
|
46
|
-
})
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export const write = (fd, buffer) => {
|
|
50
|
-
const fs = window.require('fs')
|
|
51
|
-
return new Promise((resolve, reject) => {
|
|
52
|
-
fs.write(fd, buffer, (err, buffer) => {
|
|
53
|
-
if (err) {
|
|
54
|
-
return reject(err)
|
|
55
|
-
}
|
|
56
|
-
return resolve(buffer)
|
|
57
|
-
})
|
|
58
|
-
})
|
|
59
|
-
}
|