@electerm/electerm-react 2.3.198 → 2.4.18
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/clipboard.js +1 -1
- package/client/common/constants.js +2 -2
- package/client/common/download.jsx +3 -2
- package/client/common/error-handler.jsx +5 -9
- package/client/common/fetch-from-server.js +1 -1
- package/client/common/fetch.jsx +5 -5
- package/client/common/icon-helpers.jsx +16 -0
- package/client/common/parse-json-safe.js +1 -1
- package/client/common/pre.js +0 -7
- package/client/common/sftp.js +1 -1
- package/client/common/terminal-theme.js +1 -1
- package/client/common/transfer.js +2 -2
- package/client/common/upgrade.js +2 -2
- package/client/components/ai/ai-chat.jsx +10 -1
- package/client/components/auth/login.jsx +1 -1
- package/client/components/bg/css-overwrite.jsx +1 -1
- package/client/components/bookmark-form/form-renderer.jsx +3 -2
- package/client/components/common/input-auto-focus.jsx +1 -1
- package/client/components/common/message.jsx +156 -0
- package/client/components/common/message.styl +56 -0
- package/client/components/common/modal.jsx +176 -0
- package/client/components/common/modal.styl +22 -0
- package/client/components/common/notification-with-details.jsx +1 -1
- package/client/components/common/notification.jsx +118 -0
- package/client/components/common/notification.styl +51 -0
- package/client/components/main/connection-hopping-warnning.jsx +1 -3
- package/client/components/main/error-wrapper.jsx +3 -2
- package/client/components/main/main.jsx +4 -11
- package/client/components/main/upgrade.jsx +6 -4
- package/client/components/profile/profile-form-elem.jsx +1 -1
- package/client/components/quick-commands/quick-commands-box.jsx +5 -2
- package/client/components/quick-commands/quick-commands-form-elem.jsx +1 -1
- package/client/components/rdp/rdp-session.jsx +2 -2
- package/client/components/session/session.jsx +4 -9
- package/client/components/setting-panel/deep-link-control.jsx +2 -1
- package/client/components/setting-panel/keyword-input.jsx +60 -0
- package/client/components/setting-panel/keywords-form.jsx +2 -7
- package/client/components/setting-panel/setting-common.jsx +1 -1
- package/client/components/setting-panel/setting-terminal.jsx +1 -1
- package/client/components/setting-panel/tab-settings.jsx +1 -1
- package/client/components/setting-sync/setting-sync-form.jsx +53 -3
- package/client/components/setting-sync/setting-sync.jsx +2 -1
- package/client/components/sftp/owner-list.js +6 -6
- package/client/components/sftp/sftp-entry.jsx +6 -4
- package/client/components/shortcuts/shortcut-editor.jsx +2 -2
- package/client/components/ssh-config/ssh-config-load-notify.jsx +3 -2
- package/client/components/tabs/tab.jsx +1 -1
- package/client/components/tabs/workspace-save-modal.jsx +2 -1
- package/client/components/terminal/attach-addon-custom.js +142 -26
- package/client/components/terminal/command-tracker-addon.js +164 -53
- package/client/components/terminal/highlight-addon.js +84 -43
- package/client/components/terminal/shell.js +164 -0
- package/client/components/terminal/terminal-command-dropdown.jsx +3 -0
- package/client/components/terminal/terminal.jsx +276 -118
- package/client/components/theme/theme-form.jsx +2 -1
- package/client/components/tree-list/bookmark-transport.jsx +27 -5
- package/client/components/vnc/vnc-session.jsx +1 -1
- package/client/components/widgets/widget-notification-with-details.jsx +1 -1
- package/client/store/common.js +5 -2
- package/client/store/db-upgrade.js +1 -1
- package/client/store/init-state.js +2 -1
- package/client/store/load-data.js +2 -2
- package/client/store/mcp-handler.js +9 -50
- package/client/store/setting.js +1 -3
- package/client/store/store.js +2 -1
- package/client/store/sync.js +14 -8
- package/client/store/system-menu.js +2 -1
- package/client/store/tab.js +1 -1
- package/client/store/widgets.js +1 -3
- package/package.json +1 -1
- package/client/common/track.js +0 -7
- package/client/components/batch-op/batch-op-entry.jsx +0 -13
|
@@ -35,7 +35,7 @@ function getHost (argv, opts) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export async function addTabFromCommandLine (store, opts) {
|
|
38
|
-
|
|
38
|
+
console.debug('command line params', opts)
|
|
39
39
|
if (!opts) {
|
|
40
40
|
return false
|
|
41
41
|
}
|
|
@@ -94,7 +94,7 @@ export async function addTabFromCommandLine (store, opts) {
|
|
|
94
94
|
if (options.privateKeyPath) {
|
|
95
95
|
conf.privateKey = await fs.readFile(options.privateKeyPath)
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
console.debug('command line opts', conf)
|
|
98
98
|
if (
|
|
99
99
|
(conf.username && conf.host) ||
|
|
100
100
|
conf.fromCmdLine
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import uid from '../common/uid'
|
|
7
7
|
import { settingMap } from '../common/constants'
|
|
8
|
+
import { refs } from '../components/common/ref'
|
|
9
|
+
import deepCopy from 'json-deep-copy'
|
|
8
10
|
|
|
9
11
|
export default Store => {
|
|
10
12
|
// Initialize MCP handler - called when MCP widget is started
|
|
@@ -142,27 +144,8 @@ export default Store => {
|
|
|
142
144
|
|
|
143
145
|
// ==================== Bookmark APIs ====================
|
|
144
146
|
|
|
145
|
-
Store.prototype.mcpListBookmarks = function (
|
|
146
|
-
|
|
147
|
-
let bookmarks = store.bookmarks
|
|
148
|
-
|
|
149
|
-
if (args.groupId) {
|
|
150
|
-
const group = store.bookmarkGroups.find(g => g.id === args.groupId)
|
|
151
|
-
if (group && group.bookmarkIds) {
|
|
152
|
-
const idSet = new Set(group.bookmarkIds)
|
|
153
|
-
bookmarks = bookmarks.filter(b => idSet.has(b.id))
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
return bookmarks.map(b => ({
|
|
158
|
-
id: b.id,
|
|
159
|
-
title: b.title,
|
|
160
|
-
host: b.host,
|
|
161
|
-
port: b.port,
|
|
162
|
-
username: b.username,
|
|
163
|
-
type: b.type || 'ssh',
|
|
164
|
-
color: b.color
|
|
165
|
-
}))
|
|
147
|
+
Store.prototype.mcpListBookmarks = function () {
|
|
148
|
+
return deepCopy(window.store.bookmarks)
|
|
166
149
|
}
|
|
167
150
|
|
|
168
151
|
Store.prototype.mcpGetBookmark = function (args) {
|
|
@@ -171,9 +154,7 @@ export default Store => {
|
|
|
171
154
|
if (!bookmark) {
|
|
172
155
|
throw new Error(`Bookmark not found: ${args.id}`)
|
|
173
156
|
}
|
|
174
|
-
|
|
175
|
-
const { password, passphrase, privateKey, ...safeBookmark } = bookmark
|
|
176
|
-
return safeBookmark
|
|
157
|
+
return deepCopy(bookmark)
|
|
177
158
|
}
|
|
178
159
|
|
|
179
160
|
Store.prototype.mcpAddBookmark = async function (args) {
|
|
@@ -218,16 +199,11 @@ export default Store => {
|
|
|
218
199
|
|
|
219
200
|
Store.prototype.mcpDeleteBookmark = function (args) {
|
|
220
201
|
const { store } = window
|
|
221
|
-
const bookmark = store.bookmarks.find(b => b.id === args.id)
|
|
222
|
-
if (!bookmark) {
|
|
223
|
-
throw new Error(`Bookmark not found: ${args.id}`)
|
|
224
|
-
}
|
|
225
|
-
|
|
226
202
|
store.delItem({ id: args.id }, settingMap.bookmarks)
|
|
227
203
|
|
|
228
204
|
return {
|
|
229
205
|
success: true,
|
|
230
|
-
message: `Bookmark "${
|
|
206
|
+
message: `Bookmark "${args.id}" deleted`
|
|
231
207
|
}
|
|
232
208
|
}
|
|
233
209
|
|
|
@@ -249,14 +225,7 @@ export default Store => {
|
|
|
249
225
|
// ==================== Bookmark Group APIs ====================
|
|
250
226
|
|
|
251
227
|
Store.prototype.mcpListBookmarkGroups = function () {
|
|
252
|
-
|
|
253
|
-
return store.bookmarkGroups.map(g => ({
|
|
254
|
-
id: g.id,
|
|
255
|
-
title: g.title,
|
|
256
|
-
level: g.level,
|
|
257
|
-
bookmarkCount: (g.bookmarkIds || []).length,
|
|
258
|
-
subgroupCount: (g.bookmarkGroupIds || []).length
|
|
259
|
-
}))
|
|
228
|
+
return deepCopy(window.store.bookmarkGroups)
|
|
260
229
|
}
|
|
261
230
|
|
|
262
231
|
Store.prototype.mcpAddBookmarkGroup = async function (args) {
|
|
@@ -281,15 +250,7 @@ export default Store => {
|
|
|
281
250
|
// ==================== Quick Command APIs ====================
|
|
282
251
|
|
|
283
252
|
Store.prototype.mcpListQuickCommands = function () {
|
|
284
|
-
|
|
285
|
-
return store.quickCommands.map(q => ({
|
|
286
|
-
id: q.id,
|
|
287
|
-
name: q.name,
|
|
288
|
-
command: q.command,
|
|
289
|
-
commands: q.commands,
|
|
290
|
-
inputOnly: q.inputOnly,
|
|
291
|
-
labels: q.labels
|
|
292
|
-
}))
|
|
253
|
+
return deepCopy(window.store.quickCommands)
|
|
293
254
|
}
|
|
294
255
|
|
|
295
256
|
Store.prototype.mcpAddQuickCommand = function (args) {
|
|
@@ -297,7 +258,7 @@ export default Store => {
|
|
|
297
258
|
const qm = {
|
|
298
259
|
id: uid(),
|
|
299
260
|
name: args.name,
|
|
300
|
-
|
|
261
|
+
commands: args.commands,
|
|
301
262
|
inputOnly: args.inputOnly || false,
|
|
302
263
|
labels: args.labels || []
|
|
303
264
|
}
|
|
@@ -475,7 +436,6 @@ export default Store => {
|
|
|
475
436
|
|
|
476
437
|
Store.prototype.mcpGetTerminalSelection = function (args) {
|
|
477
438
|
const { store } = window
|
|
478
|
-
const { refs } = require('../components/common/ref')
|
|
479
439
|
const tabId = args.tabId || store.activeTabId
|
|
480
440
|
|
|
481
441
|
if (!tabId) {
|
|
@@ -497,7 +457,6 @@ export default Store => {
|
|
|
497
457
|
|
|
498
458
|
Store.prototype.mcpGetTerminalOutput = function (args) {
|
|
499
459
|
const { store } = window
|
|
500
|
-
const { refs } = require('../components/common/ref')
|
|
501
460
|
const tabId = args.tabId || store.activeTabId
|
|
502
461
|
const lineCount = args.lines || 50
|
|
503
462
|
|
package/client/store/setting.js
CHANGED
package/client/store/store.js
CHANGED
|
@@ -234,7 +234,8 @@ class Store {
|
|
|
234
234
|
colorSuccess: themeConf.success,
|
|
235
235
|
colorWarning: themeConf.warn,
|
|
236
236
|
colorTextBase: themeConf.text,
|
|
237
|
-
colorLink: themeConf['text-light']
|
|
237
|
+
colorLink: themeConf['text-light'],
|
|
238
|
+
motion: false
|
|
238
239
|
},
|
|
239
240
|
algorithm: isColorDark(themeConf.main) ? theme.darkAlgorithm : theme.defaultAlgorithm
|
|
240
241
|
}
|
package/client/store/sync.js
CHANGED
|
@@ -80,6 +80,10 @@ export default (Store) => {
|
|
|
80
80
|
return get(window.store.config, 'syncSetting.' + type + 'GistId')
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
Store.prototype.getSyncProxy = function (type) {
|
|
84
|
+
return get(window.store.config, 'syncSetting.' + type + 'Proxy')
|
|
85
|
+
}
|
|
86
|
+
|
|
83
87
|
Store.prototype.testSyncToken = async function (type) {
|
|
84
88
|
const { store } = window
|
|
85
89
|
store.isSyncingSetting = true
|
|
@@ -89,12 +93,14 @@ export default (Store) => {
|
|
|
89
93
|
'test',
|
|
90
94
|
[],
|
|
91
95
|
token,
|
|
92
|
-
store.
|
|
93
|
-
).catch(
|
|
94
|
-
log.error
|
|
96
|
+
store.getSyncProxy(type)
|
|
95
97
|
)
|
|
98
|
+
.catch(err => {
|
|
99
|
+
console.error(err)
|
|
100
|
+
return err
|
|
101
|
+
})
|
|
96
102
|
store.isSyncingSetting = false
|
|
97
|
-
return
|
|
103
|
+
return gist
|
|
98
104
|
}
|
|
99
105
|
|
|
100
106
|
Store.prototype.createGist = async function (type) {
|
|
@@ -111,7 +117,7 @@ export default (Store) => {
|
|
|
111
117
|
public: false
|
|
112
118
|
}
|
|
113
119
|
const res = await fetchData(
|
|
114
|
-
type, 'create', [data], token, store.
|
|
120
|
+
type, 'create', [data], token, store.getSyncProxy(type)
|
|
115
121
|
).catch(
|
|
116
122
|
store.onError
|
|
117
123
|
)
|
|
@@ -184,7 +190,7 @@ export default (Store) => {
|
|
|
184
190
|
'getOne',
|
|
185
191
|
[gistId],
|
|
186
192
|
token,
|
|
187
|
-
store.
|
|
193
|
+
store.getSyncProxy(type)
|
|
188
194
|
)
|
|
189
195
|
updateSyncServerStatusFromGist(store, gist, type)
|
|
190
196
|
}
|
|
@@ -254,7 +260,7 @@ export default (Store) => {
|
|
|
254
260
|
'update',
|
|
255
261
|
[gistId, gistData],
|
|
256
262
|
token,
|
|
257
|
-
store.
|
|
263
|
+
store.getSyncProxy(type)
|
|
258
264
|
)
|
|
259
265
|
if (res) {
|
|
260
266
|
store.updateSyncSetting({
|
|
@@ -290,7 +296,7 @@ export default (Store) => {
|
|
|
290
296
|
'getOne',
|
|
291
297
|
[gistId],
|
|
292
298
|
token,
|
|
293
|
-
store.
|
|
299
|
+
store.getSyncProxy(type)
|
|
294
300
|
)
|
|
295
301
|
if (gist) {
|
|
296
302
|
updateSyncServerStatusFromGist(store, gist, type)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* system menu functions
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import Modal from '../components/common/modal'
|
|
6
6
|
import { isString } from 'lodash-es'
|
|
7
7
|
import getInitItem from '../common/init-setting-item'
|
|
8
8
|
import {
|
|
@@ -64,6 +64,7 @@ export default Store => {
|
|
|
64
64
|
Store.prototype.confirmExit = function (type) {
|
|
65
65
|
const { store } = window
|
|
66
66
|
let mod = null
|
|
67
|
+
console.log('confirmExit called')
|
|
67
68
|
mod = Modal.confirm({
|
|
68
69
|
onCancel: () => mod.destroy(),
|
|
69
70
|
onOk: store.doExit,
|
package/client/store/tab.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
maxHistory
|
|
11
11
|
} from '../common/constants'
|
|
12
12
|
import { refs, refsTabs } from '../components/common/ref'
|
|
13
|
-
import
|
|
13
|
+
import message from '../components/common/message'
|
|
14
14
|
import * as ls from '../common/safe-local-storage'
|
|
15
15
|
import deepCopy from 'json-deep-copy'
|
|
16
16
|
import generate from '../common/id-with-stamp'
|
package/client/store/widgets.js
CHANGED
package/package.json
CHANGED
package/client/common/track.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { lazy, Suspense } from 'react'
|
|
2
|
-
|
|
3
|
-
// Lazy load BatchOp
|
|
4
|
-
export const BatchOp = lazy(() => import('./batch-op'))
|
|
5
|
-
|
|
6
|
-
// Wrap BatchOp with Suspense
|
|
7
|
-
export default function BatchOpEntry (props) {
|
|
8
|
-
return (
|
|
9
|
-
<Suspense fallback={<>Loading...</>}>
|
|
10
|
-
<BatchOp {...props} />
|
|
11
|
-
</Suspense>
|
|
12
|
-
)
|
|
13
|
-
}
|