@electerm/electerm-react 2.3.191 → 2.4.16
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/common/fields.jsx +3 -0
- package/client/components/bookmark-form/common/ssh-agent.jsx +33 -0
- package/client/components/bookmark-form/config/common-fields.js +2 -4
- package/client/components/bookmark-form/config/serial.js +1 -1
- package/client/components/bookmark-form/config/ssh.js +1 -0
- 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 +131 -0
- package/client/components/common/message.styl +58 -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 +94 -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 +4 -3
- 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 +138 -0
- package/client/components/terminal/term-search.styl +1 -0
- package/client/components/terminal/terminal-command-dropdown.jsx +3 -0
- package/client/components/terminal/terminal.jsx +166 -104
- 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 -56
- 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
|
@@ -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
|
|
@@ -123,12 +125,6 @@ export default Store => {
|
|
|
123
125
|
case 'get_settings':
|
|
124
126
|
result = store.mcpGetSettings()
|
|
125
127
|
break
|
|
126
|
-
case 'list_terminal_themes':
|
|
127
|
-
result = store.mcpListTerminalThemes()
|
|
128
|
-
break
|
|
129
|
-
case 'list_ui_themes':
|
|
130
|
-
result = store.mcpListUiThemes()
|
|
131
|
-
break
|
|
132
128
|
|
|
133
129
|
default:
|
|
134
130
|
throw new Error(`Unknown tool: ${toolName}`)
|
|
@@ -148,27 +144,8 @@ export default Store => {
|
|
|
148
144
|
|
|
149
145
|
// ==================== Bookmark APIs ====================
|
|
150
146
|
|
|
151
|
-
Store.prototype.mcpListBookmarks = function (
|
|
152
|
-
|
|
153
|
-
let bookmarks = store.bookmarks
|
|
154
|
-
|
|
155
|
-
if (args.groupId) {
|
|
156
|
-
const group = store.bookmarkGroups.find(g => g.id === args.groupId)
|
|
157
|
-
if (group && group.bookmarkIds) {
|
|
158
|
-
const idSet = new Set(group.bookmarkIds)
|
|
159
|
-
bookmarks = bookmarks.filter(b => idSet.has(b.id))
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return bookmarks.map(b => ({
|
|
164
|
-
id: b.id,
|
|
165
|
-
title: b.title,
|
|
166
|
-
host: b.host,
|
|
167
|
-
port: b.port,
|
|
168
|
-
username: b.username,
|
|
169
|
-
type: b.type || 'ssh',
|
|
170
|
-
color: b.color
|
|
171
|
-
}))
|
|
147
|
+
Store.prototype.mcpListBookmarks = function () {
|
|
148
|
+
return deepCopy(window.store.bookmarks)
|
|
172
149
|
}
|
|
173
150
|
|
|
174
151
|
Store.prototype.mcpGetBookmark = function (args) {
|
|
@@ -177,9 +154,7 @@ export default Store => {
|
|
|
177
154
|
if (!bookmark) {
|
|
178
155
|
throw new Error(`Bookmark not found: ${args.id}`)
|
|
179
156
|
}
|
|
180
|
-
|
|
181
|
-
const { password, passphrase, privateKey, ...safeBookmark } = bookmark
|
|
182
|
-
return safeBookmark
|
|
157
|
+
return deepCopy(bookmark)
|
|
183
158
|
}
|
|
184
159
|
|
|
185
160
|
Store.prototype.mcpAddBookmark = async function (args) {
|
|
@@ -224,16 +199,11 @@ export default Store => {
|
|
|
224
199
|
|
|
225
200
|
Store.prototype.mcpDeleteBookmark = function (args) {
|
|
226
201
|
const { store } = window
|
|
227
|
-
const bookmark = store.bookmarks.find(b => b.id === args.id)
|
|
228
|
-
if (!bookmark) {
|
|
229
|
-
throw new Error(`Bookmark not found: ${args.id}`)
|
|
230
|
-
}
|
|
231
|
-
|
|
232
202
|
store.delItem({ id: args.id }, settingMap.bookmarks)
|
|
233
203
|
|
|
234
204
|
return {
|
|
235
205
|
success: true,
|
|
236
|
-
message: `Bookmark "${
|
|
206
|
+
message: `Bookmark "${args.id}" deleted`
|
|
237
207
|
}
|
|
238
208
|
}
|
|
239
209
|
|
|
@@ -255,14 +225,7 @@ export default Store => {
|
|
|
255
225
|
// ==================== Bookmark Group APIs ====================
|
|
256
226
|
|
|
257
227
|
Store.prototype.mcpListBookmarkGroups = function () {
|
|
258
|
-
|
|
259
|
-
return store.bookmarkGroups.map(g => ({
|
|
260
|
-
id: g.id,
|
|
261
|
-
title: g.title,
|
|
262
|
-
level: g.level,
|
|
263
|
-
bookmarkCount: (g.bookmarkIds || []).length,
|
|
264
|
-
subgroupCount: (g.bookmarkGroupIds || []).length
|
|
265
|
-
}))
|
|
228
|
+
return deepCopy(window.store.bookmarkGroups)
|
|
266
229
|
}
|
|
267
230
|
|
|
268
231
|
Store.prototype.mcpAddBookmarkGroup = async function (args) {
|
|
@@ -287,15 +250,7 @@ export default Store => {
|
|
|
287
250
|
// ==================== Quick Command APIs ====================
|
|
288
251
|
|
|
289
252
|
Store.prototype.mcpListQuickCommands = function () {
|
|
290
|
-
|
|
291
|
-
return store.quickCommands.map(q => ({
|
|
292
|
-
id: q.id,
|
|
293
|
-
name: q.name,
|
|
294
|
-
command: q.command,
|
|
295
|
-
commands: q.commands,
|
|
296
|
-
inputOnly: q.inputOnly,
|
|
297
|
-
labels: q.labels
|
|
298
|
-
}))
|
|
253
|
+
return deepCopy(window.store.quickCommands)
|
|
299
254
|
}
|
|
300
255
|
|
|
301
256
|
Store.prototype.mcpAddQuickCommand = function (args) {
|
|
@@ -303,7 +258,7 @@ export default Store => {
|
|
|
303
258
|
const qm = {
|
|
304
259
|
id: uid(),
|
|
305
260
|
name: args.name,
|
|
306
|
-
|
|
261
|
+
commands: args.commands,
|
|
307
262
|
inputOnly: args.inputOnly || false,
|
|
308
263
|
labels: args.labels || []
|
|
309
264
|
}
|
|
@@ -481,7 +436,6 @@ export default Store => {
|
|
|
481
436
|
|
|
482
437
|
Store.prototype.mcpGetTerminalSelection = function (args) {
|
|
483
438
|
const { store } = window
|
|
484
|
-
const { refs } = require('../components/common/ref')
|
|
485
439
|
const tabId = args.tabId || store.activeTabId
|
|
486
440
|
|
|
487
441
|
if (!tabId) {
|
|
@@ -503,7 +457,6 @@ export default Store => {
|
|
|
503
457
|
|
|
504
458
|
Store.prototype.mcpGetTerminalOutput = function (args) {
|
|
505
459
|
const { store } = window
|
|
506
|
-
const { refs } = require('../components/common/ref')
|
|
507
460
|
const tabId = args.tabId || store.activeTabId
|
|
508
461
|
const lineCount = args.lines || 50
|
|
509
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
|
-
}
|