@electerm/electerm-react 1.40.20 → 1.50.31
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 +57 -7
- package/client/common/new-terminal.js +2 -2
- package/client/components/auth/login.jsx +34 -57
- package/client/components/batch-op/batch-op.jsx +12 -11
- package/client/components/bookmark-form/index.jsx +2 -2
- package/client/components/bookmark-form/ssh-form.jsx +4 -1
- package/client/components/bookmark-form/tree-delete.jsx +5 -5
- package/client/components/context-menu/boomarks.jsx +8 -12
- package/client/components/context-menu/context-menu.jsx +10 -10
- package/client/components/context-menu/history.jsx +21 -24
- package/client/components/context-menu/menu-btn.jsx +11 -11
- package/client/components/context-menu/tabs.jsx +15 -19
- package/client/components/context-menu/zoom.jsx +25 -29
- package/client/components/footer/footer-entry.jsx +56 -56
- package/client/components/icons/split-icons.jsx +77 -0
- package/client/components/layout/layout-alg.js +260 -0
- package/client/components/layout/layout-item.jsx +94 -0
- package/client/components/layout/layout.jsx +167 -0
- package/client/components/layout/layout.styl +8 -0
- package/client/components/layout/layouts.jsx +72 -0
- package/client/components/layout/session-size-alg.js +31 -0
- package/client/components/main/custom-css.jsx +1 -1
- package/client/components/main/main.jsx +184 -110
- package/client/components/main/ui-theme.jsx +1 -1
- package/client/components/main/wrapper.styl +2 -4
- package/client/components/profile/profile-list.jsx +1 -3
- package/client/components/profile/profile-transport-mod.jsx +1 -1
- package/client/components/profile/profile-transport.jsx +6 -9
- package/client/components/quick-commands/quick-command-transport.jsx +6 -9
- package/client/components/quick-commands/quick-commands-box.jsx +144 -153
- package/client/components/quick-commands/quick-commands-select.jsx +10 -3
- package/client/components/rdp/rdp-session.jsx +3 -23
- package/client/components/rdp/resolution-edit.jsx +40 -42
- package/client/components/session/session.jsx +63 -328
- package/client/components/session/session.styl +1 -5
- package/client/components/session/sessions.jsx +140 -111
- package/client/components/setting-panel/bookmark-tree-list.jsx +1 -1
- package/client/components/setting-panel/setting-common.jsx +6 -4
- package/client/components/setting-panel/setting-modal.jsx +31 -31
- package/client/components/setting-panel/start-session-select.jsx +4 -4
- package/client/components/setting-panel/tab-settings.jsx +27 -5
- package/client/components/setting-sync/data-import.jsx +36 -39
- package/client/components/setting-sync/setting-sync-form.jsx +10 -10
- package/client/components/setting-sync/setting-sync.jsx +50 -52
- package/client/components/sftp/address-bookmark.jsx +57 -58
- package/client/components/sftp/confirm-modal-store.jsx +34 -40
- package/client/components/sftp/file-item.jsx +14 -3
- package/client/components/sftp/file-mode-modal.jsx +3 -0
- package/client/components/sftp/list-table-ui.jsx +4 -4
- package/client/components/sftp/sftp-entry.jsx +2 -2
- package/client/components/sftp/transfer-conflict-store.jsx +13 -17
- package/client/components/sftp/transport-action-store.jsx +38 -31
- package/client/components/sftp/transports-action-store.jsx +3 -3
- package/client/components/sftp/transports-ui-store.jsx +18 -23
- package/client/components/shortcuts/shortcut-handler.js +1 -0
- package/client/components/shortcuts/shortcuts-defaults.js +5 -5
- package/client/components/shortcuts/shortcuts.jsx +9 -12
- package/client/components/side-panel-r/right-side-panel.styl +40 -0
- package/client/components/side-panel-r/side-panel-r.jsx +102 -0
- package/client/components/sidebar/bookmark-select.jsx +40 -40
- package/client/components/sidebar/bookmark.jsx +63 -65
- package/client/components/sidebar/history.jsx +53 -50
- package/client/components/sidebar/index.jsx +195 -184
- package/client/components/sidebar/info-modal.jsx +202 -202
- package/client/components/sidebar/sidebar.styl +8 -2
- package/client/components/sidebar/transfer-history-modal.jsx +95 -100
- package/client/components/sidebar/transfer-list-control.jsx +2 -2
- package/client/components/sidebar/transfer-list.jsx +45 -42
- package/client/components/sidebar/transfer-modal.jsx +49 -52
- package/client/components/sidebar/transport-ui.jsx +1 -1
- package/client/components/tabs/index.jsx +261 -49
- package/client/components/tabs/tab.jsx +48 -66
- package/client/components/tabs/tabs.styl +6 -1
- package/client/components/tabs/window-control.jsx +46 -48
- package/client/components/terminal/attach-addon-custom.js +1 -1
- package/client/components/terminal/index.jsx +111 -113
- package/client/components/terminal/term-search.jsx +26 -24
- package/client/components/terminal-info/run-cmd.jsx +0 -25
- package/client/components/terminal-info/terminal-info.jsx +60 -0
- package/client/components/terminal-info/terminal-info.styl +1 -1
- package/client/components/tree-list/bookmark-transport.jsx +8 -9
- package/client/components/tree-list/tree-list.jsx +36 -26
- package/client/components/vnc/vnc-session.jsx +1 -6
- package/client/components/web/address-bar.jsx +50 -0
- package/client/components/web/web-session.jsx +32 -10
- package/client/entry/index.jsx +5 -6
- package/client/store/common.js +1 -1
- package/client/store/db-upgrade.js +1 -1
- package/client/store/event.js +2 -2
- package/client/store/index.js +21 -32
- package/client/store/init-state.js +15 -3
- package/client/store/load-data.js +1 -1
- package/client/store/quick-command.js +4 -4
- package/client/store/session.js +1 -1
- package/client/store/setting.js +10 -6
- package/client/store/system-menu.js +1 -10
- package/client/store/tab.js +91 -1
- package/client/store/transfer-list.js +5 -6
- package/client/store/watch.js +11 -6
- package/package.json +1 -1
- package/client/components/common/react-subx.jsx +0 -1
- package/client/components/common/resize-wrap.jsx +0 -222
- package/client/components/common/resize-wrap.styl +0 -9
- package/client/components/terminal-info/content.jsx +0 -152
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { memo } from 'react'
|
|
1
2
|
import {
|
|
2
3
|
GithubOutlined,
|
|
3
4
|
GlobalOutlined,
|
|
@@ -10,7 +11,6 @@ import {
|
|
|
10
11
|
BugOutlined,
|
|
11
12
|
HeartOutlined
|
|
12
13
|
} from '@ant-design/icons'
|
|
13
|
-
import { Component } from '../common/react-subx'
|
|
14
14
|
import { Modal, Tabs, Button } from 'antd'
|
|
15
15
|
import Link from '../common/external-link'
|
|
16
16
|
import LogoElem from '../common/logo-elem'
|
|
@@ -24,20 +24,22 @@ import './info.styl'
|
|
|
24
24
|
|
|
25
25
|
const e = window.translate
|
|
26
26
|
|
|
27
|
-
export default
|
|
28
|
-
handleChangeTab = key => {
|
|
29
|
-
|
|
27
|
+
export default memo(function InfoModal (props) {
|
|
28
|
+
const handleChangeTab = key => {
|
|
29
|
+
window.store.infoModalTab = key
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
renderCheckUpdate = () => {
|
|
33
|
-
if (srcsSkipUpgradeCheck.includes(
|
|
32
|
+
const renderCheckUpdate = () => {
|
|
33
|
+
if (srcsSkipUpgradeCheck.includes(props.installSrc)) {
|
|
34
34
|
return null
|
|
35
35
|
}
|
|
36
|
-
const { store } = this.props
|
|
37
36
|
const {
|
|
38
37
|
onCheckUpdate
|
|
39
|
-
} = store
|
|
40
|
-
const
|
|
38
|
+
} = window.store
|
|
39
|
+
const {
|
|
40
|
+
upgradeInfo
|
|
41
|
+
} = props
|
|
42
|
+
const onCheckUpdating = upgradeInfo.checkingRemoteVersion || upgradeInfo.upgrading
|
|
41
43
|
return (
|
|
42
44
|
<p className='mg1b mg2t'>
|
|
43
45
|
<Button
|
|
@@ -51,206 +53,204 @@ export default class InfoModal extends Component {
|
|
|
51
53
|
)
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
formatJSON = (jsonStr) => {
|
|
56
|
+
const formatJSON = (jsonStr) => {
|
|
55
57
|
return JSON.stringify(JSON.parse(jsonStr), null, 2)
|
|
56
58
|
}
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
<
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
<
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
<
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
<
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
<
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
<
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
<
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
<
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
60
|
+
const { infoModalTab, commandLineHelp } = props
|
|
61
|
+
const {
|
|
62
|
+
showInfoModal
|
|
63
|
+
} = window.store
|
|
64
|
+
function onCloseAbout () {
|
|
65
|
+
window.store.showInfoModal = false
|
|
66
|
+
}
|
|
67
|
+
if (!showInfoModal) {
|
|
68
|
+
return null
|
|
69
|
+
}
|
|
70
|
+
const {
|
|
71
|
+
name,
|
|
72
|
+
// description,
|
|
73
|
+
devDependencies,
|
|
74
|
+
dependencies,
|
|
75
|
+
langugeRepo,
|
|
76
|
+
author: {
|
|
77
|
+
name: authorName,
|
|
78
|
+
email,
|
|
79
|
+
url: authorUrl
|
|
80
|
+
},
|
|
81
|
+
homepage,
|
|
82
|
+
bugs: {
|
|
83
|
+
url: bugReportLink
|
|
84
|
+
},
|
|
85
|
+
releases: releaseLink,
|
|
86
|
+
privacyNoticeLink,
|
|
87
|
+
sponsorLink,
|
|
88
|
+
knownIssuesLink
|
|
89
|
+
} = packInfo
|
|
90
|
+
const link = releaseLink.replace('/releases', '')
|
|
91
|
+
const { env, versions } = window.pre
|
|
92
|
+
const deps = {
|
|
93
|
+
...devDependencies,
|
|
94
|
+
...dependencies
|
|
95
|
+
}
|
|
96
|
+
const envs = {
|
|
97
|
+
...versions,
|
|
98
|
+
...env
|
|
99
|
+
}
|
|
100
|
+
const title = (
|
|
101
|
+
<div className='ant-modal-confirm-title font16'>
|
|
102
|
+
<InfoCircleOutlined className='font20 mg1r' /> {e('about')} {name}
|
|
103
|
+
</div>
|
|
104
|
+
)
|
|
105
|
+
const attrs = {
|
|
106
|
+
title,
|
|
107
|
+
width: window.innerWidth - 100,
|
|
108
|
+
maskClosable: true,
|
|
109
|
+
okText: e('ok'),
|
|
110
|
+
onCancel: onCloseAbout,
|
|
111
|
+
footer: null,
|
|
112
|
+
open: true,
|
|
113
|
+
wrapClassName: 'info-modal'
|
|
114
|
+
}
|
|
115
|
+
const items = [
|
|
116
|
+
{
|
|
117
|
+
key: infoTabs.info,
|
|
118
|
+
label: e('about'),
|
|
119
|
+
children: (
|
|
120
|
+
<div>
|
|
121
|
+
<LogoElem />
|
|
122
|
+
<p className='mg2b'>{e('desc')}</p>
|
|
123
|
+
<p className='mg1b'>
|
|
124
|
+
<UserOutlined /> <b className='mg1r'>{e('author')} ➾</b>
|
|
125
|
+
<Link to={authorUrl} className='mg1l'>
|
|
126
|
+
{authorName} ({email})
|
|
127
|
+
</Link>
|
|
128
|
+
</p>
|
|
129
|
+
<p className='mg1b'>
|
|
130
|
+
<HomeOutlined /> <b>{e('homepage')}/{e('download')} ➾</b>
|
|
131
|
+
<Link to={homepage} className='mg1l'>
|
|
132
|
+
{homepage}
|
|
133
|
+
</Link>
|
|
134
|
+
</p>
|
|
135
|
+
<p className='mg1b'>
|
|
136
|
+
<GithubOutlined /> <b className='mg1r'>github ➾</b>
|
|
137
|
+
<Link to={link} className='mg1l'>
|
|
138
|
+
{link}
|
|
139
|
+
</Link>
|
|
140
|
+
</p>
|
|
141
|
+
<p className='mg1b'>
|
|
142
|
+
<GlobalOutlined /> <b className='mg1r'>{e('language')} repo ➾</b>
|
|
143
|
+
<Link to={langugeRepo} className='mg1l'>
|
|
144
|
+
{langugeRepo}
|
|
145
|
+
</Link>
|
|
146
|
+
</p>
|
|
147
|
+
<p className='mg1b'>
|
|
148
|
+
<BugOutlined /> <b className='mg1r'>{e('bugReport')} ➾</b>
|
|
149
|
+
<Link to={bugReportLink} className='mg1l'>
|
|
150
|
+
{bugReportLink}
|
|
151
|
+
</Link>
|
|
152
|
+
</p>
|
|
153
|
+
<p className='mg1b'>
|
|
154
|
+
<HighlightOutlined /> <b className='mg1r'>{e('changeLog')} ➾</b>
|
|
155
|
+
<Link to={releaseLink} className='mg1l'>
|
|
156
|
+
{releaseLink}
|
|
157
|
+
</Link>
|
|
158
|
+
</p>
|
|
159
|
+
<p className='mg1b'>
|
|
160
|
+
<AlignLeftOutlined /> <b className='mg1r'>{e('knownIssues')} ➾</b>
|
|
161
|
+
<Link to={knownIssuesLink} className='mg1l'>
|
|
162
|
+
{knownIssuesLink}
|
|
163
|
+
</Link>
|
|
164
|
+
</p>
|
|
165
|
+
<p className='mg1b'>
|
|
166
|
+
<WarningOutlined /> <b className='mg1r'>{e('privacyNotice')} ➾</b>
|
|
167
|
+
<Link to={privacyNoticeLink} className='mg1l'>
|
|
168
|
+
{privacyNoticeLink}
|
|
169
|
+
</Link>
|
|
170
|
+
</p>
|
|
171
|
+
<p className='mg1b'>
|
|
172
|
+
<HeartOutlined /> <b className='mg1r'>{e('sponsorElecterm')} ➾</b>
|
|
173
|
+
<Link to={sponsorLink} className='mg1l'>
|
|
174
|
+
{sponsorLink}
|
|
175
|
+
</Link>
|
|
176
|
+
</p>
|
|
177
|
+
{renderCheckUpdate()}
|
|
178
|
+
</div>
|
|
179
|
+
)
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
key: infoTabs.deps,
|
|
183
|
+
label: e('dependencies'),
|
|
184
|
+
children: Object.keys(deps).map((k, i) => {
|
|
185
|
+
const v = deps[k]
|
|
186
|
+
return (
|
|
187
|
+
<div className='pd1b' key={i + '_dp_' + k}>
|
|
188
|
+
<b className='bold'>{k}</b>:
|
|
189
|
+
<span className='mg1l'>
|
|
190
|
+
{v}
|
|
191
|
+
</span>
|
|
177
192
|
</div>
|
|
178
193
|
)
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
</
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
key: infoTabs.os,
|
|
212
|
-
label: e('os'),
|
|
213
|
-
children: window.pre.osInfo().map(({ k, v }, i) => {
|
|
214
|
-
return (
|
|
215
|
-
<div className='pd1b' key={i + '_os_' + k}>
|
|
216
|
-
<b className='bold'>{k}</b>:
|
|
217
|
-
<span className='mg1l'>
|
|
218
|
-
{
|
|
219
|
-
v.length > 30
|
|
220
|
-
? <pre>{this.formatJSON(v)}</pre>
|
|
221
|
-
: v
|
|
222
|
-
}
|
|
223
|
-
</span>
|
|
224
|
-
</div>
|
|
225
|
-
)
|
|
226
|
-
})
|
|
227
|
-
}
|
|
228
|
-
]
|
|
229
|
-
|
|
230
|
-
if (!window.et.isWebApp) {
|
|
231
|
-
items.push({
|
|
232
|
-
key: infoTabs.cmd,
|
|
233
|
-
label: e('commandLineUsage'),
|
|
234
|
-
children: (
|
|
235
|
-
<pre>
|
|
236
|
-
<code>{commandLineHelp}</code>
|
|
237
|
-
</pre>
|
|
194
|
+
})
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
key: infoTabs.env,
|
|
198
|
+
label: e('env'),
|
|
199
|
+
children: Object.keys(envs).map((k, i) => {
|
|
200
|
+
const v = envs[k]
|
|
201
|
+
return (
|
|
202
|
+
<div className='pd1b' key={i + '_env_' + k}>
|
|
203
|
+
<b className='bold'>{k}</b>:
|
|
204
|
+
<span className='mg1l'>
|
|
205
|
+
{v}
|
|
206
|
+
</span>
|
|
207
|
+
</div>
|
|
208
|
+
)
|
|
209
|
+
})
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
key: infoTabs.os,
|
|
213
|
+
label: e('os'),
|
|
214
|
+
children: window.pre.osInfo().map(({ k, v }, i) => {
|
|
215
|
+
return (
|
|
216
|
+
<div className='pd1b' key={i + '_os_' + k}>
|
|
217
|
+
<b className='bold'>{k}</b>:
|
|
218
|
+
<span className='mg1l'>
|
|
219
|
+
{
|
|
220
|
+
v.length > 30
|
|
221
|
+
? <pre>{formatJSON(v)}</pre>
|
|
222
|
+
: v
|
|
223
|
+
}
|
|
224
|
+
</span>
|
|
225
|
+
</div>
|
|
238
226
|
)
|
|
239
227
|
})
|
|
240
228
|
}
|
|
229
|
+
]
|
|
241
230
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
</div>
|
|
253
|
-
</Modal>
|
|
254
|
-
)
|
|
231
|
+
if (!window.et.isWebApp) {
|
|
232
|
+
items.push({
|
|
233
|
+
key: infoTabs.cmd,
|
|
234
|
+
label: e('commandLineUsage'),
|
|
235
|
+
children: (
|
|
236
|
+
<pre>
|
|
237
|
+
<code>{commandLineHelp}</code>
|
|
238
|
+
</pre>
|
|
239
|
+
)
|
|
240
|
+
})
|
|
255
241
|
}
|
|
256
|
-
|
|
242
|
+
|
|
243
|
+
return (
|
|
244
|
+
<Modal
|
|
245
|
+
{...attrs}
|
|
246
|
+
>
|
|
247
|
+
<div className='about-wrap'>
|
|
248
|
+
<Tabs
|
|
249
|
+
activeKey={infoModalTab}
|
|
250
|
+
onChange={handleChangeTab}
|
|
251
|
+
items={items}
|
|
252
|
+
/>
|
|
253
|
+
</div>
|
|
254
|
+
</Modal>
|
|
255
|
+
)
|
|
256
|
+
})
|
|
@@ -60,10 +60,16 @@
|
|
|
60
60
|
border-right 1px solid darken(main, 30%)
|
|
61
61
|
|
|
62
62
|
.pinned
|
|
63
|
+
.sidebar-list
|
|
64
|
+
top 0
|
|
65
|
+
.sidebar-panel
|
|
66
|
+
top 0
|
|
67
|
+
padding-top 36px
|
|
63
68
|
.drag-handle
|
|
64
69
|
display block
|
|
65
|
-
.sidebar-panel
|
|
66
|
-
|
|
70
|
+
.sidebar-panel
|
|
71
|
+
.pinned
|
|
72
|
+
color success
|
|
67
73
|
//btns
|
|
68
74
|
.btns
|
|
69
75
|
background main-dark
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* transfer-history-modal
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { memo, useState } from 'react'
|
|
6
6
|
import { CloseOutlined } from '@ant-design/icons'
|
|
7
7
|
import { Table } from 'antd'
|
|
8
8
|
import time from '../../common/time'
|
|
@@ -18,107 +18,102 @@ const sorterFactory = prop => {
|
|
|
18
18
|
return _get(a, prop) > _get(b, prop) ? 1 : -1
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
export default
|
|
22
|
-
|
|
23
|
-
pageSize: 5
|
|
24
|
-
}
|
|
21
|
+
export default memo(function TransferHistoryModal (props) {
|
|
22
|
+
const [pageSize, setPageSize] = useState(5)
|
|
25
23
|
|
|
26
|
-
handlePageSizeChange = (page, pageSize) => {
|
|
27
|
-
|
|
24
|
+
const handlePageSizeChange = (page, pageSize) => {
|
|
25
|
+
setPageSize(pageSize)
|
|
28
26
|
}
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<Tag transfer={inst} />
|
|
56
|
-
)
|
|
57
|
-
}
|
|
58
|
-
}, {
|
|
59
|
-
title: e('host'),
|
|
60
|
-
dataIndex: 'host',
|
|
61
|
-
key: 'host',
|
|
62
|
-
sorter: sorterFactory('host')
|
|
63
|
-
}, {
|
|
64
|
-
title: e('fromPath'),
|
|
65
|
-
dataIndex: 'fromPath',
|
|
66
|
-
key: 'fromPath',
|
|
67
|
-
render: (txt, inst) => {
|
|
68
|
-
return inst.fromPathReal || txt
|
|
69
|
-
},
|
|
70
|
-
sorter: sorterFactory('fromPath')
|
|
71
|
-
}, {
|
|
72
|
-
title: e('toPath'),
|
|
73
|
-
dataIndex: 'toPath',
|
|
74
|
-
key: 'toPath',
|
|
75
|
-
render: (txt, inst) => {
|
|
76
|
-
return inst.toPathReal || txt
|
|
77
|
-
},
|
|
78
|
-
sorter: sorterFactory('toPath')
|
|
79
|
-
}, {
|
|
80
|
-
title: e('size'),
|
|
81
|
-
dataIndex: 'size',
|
|
82
|
-
key: 'size',
|
|
83
|
-
sorter: sorterFactory('size'),
|
|
84
|
-
render: (v) => filesize(v || 0)
|
|
85
|
-
}, {
|
|
86
|
-
title: e('speed'),
|
|
87
|
-
dataIndex: 'speed',
|
|
88
|
-
key: 'speed',
|
|
89
|
-
sorter: sorterFactory('speed')
|
|
90
|
-
}]
|
|
91
|
-
const tabConf = {
|
|
92
|
-
dataSource: transferHistory,
|
|
93
|
-
columns,
|
|
94
|
-
bordered: true,
|
|
95
|
-
pagination: {
|
|
96
|
-
pageSize: this.state.pageSize,
|
|
97
|
-
showSizeChanger: true,
|
|
98
|
-
pageSizeOptions: [5, 10, 20, 50, 100],
|
|
99
|
-
onChange: this.handlePageSizeChange,
|
|
100
|
-
position: ['topRight']
|
|
101
|
-
},
|
|
102
|
-
size: 'small',
|
|
103
|
-
rowKey: 'id'
|
|
28
|
+
const {
|
|
29
|
+
clearTransferHistory
|
|
30
|
+
} = window.store
|
|
31
|
+
const transferHistory = props.transferHistory.filter(d => !d.unzip)
|
|
32
|
+
const columns = [{
|
|
33
|
+
title: e('startTime'),
|
|
34
|
+
dataIndex: 'startTime',
|
|
35
|
+
key: 'startTime',
|
|
36
|
+
sorter: sorterFactory('startTime'),
|
|
37
|
+
render: timeRender
|
|
38
|
+
}, {
|
|
39
|
+
title: e('finishTime'),
|
|
40
|
+
dataIndex: 'finishTime',
|
|
41
|
+
key: 'finishTime',
|
|
42
|
+
sorter: sorterFactory('finishTime'),
|
|
43
|
+
render: timeRender
|
|
44
|
+
}, {
|
|
45
|
+
title: e('type'),
|
|
46
|
+
dataIndex: 'type',
|
|
47
|
+
key: 'typeFrom',
|
|
48
|
+
sorter: sorterFactory('typeFrom'),
|
|
49
|
+
render: (type, inst) => {
|
|
50
|
+
return (
|
|
51
|
+
<Tag transfer={inst} />
|
|
52
|
+
)
|
|
104
53
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
)
|
|
54
|
+
}, {
|
|
55
|
+
title: e('host'),
|
|
56
|
+
dataIndex: 'host',
|
|
57
|
+
key: 'host',
|
|
58
|
+
sorter: sorterFactory('host')
|
|
59
|
+
}, {
|
|
60
|
+
title: e('fromPath'),
|
|
61
|
+
dataIndex: 'fromPath',
|
|
62
|
+
key: 'fromPath',
|
|
63
|
+
render: (txt, inst) => {
|
|
64
|
+
return inst.fromPathReal || txt
|
|
65
|
+
},
|
|
66
|
+
sorter: sorterFactory('fromPath')
|
|
67
|
+
}, {
|
|
68
|
+
title: e('toPath'),
|
|
69
|
+
dataIndex: 'toPath',
|
|
70
|
+
key: 'toPath',
|
|
71
|
+
render: (txt, inst) => {
|
|
72
|
+
return inst.toPathReal || txt
|
|
73
|
+
},
|
|
74
|
+
sorter: sorterFactory('toPath')
|
|
75
|
+
}, {
|
|
76
|
+
title: e('size'),
|
|
77
|
+
dataIndex: 'size',
|
|
78
|
+
key: 'size',
|
|
79
|
+
sorter: sorterFactory('size'),
|
|
80
|
+
render: (v) => filesize(v || 0)
|
|
81
|
+
}, {
|
|
82
|
+
title: e('speed'),
|
|
83
|
+
dataIndex: 'speed',
|
|
84
|
+
key: 'speed',
|
|
85
|
+
sorter: sorterFactory('speed')
|
|
86
|
+
}]
|
|
87
|
+
const tabConf = {
|
|
88
|
+
dataSource: transferHistory,
|
|
89
|
+
columns,
|
|
90
|
+
bordered: true,
|
|
91
|
+
pagination: {
|
|
92
|
+
pageSize,
|
|
93
|
+
showSizeChanger: true,
|
|
94
|
+
pageSizeOptions: [5, 10, 20, 50, 100],
|
|
95
|
+
onChange: handlePageSizeChange,
|
|
96
|
+
position: ['topRight']
|
|
97
|
+
},
|
|
98
|
+
size: 'small',
|
|
99
|
+
rowKey: 'id'
|
|
123
100
|
}
|
|
124
|
-
|
|
101
|
+
return (
|
|
102
|
+
<div className='pd2'>
|
|
103
|
+
<div>
|
|
104
|
+
<span
|
|
105
|
+
className='iblock pointer'
|
|
106
|
+
onClick={clearTransferHistory}
|
|
107
|
+
>
|
|
108
|
+
<CloseOutlined className='mg1r' />
|
|
109
|
+
{e('clear')}
|
|
110
|
+
</span>
|
|
111
|
+
</div>
|
|
112
|
+
<div className='table-scroll-wrap'>
|
|
113
|
+
<Table
|
|
114
|
+
{...tabConf}
|
|
115
|
+
/>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
)
|
|
119
|
+
})
|