@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.
- package/client/common/constants.js +2 -1
- package/client/common/db.js +2 -1
- package/client/common/download.jsx +15 -0
- package/client/common/init-setting-item.js +5 -0
- package/client/components/ai/ai-cache.jsx +1 -1
- package/client/components/batch-op/batch-op.jsx +1 -1
- package/client/components/bookmark-form/common/bookmark-group-tree-format.js +4 -3
- package/client/components/bookmark-form/common/ssh-host-selector.jsx +1 -1
- package/client/components/bookmark-form/common/ssh-tunnels.jsx +1 -0
- package/client/components/bookmark-form/tree-delete.jsx +18 -15
- package/client/components/common/input-auto-focus.jsx +16 -3
- package/client/components/common/logo-elem.jsx +1 -1
- package/client/components/common/password.jsx +1 -1
- package/client/components/footer/footer.styl +1 -0
- package/client/components/main/main.jsx +4 -1
- package/client/components/quick-commands/qm.styl +19 -0
- package/client/components/quick-commands/quick-commands-box.jsx +28 -36
- package/client/components/quick-commands/quick-commands-list-form.jsx +1 -0
- package/client/components/quick-commands/quick-commands-select.jsx +1 -1
- package/client/components/session/session.jsx +1 -1
- package/client/components/setting-panel/deep-link-control.jsx +1 -0
- package/client/components/setting-panel/list.styl +1 -1
- package/client/components/setting-panel/setting-common.jsx +1 -0
- package/client/components/setting-panel/setting-modal.jsx +13 -0
- package/client/components/setting-panel/setting-wrap.jsx +1 -1
- package/client/components/setting-panel/start-session-select.jsx +3 -3
- package/client/components/setting-panel/tab-widgets.jsx +35 -0
- package/client/components/sftp/address-bookmark-item.jsx +1 -1
- package/client/components/sftp/permission-render.jsx +1 -1
- package/client/components/sidebar/index.jsx +12 -2
- package/client/components/sidebar/transfer-history-modal.jsx +1 -1
- package/client/components/terminal/terminal-command-dropdown.jsx +2 -2
- package/client/components/text-editor/simple-editor.jsx +3 -1
- package/client/components/theme/theme-list-item.jsx +4 -3
- package/client/components/tree-list/move-item-modal.jsx +60 -9
- package/client/components/tree-list/tree-list.jsx +2 -14
- package/client/components/vnc/vnc-session.jsx +1 -1
- package/client/components/widgets/widget-control.jsx +64 -0
- package/client/components/widgets/widget-form.jsx +115 -0
- package/client/components/widgets/widget-instance.jsx +46 -0
- package/client/components/widgets/widget-instances.jsx +10 -0
- package/client/components/widgets/widgets-list.jsx +155 -0
- package/client/store/init-state.js +9 -1
- package/client/store/setting.js +1 -3
- package/client/store/store.js +2 -0
- package/client/store/widgets.js +59 -0
- 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
|
+
}
|