@electerm/electerm-react 1.70.6 → 1.72.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.
Files changed (72) hide show
  1. package/client/common/cache.js +56 -0
  2. package/client/common/constants.js +2 -0
  3. package/client/common/default-setting.js +2 -1
  4. package/client/common/download.jsx +5 -7
  5. package/client/common/setting-list.js +27 -0
  6. package/client/components/ai/ai-cache.jsx +36 -0
  7. package/client/components/ai/ai-chat-history-item.jsx +1 -1
  8. package/client/components/ai/ai-chat.jsx +5 -40
  9. package/client/components/ai/ai-config-props.js +7 -0
  10. package/client/components/ai/ai-config.jsx +5 -14
  11. package/client/components/ai/ai.styl +0 -4
  12. package/client/components/ai/providers.js +2 -2
  13. package/client/components/batch-op/batch-op-entry.jsx +1 -1
  14. package/client/components/batch-op/batch-op.jsx +2 -2
  15. package/client/components/bookmark-form/form-ssh-common.jsx +2 -3
  16. package/client/components/bookmark-form/form-tabs.jsx +2 -2
  17. package/client/components/bookmark-form/render-connection-hopping.jsx +2 -2
  18. package/client/components/bookmark-form/render-delayed-scripts.jsx +4 -4
  19. package/client/components/bookmark-form/render-ssh-tunnel.jsx +2 -2
  20. package/client/components/bookmark-form/sftp-enable.jsx +9 -0
  21. package/client/components/bookmark-form/ssh-form-ui.jsx +1 -0
  22. package/client/components/bookmark-form/ssh-form.jsx +3 -0
  23. package/client/components/bookmark-form/use-quick-commands.jsx +2 -2
  24. package/client/components/bookmark-form/x11.jsx +78 -9
  25. package/client/components/common/input-auto-focus.jsx +3 -11
  26. package/client/components/layout/layout.jsx +2 -1
  27. package/client/components/main/main.jsx +5 -0
  28. package/client/components/profile/profile-form-elem.jsx +1 -3
  29. package/client/components/quick-commands/quick-commands-form-elem.jsx +1 -3
  30. package/client/components/quick-commands/quick-commands-list-form.jsx +2 -2
  31. package/client/components/session/session.jsx +80 -19
  32. package/client/components/session/session.styl +10 -3
  33. package/client/components/session/sessions.jsx +2 -1
  34. package/client/components/setting-panel/keywords-form.jsx +36 -38
  35. package/client/components/setting-panel/setting-modal.jsx +2 -2
  36. package/client/components/setting-panel/setting-terminal.jsx +2 -1
  37. package/client/components/setting-panel/tab-settings.jsx +26 -0
  38. package/client/components/sftp/address-bar.jsx +9 -2
  39. package/client/components/sftp/address-bookmark.jsx +4 -6
  40. package/client/components/sftp/file-item.jsx +1 -1
  41. package/client/components/sftp/file-read.js +14 -19
  42. package/client/components/sftp/keyword-filter.jsx +63 -0
  43. package/client/components/sftp/list-table-ui.jsx +7 -9
  44. package/client/components/sftp/sftp-entry.jsx +46 -9
  45. package/client/components/sftp/sftp.styl +6 -1
  46. package/client/components/sftp/transfer-conflict-store.jsx +1 -1
  47. package/client/components/shortcuts/shortcut-control.jsx +20 -0
  48. package/client/components/shortcuts/shortcut-editor.jsx +2 -2
  49. package/client/components/shortcuts/shortcuts.jsx +2 -2
  50. package/client/components/sidebar/info-modal.jsx +2 -2
  51. package/client/components/sidebar/transfer-list-control.jsx +18 -20
  52. package/client/components/ssh-config/ssh-config-item.jsx +2 -4
  53. package/client/components/ssh-config/ssh-config-load-notify.jsx +2 -2
  54. package/client/components/sys-menu/zoom.jsx +2 -2
  55. package/client/components/tabs/index.jsx +1 -1
  56. package/client/components/tabs/tab.jsx +3 -3
  57. package/client/components/terminal/cmd-item.jsx +32 -0
  58. package/client/components/terminal/command-tracker-addon.js +3 -1
  59. package/client/components/terminal/term-search.jsx +5 -6
  60. package/client/components/terminal/terminal-command-dropdown.jsx +303 -0
  61. package/client/components/terminal/terminal.jsx +88 -8
  62. package/client/components/terminal/terminal.styl +58 -0
  63. package/client/components/terminal-info/terminal-info.jsx +2 -2
  64. package/client/components/tree-list/tree-list.jsx +1 -1
  65. package/client/components/web/address-bar.jsx +2 -2
  66. package/client/store/common.js +27 -2
  67. package/client/store/init-state.js +3 -3
  68. package/client/store/item.js +2 -1
  69. package/client/store/setting.js +3 -2
  70. package/client/store/store.js +23 -24
  71. package/client/store/watch.js +7 -1
  72. package/package.json +1 -1
@@ -31,9 +31,6 @@ import deepCopy from 'json-deep-copy'
31
31
  import getBrand from '../components/ai/get-brand'
32
32
  import {
33
33
  settingMap,
34
- settingSyncId,
35
- settingShortcutsId,
36
- settingTerminalId,
37
34
  terminalSshConfigType,
38
35
  paneMap
39
36
  } from '../common/constants'
@@ -44,8 +41,6 @@ import {
44
41
  } from 'antd'
45
42
  import { refs } from '../components/common/ref'
46
43
 
47
- const e = window.translate
48
-
49
44
  class Store {
50
45
  constructor () {
51
46
  Object.assign(
@@ -123,8 +118,7 @@ class Store {
123
118
  return false
124
119
  }
125
120
  return currentTab.sshSftpSplitView ||
126
- currentTab.pane === paneMap.terminal ||
127
- currentTab.pane === paneMap.ssh
121
+ currentTab.pane === paneMap.terminal
128
122
  }
129
123
 
130
124
  get quickCommandTags () {
@@ -161,6 +155,28 @@ class Store {
161
155
  ]
162
156
  }
163
157
 
158
+ get terminalCommandSuggestions () {
159
+ const { store } = window
160
+ const historyCommands = Array.from(store.terminalCommandHistory)
161
+ const batchInputCommands = store.batchInputs
162
+ const quickCommands = store.quickCommands.reduce(
163
+ (p, q) => {
164
+ return [
165
+ ...p,
166
+ ...(q.commands || []).map(c => c.command)
167
+ ]
168
+ },
169
+ []
170
+ )
171
+
172
+ // Return raw commands
173
+ return {
174
+ history: historyCommands,
175
+ batch: batchInputCommands,
176
+ quick: quickCommands
177
+ }
178
+ }
179
+
164
180
  get termSearchOptions () {
165
181
  const {
166
182
  store
@@ -183,23 +199,6 @@ class Store {
183
199
  return window.store.tabs.map(d => d.title).join('#')
184
200
  }
185
201
 
186
- get setting () {
187
- return [
188
- {
189
- id: settingTerminalId,
190
- title: e('terminal')
191
- },
192
- {
193
- id: settingShortcutsId,
194
- title: e('settingShortcuts')
195
- },
196
- {
197
- id: settingSyncId,
198
- title: e('settingSync')
199
- }
200
- ]
201
- }
202
-
203
202
  get onOperation () {
204
203
  const {
205
204
  store
@@ -12,7 +12,8 @@ import {
12
12
  resolutionsLsKey,
13
13
  localAddrBookmarkLsKey,
14
14
  syncServerDataKey,
15
- aiChatHistoryKey
15
+ aiChatHistoryKey,
16
+ cmdHistoryKey
16
17
  } from '../common/constants'
17
18
  import * as ls from '../common/safe-local-storage'
18
19
  import { debounce, isEmpty } from 'lodash-es'
@@ -138,6 +139,11 @@ export default store => {
138
139
  return store.aiChatHistory
139
140
  }).start()
140
141
 
142
+ autoRun(() => {
143
+ ls.setItemJSON(cmdHistoryKey, Array.from(store.terminalCommandHistory))
144
+ return store.terminalCommandHistory
145
+ }).start()
146
+
141
147
  autoRun(() => {
142
148
  store.updateBatchInputSelectedTabIds()
143
149
  const tabs = store.getTabs()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electerm/electerm-react",
3
- "version": "1.70.6",
3
+ "version": "1.72.16",
4
4
  "description": "react components src for electerm",
5
5
  "main": "./client/components/main/main.jsx",
6
6
  "license": "MIT",