@electerm/electerm-react 2.3.118 → 2.3.136

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 (47) hide show
  1. package/client/common/constants.js +2 -1
  2. package/client/common/db.js +2 -1
  3. package/client/common/download.jsx +15 -0
  4. package/client/common/init-setting-item.js +5 -0
  5. package/client/components/ai/ai-cache.jsx +1 -1
  6. package/client/components/batch-op/batch-op.jsx +1 -1
  7. package/client/components/bookmark-form/common/bookmark-group-tree-format.js +4 -3
  8. package/client/components/bookmark-form/common/ssh-host-selector.jsx +1 -1
  9. package/client/components/bookmark-form/common/ssh-tunnels.jsx +1 -0
  10. package/client/components/bookmark-form/tree-delete.jsx +18 -15
  11. package/client/components/common/input-auto-focus.jsx +16 -3
  12. package/client/components/common/logo-elem.jsx +1 -1
  13. package/client/components/common/password.jsx +1 -1
  14. package/client/components/footer/footer.styl +1 -0
  15. package/client/components/main/main.jsx +4 -1
  16. package/client/components/quick-commands/qm.styl +19 -0
  17. package/client/components/quick-commands/quick-commands-box.jsx +28 -36
  18. package/client/components/quick-commands/quick-commands-list-form.jsx +1 -0
  19. package/client/components/quick-commands/quick-commands-select.jsx +1 -1
  20. package/client/components/session/session.jsx +1 -1
  21. package/client/components/setting-panel/deep-link-control.jsx +1 -0
  22. package/client/components/setting-panel/list.styl +1 -1
  23. package/client/components/setting-panel/setting-common.jsx +1 -0
  24. package/client/components/setting-panel/setting-modal.jsx +13 -0
  25. package/client/components/setting-panel/setting-wrap.jsx +1 -1
  26. package/client/components/setting-panel/start-session-select.jsx +3 -3
  27. package/client/components/setting-panel/tab-widgets.jsx +35 -0
  28. package/client/components/sftp/address-bookmark-item.jsx +1 -1
  29. package/client/components/sftp/permission-render.jsx +1 -1
  30. package/client/components/sidebar/index.jsx +12 -2
  31. package/client/components/sidebar/transfer-history-modal.jsx +1 -1
  32. package/client/components/terminal/terminal-command-dropdown.jsx +2 -2
  33. package/client/components/text-editor/simple-editor.jsx +3 -1
  34. package/client/components/theme/theme-list-item.jsx +4 -3
  35. package/client/components/tree-list/move-item-modal.jsx +60 -9
  36. package/client/components/tree-list/tree-list.jsx +2 -14
  37. package/client/components/vnc/vnc-session.jsx +1 -1
  38. package/client/components/widgets/widget-control.jsx +64 -0
  39. package/client/components/widgets/widget-form.jsx +115 -0
  40. package/client/components/widgets/widget-instance.jsx +46 -0
  41. package/client/components/widgets/widget-instances.jsx +10 -0
  42. package/client/components/widgets/widgets-list.jsx +155 -0
  43. package/client/store/init-state.js +9 -1
  44. package/client/store/setting.js +1 -3
  45. package/client/store/store.js +2 -0
  46. package/client/store/widgets.js +59 -0
  47. package/package.json +1 -1
@@ -0,0 +1,59 @@
1
+ /**
2
+ * widgets related functions
3
+ */
4
+
5
+ import {
6
+ message
7
+ } from 'antd'
8
+ import {
9
+ settingMap
10
+ } from '../common/constants'
11
+ import getInitItem from '../common/init-setting-item'
12
+
13
+ export default Store => {
14
+ Store.prototype.listWidgets = async () => {
15
+ return window.pre.runGlobalAsync('listWidgets')
16
+ }
17
+
18
+ Store.prototype.runWidget = async (widgetId, config) => {
19
+ return window.pre.runGlobalAsync('runWidget', widgetId, config)
20
+ }
21
+
22
+ Store.prototype.deleteWidgetInstance = (instanceId) => {
23
+ const {
24
+ widgetInstances
25
+ } = window.store
26
+ const index = widgetInstances.findIndex(w => w.id === instanceId)
27
+ if (index > -1) {
28
+ widgetInstances.splice(index, 1)
29
+ }
30
+ }
31
+
32
+ Store.prototype.stopWidget = async (instanceId) => {
33
+ const {
34
+ store
35
+ } = window
36
+ const r = await window.pre.runGlobalAsync('stopWidget', instanceId)
37
+ .catch(err => {
38
+ console.error('stopWidget error', err)
39
+ message.error(window.translate('stopWidgetFailed') + ': ' + err.message)
40
+ return false
41
+ })
42
+ if (r) {
43
+ store.deleteWidgetInstance(instanceId)
44
+ }
45
+ }
46
+
47
+ Store.prototype.runWidgetFunc = async (instanceId, funcName, ...args) => {
48
+ return window.pre.runGlobalAsync('runWidgetFunc', instanceId, funcName, ...args)
49
+ }
50
+
51
+ Store.prototype.openWidgetsModal = () => {
52
+ const {
53
+ store
54
+ } = window
55
+ store.setSettingItem(getInitItem([], settingMap.widgets))
56
+ store.settingTab = settingMap.widgets
57
+ store.openSettingModal()
58
+ }
59
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electerm/electerm-react",
3
- "version": "2.3.118",
3
+ "version": "2.3.136",
4
4
  "description": "react components src for electerm",
5
5
  "main": "./client/components/main/main.jsx",
6
6
  "license": "MIT",