@electerm/electerm-react 1.34.30
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/LICENSE +21 -0
- package/README.md +31 -0
- package/client/common/auto-complete-data-mapper.js +6 -0
- package/client/common/byte-format.js +14 -0
- package/client/common/class.js +52 -0
- package/client/common/clipboard.js +49 -0
- package/client/common/constants.js +308 -0
- package/client/common/create-lang-edit-link.js +7 -0
- package/client/common/create-title.js +29 -0
- package/client/common/db-fix.js +24 -0
- package/client/common/db.js +155 -0
- package/client/common/download-mirrors.js +10 -0
- package/client/common/download.js +16 -0
- package/client/common/error-handler.jsx +27 -0
- package/client/common/fetch-from-server.js +47 -0
- package/client/common/fetch.jsx +71 -0
- package/client/common/find-bookmark-group-id.js +15 -0
- package/client/common/find-parent.js +30 -0
- package/client/common/form-layout.js +27 -0
- package/client/common/fs.js +21 -0
- package/client/common/get-proxy.js +8 -0
- package/client/common/id-with-stamp.js +10 -0
- package/client/common/index-sorter.js +4 -0
- package/client/common/init-setting-item.js +32 -0
- package/client/common/is-absolute-path.js +3 -0
- package/client/common/is-ip.js +16 -0
- package/client/common/is-valid-path.js +7 -0
- package/client/common/key-control-pressed.js +13 -0
- package/client/common/key-pressed.js +13 -0
- package/client/common/key-shift-pressed.js +7 -0
- package/client/common/mode2permission.js +81 -0
- package/client/common/new-terminal.js +31 -0
- package/client/common/parse-int10.js +3 -0
- package/client/common/parse-json-safe.js +11 -0
- package/client/common/pass-enc.js +25 -0
- package/client/common/post-msg.js +3 -0
- package/client/common/pre.js +156 -0
- package/client/common/promise-timeout.js +27 -0
- package/client/common/resolve.js +31 -0
- package/client/common/run-idle.js +1 -0
- package/client/common/safe-local-storage.js +35 -0
- package/client/common/safe-name.js +19 -0
- package/client/common/sftp.js +74 -0
- package/client/common/terminal-theme.js +158 -0
- package/client/common/test-connection.js +12 -0
- package/client/common/time.js +30 -0
- package/client/common/to-simple-obj.js +5 -0
- package/client/common/track.js +7 -0
- package/client/common/transfer.js +76 -0
- package/client/common/trzsz.js +62 -0
- package/client/common/ui-theme.js +44 -0
- package/client/common/uid.js +5 -0
- package/client/common/update-check.js +79 -0
- package/client/common/upgrade.js +68 -0
- package/client/common/wait.js +8 -0
- package/client/common/ws.js +161 -0
- package/client/components/batch-op/batch-op.jsx +650 -0
- package/client/components/bookmark-form/bookmark-form.styl +8 -0
- package/client/components/bookmark-form/bookmark-group-tree-format.js +39 -0
- package/client/components/bookmark-form/encodes.js +44 -0
- package/client/components/bookmark-form/form-ssh-common.jsx +208 -0
- package/client/components/bookmark-form/form-tabs.jsx +69 -0
- package/client/components/bookmark-form/index.jsx +159 -0
- package/client/components/bookmark-form/local-form-ui.jsx +152 -0
- package/client/components/bookmark-form/local-form.jsx +16 -0
- package/client/components/bookmark-form/proxy.jsx +49 -0
- package/client/components/bookmark-form/quick-command-list.jsx +31 -0
- package/client/components/bookmark-form/quick-command.jsx +228 -0
- package/client/components/bookmark-form/render-auth-ssh.jsx +104 -0
- package/client/components/bookmark-form/render-connection-hopping.jsx +229 -0
- package/client/components/bookmark-form/render-delayed-scripts.jsx +88 -0
- package/client/components/bookmark-form/render-ssh-tunnel.jsx +116 -0
- package/client/components/bookmark-form/serial-form-ui.jsx +311 -0
- package/client/components/bookmark-form/serial-form.jsx +20 -0
- package/client/components/bookmark-form/sftp-enable.jsx +33 -0
- package/client/components/bookmark-form/ssh-form-ui.jsx +100 -0
- package/client/components/bookmark-form/ssh-form.jsx +348 -0
- package/client/components/bookmark-form/telnet-form-ui.jsx +154 -0
- package/client/components/bookmark-form/telnet-form.jsx +16 -0
- package/client/components/bookmark-form/tree-delete.jsx +87 -0
- package/client/components/bookmark-form/use-form-funcs.jsx +50 -0
- package/client/components/bookmark-form/use-quick-commands.jsx +83 -0
- package/client/components/bookmark-form/use-submit.jsx +77 -0
- package/client/components/bookmark-form/use-ui.jsx +82 -0
- package/client/components/bookmark-form/x11.jsx +23 -0
- package/client/components/common/animate-text.jsx +37 -0
- package/client/components/common/animate-text.styl +54 -0
- package/client/components/common/external-link.jsx +28 -0
- package/client/components/common/help-icon.jsx +25 -0
- package/client/components/common/highlight.jsx +23 -0
- package/client/components/common/highlight.styl +3 -0
- package/client/components/common/input-auto-focus.jsx +68 -0
- package/client/components/common/input-confirm.jsx +66 -0
- package/client/components/common/logo-elem.jsx +22 -0
- package/client/components/common/markdown.jsx +27 -0
- package/client/components/common/react-subx.jsx +1 -0
- package/client/components/common/resize-wrap.jsx +222 -0
- package/client/components/common/resize-wrap.styl +9 -0
- package/client/components/common/search.jsx +9 -0
- package/client/components/common/show-item.jsx +27 -0
- package/client/components/context-menu/boomarks.jsx +15 -0
- package/client/components/context-menu/context-menu.jsx +340 -0
- package/client/components/context-menu/context-menu.styl +90 -0
- package/client/components/context-menu/history.jsx +27 -0
- package/client/components/context-menu/icon-holder.jsx +5 -0
- package/client/components/context-menu/menu-btn.jsx +224 -0
- package/client/components/context-menu/sub-tab-menu.jsx +23 -0
- package/client/components/context-menu/tabs.jsx +22 -0
- package/client/components/context-menu/zoom.jsx +40 -0
- package/client/components/footer/batch-input.jsx +177 -0
- package/client/components/footer/footer-entry.jsx +141 -0
- package/client/components/footer/footer.styl +47 -0
- package/client/components/icons/match-case.jsx +10 -0
- package/client/components/icons/match-whole-word.jsx +13 -0
- package/client/components/icons/regular-exp.jsx +10 -0
- package/client/components/main/css-overwrite.jsx +92 -0
- package/client/components/main/error-wrapper.jsx +59 -0
- package/client/components/main/index.jsx +11 -0
- package/client/components/main/loading.jsx +25 -0
- package/client/components/main/main.jsx +149 -0
- package/client/components/main/term-fullscreen-control.jsx +21 -0
- package/client/components/main/term-fullscreen.styl +27 -0
- package/client/components/main/ui-theme.jsx +31 -0
- package/client/components/main/upgrade.jsx +351 -0
- package/client/components/main/upgrade.styl +27 -0
- package/client/components/main/wrapper.styl +41 -0
- package/client/components/quick-commands/qm.styl +29 -0
- package/client/components/quick-commands/quick-command-item.jsx +36 -0
- package/client/components/quick-commands/quick-command-transport-mod.jsx +54 -0
- package/client/components/quick-commands/quick-command-transport.jsx +12 -0
- package/client/components/quick-commands/quick-commands-box.jsx +233 -0
- package/client/components/quick-commands/quick-commands-form-elem.jsx +119 -0
- package/client/components/quick-commands/quick-commands-form.jsx +33 -0
- package/client/components/quick-commands/quick-commands-list.jsx +128 -0
- package/client/components/quick-commands/quick-commands-select.jsx +38 -0
- package/client/components/session/session.jsx +533 -0
- package/client/components/session/session.styl +53 -0
- package/client/components/session/sessions.jsx +445 -0
- package/client/components/setting-panel/bookmark-transport.jsx +148 -0
- package/client/components/setting-panel/bookmark-tree-list.jsx +14 -0
- package/client/components/setting-panel/col.jsx +18 -0
- package/client/components/setting-panel/list.jsx +186 -0
- package/client/components/setting-panel/list.styl +33 -0
- package/client/components/setting-panel/on-tree-drop.js +222 -0
- package/client/components/setting-panel/setting-modal.jsx +163 -0
- package/client/components/setting-panel/setting-wrap.jsx +37 -0
- package/client/components/setting-panel/setting-wrap.styl +52 -0
- package/client/components/setting-panel/setting.jsx +858 -0
- package/client/components/setting-panel/setting.styl +4 -0
- package/client/components/setting-panel/start-session-select.jsx +91 -0
- package/client/components/setting-panel/tab-bookmarks.jsx +37 -0
- package/client/components/setting-panel/tab-history.jsx +44 -0
- package/client/components/setting-panel/tab-quick-commands.jsx +38 -0
- package/client/components/setting-panel/tab-settings.jsx +42 -0
- package/client/components/setting-panel/tab-themes.jsx +34 -0
- package/client/components/setting-panel/tree-list.jsx +978 -0
- package/client/components/setting-panel/tree-list.styl +57 -0
- package/client/components/setting-sync/data-import.jsx +65 -0
- package/client/components/setting-sync/setting-sync-form.jsx +271 -0
- package/client/components/setting-sync/setting-sync.jsx +81 -0
- package/client/components/setting-sync/sync.styl +7 -0
- package/client/components/sftp/address-bar.jsx +139 -0
- package/client/components/sftp/address-bookmark-item.jsx +47 -0
- package/client/components/sftp/address-bookmark.jsx +81 -0
- package/client/components/sftp/address-bookmark.styl +8 -0
- package/client/components/sftp/confirm-modal.jsx +184 -0
- package/client/components/sftp/file-icon.jsx +22 -0
- package/client/components/sftp/file-item.jsx +1226 -0
- package/client/components/sftp/file-mode-modal.jsx +205 -0
- package/client/components/sftp/file-props-modal.jsx +211 -0
- package/client/components/sftp/file-read.js +81 -0
- package/client/components/sftp/list-table-ui.jsx +547 -0
- package/client/components/sftp/owner-list.js +97 -0
- package/client/components/sftp/paged-list.jsx +60 -0
- package/client/components/sftp/permission-render.jsx +42 -0
- package/client/components/sftp/sftp-entry.jsx +1069 -0
- package/client/components/sftp/sftp.styl +217 -0
- package/client/components/sftp/transfer-common.js +9 -0
- package/client/components/sftp/transfer-conflict.jsx +315 -0
- package/client/components/sftp/transfer-speed-format.js +60 -0
- package/client/components/sftp/transfer-tag.jsx +40 -0
- package/client/components/sftp/transfer-tag.styl +11 -0
- package/client/components/sftp/transfer.styl +55 -0
- package/client/components/sftp/transport-action.jsx +410 -0
- package/client/components/sftp/transport-entry.jsx +108 -0
- package/client/components/sftp/transport-types.js +8 -0
- package/client/components/sftp/transports-action.jsx +111 -0
- package/client/components/sftp/transports-ui.jsx +93 -0
- package/client/components/sftp/zip.js +42 -0
- package/client/components/sidebar/bookmark-select.jsx +48 -0
- package/client/components/sidebar/bookmark.jsx +82 -0
- package/client/components/sidebar/history.jsx +66 -0
- package/client/components/sidebar/index.jsx +230 -0
- package/client/components/sidebar/info-modal.jsx +250 -0
- package/client/components/sidebar/info.styl +27 -0
- package/client/components/sidebar/side-icon.jsx +25 -0
- package/client/components/sidebar/sidebar.styl +128 -0
- package/client/components/sidebar/transfer-history-modal.jsx +110 -0
- package/client/components/sidebar/transfer-history.styl +3 -0
- package/client/components/sidebar/transfer-list-control.jsx +205 -0
- package/client/components/sidebar/transfer-list.jsx +55 -0
- package/client/components/sidebar/transfer-modal.jsx +76 -0
- package/client/components/sidebar/transfer.styl +8 -0
- package/client/components/sidebar/transport-ui.jsx +109 -0
- package/client/components/tabs/index.jsx +320 -0
- package/client/components/tabs/tab.jsx +427 -0
- package/client/components/tabs/tabs.styl +220 -0
- package/client/components/tabs/window-control.jsx +55 -0
- package/client/components/terminal/attach-addon-custom.js +70 -0
- package/client/components/terminal/build-ls-term-id.js +5 -0
- package/client/components/terminal/index.jsx +1358 -0
- package/client/components/terminal/normal-buffer.jsx +33 -0
- package/client/components/terminal/term-search.jsx +224 -0
- package/client/components/terminal/term-search.styl +15 -0
- package/client/components/terminal/terminal-apis.js +31 -0
- package/client/components/terminal/terminal-interactive.jsx +148 -0
- package/client/components/terminal/terminal.styl +96 -0
- package/client/components/terminal/xterm-zmodem.js +48 -0
- package/client/components/terminal/zmodem-transfer.jsx +98 -0
- package/client/components/terminal/zmodem.styl +14 -0
- package/client/components/terminal-info/activity.jsx +54 -0
- package/client/components/terminal-info/base.jsx +25 -0
- package/client/components/terminal-info/content.jsx +101 -0
- package/client/components/terminal-info/data-cols-parser.jsx +50 -0
- package/client/components/terminal-info/disk.jsx +29 -0
- package/client/components/terminal-info/index.jsx +25 -0
- package/client/components/terminal-info/network.jsx +114 -0
- package/client/components/terminal-info/resource.jsx +80 -0
- package/client/components/terminal-info/run-cmd.jsx +273 -0
- package/client/components/terminal-info/terminal-info.styl +29 -0
- package/client/components/terminal-info/up.jsx +15 -0
- package/client/components/terminal-theme/index.jsx +264 -0
- package/client/components/terminal-theme/terminal-theme-list.styl +3 -0
- package/client/components/terminal-theme/theme-list.jsx +146 -0
- package/client/components/text-editor/text-editor-form.jsx +97 -0
- package/client/components/text-editor/text-editor.jsx +182 -0
- package/client/css/antd-overwrite.styl +14 -0
- package/client/css/basic.styl +38 -0
- package/client/css/includes/box.styl +154 -0
- package/client/css/includes/font-size.styl +6 -0
- package/client/css/includes/index.styl +3 -0
- package/client/css/includes/text.styl +31 -0
- package/client/css/includes/theme-default.styl +20 -0
- package/client/entry/basic.js +58 -0
- package/client/entry/index.jsx +15 -0
- package/client/entry/worker.js +137 -0
- package/client/store/address-bookmark.js +25 -0
- package/client/store/app-upgrade.js +23 -0
- package/client/store/batch-input-history.js +26 -0
- package/client/store/bookmark-group.js +128 -0
- package/client/store/bookmark.js +22 -0
- package/client/store/common.js +140 -0
- package/client/store/context-menu.js +23 -0
- package/client/store/db-upgrade.js +43 -0
- package/client/store/event.js +70 -0
- package/client/store/index.js +335 -0
- package/client/store/init-state.js +191 -0
- package/client/store/item.js +120 -0
- package/client/store/load-data.js +198 -0
- package/client/store/quick-command.js +43 -0
- package/client/store/session.js +54 -0
- package/client/store/setting.js +208 -0
- package/client/store/sidebar.js +48 -0
- package/client/store/sync.js +390 -0
- package/client/store/system-menu.js +120 -0
- package/client/store/tab.js +74 -0
- package/client/store/terminal-theme.js +116 -0
- package/client/store/transfer-history.js +27 -0
- package/client/store/transfer-list.js +20 -0
- package/client/store/ui-theme.js +71 -0
- package/client/store/watch.js +116 -0
- package/client/views/index.pug +58 -0
- package/package.json +34 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Component } from '../common/react-subx'
|
|
2
|
+
import {
|
|
3
|
+
StarOutlined,
|
|
4
|
+
PlusSquareOutlined
|
|
5
|
+
} from '@ant-design/icons'
|
|
6
|
+
import {
|
|
7
|
+
Popover
|
|
8
|
+
} from 'antd'
|
|
9
|
+
import AddrBookmarkItem from './address-bookmark-item'
|
|
10
|
+
import { typeMap } from '../../common/constants'
|
|
11
|
+
import uid from '../../common/uid'
|
|
12
|
+
import './address-bookmark.styl'
|
|
13
|
+
|
|
14
|
+
export default class AddrBookmark extends Component {
|
|
15
|
+
onDel = (item) => {
|
|
16
|
+
this.props.store.delAddressBookmark(item)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
handleAddAddr = () => {
|
|
20
|
+
const {
|
|
21
|
+
store, host, realPath, type
|
|
22
|
+
} = this.props
|
|
23
|
+
store.addAddressBookmark(
|
|
24
|
+
{
|
|
25
|
+
addr: realPath,
|
|
26
|
+
host: type === typeMap.local ? '' : host,
|
|
27
|
+
id: uid()
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
render () {
|
|
33
|
+
const { type, onClickHistory, store, host } = this.props
|
|
34
|
+
// const cls = classnames(
|
|
35
|
+
// 'sftp-history',
|
|
36
|
+
// 'animated',
|
|
37
|
+
// `sftp-history-${type}`
|
|
38
|
+
// )
|
|
39
|
+
const addrs = type === typeMap.local
|
|
40
|
+
? store.addressBookmarksLocal
|
|
41
|
+
: store.addressBookmarks.filter(
|
|
42
|
+
g => g.host === host
|
|
43
|
+
)
|
|
44
|
+
const inner = addrs.length
|
|
45
|
+
? addrs.map(o => {
|
|
46
|
+
return (
|
|
47
|
+
<AddrBookmarkItem
|
|
48
|
+
handleClick={onClickHistory}
|
|
49
|
+
type={type}
|
|
50
|
+
key={o.id}
|
|
51
|
+
handleDel={this.onDel}
|
|
52
|
+
item={o}
|
|
53
|
+
/>
|
|
54
|
+
)
|
|
55
|
+
})
|
|
56
|
+
: null
|
|
57
|
+
const content = (
|
|
58
|
+
<div>
|
|
59
|
+
{inner}
|
|
60
|
+
</div>
|
|
61
|
+
)
|
|
62
|
+
const title = (
|
|
63
|
+
<div>
|
|
64
|
+
<PlusSquareOutlined
|
|
65
|
+
className='add-addr-bookmark'
|
|
66
|
+
onClick={this.handleAddAddr}
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
)
|
|
70
|
+
return (
|
|
71
|
+
<Popover
|
|
72
|
+
content={content}
|
|
73
|
+
title={title}
|
|
74
|
+
placement='bottom'
|
|
75
|
+
trigger='click'
|
|
76
|
+
>
|
|
77
|
+
<StarOutlined />
|
|
78
|
+
</Popover>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* confirm modal for transfer conflict
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { Modal, Button } from 'antd'
|
|
7
|
+
import { isString } from 'lodash-es'
|
|
8
|
+
import AnimateText from '../common/animate-text'
|
|
9
|
+
import formatTime from '../../../app/common/time'
|
|
10
|
+
import { FolderOutlined, FileOutlined } from '@ant-design/icons'
|
|
11
|
+
import {
|
|
12
|
+
fileActions
|
|
13
|
+
} from '../../common/constants'
|
|
14
|
+
import postMessage from '../../common/post-msg'
|
|
15
|
+
|
|
16
|
+
const { prefix } = window
|
|
17
|
+
const e = prefix('sftp')
|
|
18
|
+
|
|
19
|
+
function formatTimeAuto (strOrDigit) {
|
|
20
|
+
if (isString(strOrDigit)) {
|
|
21
|
+
return formatTime(strOrDigit)
|
|
22
|
+
}
|
|
23
|
+
return formatTime(strOrDigit * 1000)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default (props) => {
|
|
27
|
+
if (!props.transferToConfirm) {
|
|
28
|
+
return null
|
|
29
|
+
}
|
|
30
|
+
const {
|
|
31
|
+
fromPath,
|
|
32
|
+
toPath,
|
|
33
|
+
fromFile: {
|
|
34
|
+
isDirectory,
|
|
35
|
+
name,
|
|
36
|
+
id: fileId,
|
|
37
|
+
modifyTime: modifyTimeFrom,
|
|
38
|
+
size: sizeFrom,
|
|
39
|
+
type: typeFrom
|
|
40
|
+
},
|
|
41
|
+
toFile: {
|
|
42
|
+
modifyTime: modifyTimeTo,
|
|
43
|
+
size: sizeTo,
|
|
44
|
+
type: typeTo
|
|
45
|
+
},
|
|
46
|
+
id,
|
|
47
|
+
transferGroupId
|
|
48
|
+
} = props.transferToConfirm
|
|
49
|
+
function act (action) {
|
|
50
|
+
props.modifier({
|
|
51
|
+
transferToConfirm: null
|
|
52
|
+
})
|
|
53
|
+
postMessage({
|
|
54
|
+
transferGroupId,
|
|
55
|
+
fileId,
|
|
56
|
+
id,
|
|
57
|
+
transfer: props.transferToConfirm,
|
|
58
|
+
action
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
function renderContent () {
|
|
62
|
+
const action = isDirectory ? e('merge') : e('replace')
|
|
63
|
+
const typeTxt = isDirectory ? e('folder') : e('file')
|
|
64
|
+
const Icon = isDirectory ? FolderOutlined : FileOutlined
|
|
65
|
+
const typeTitle = e(typeTo)
|
|
66
|
+
const otherTypeTitle = e(typeFrom)
|
|
67
|
+
return (
|
|
68
|
+
<div className='confirms-content-wrap'>
|
|
69
|
+
<AnimateText>
|
|
70
|
+
<p className='pd1b color-red font13'>
|
|
71
|
+
{action}
|
|
72
|
+
</p>
|
|
73
|
+
<p className='bold font14'>
|
|
74
|
+
{typeTitle} {typeTxt}: <Icon className='mg1r' />{name}
|
|
75
|
+
</p>
|
|
76
|
+
<p className='font13'>
|
|
77
|
+
{e('size')}: {sizeTo}, {e('modifyTime')}: {formatTimeAuto(modifyTimeTo)}
|
|
78
|
+
</p>
|
|
79
|
+
<p className='pd1b'>
|
|
80
|
+
({toPath})
|
|
81
|
+
</p>
|
|
82
|
+
<p>
|
|
83
|
+
with
|
|
84
|
+
</p>
|
|
85
|
+
<p className='bold font14'>
|
|
86
|
+
{otherTypeTitle} {typeTxt}: <Icon className='mg1r' />{name}
|
|
87
|
+
</p>
|
|
88
|
+
<p className='font13'>
|
|
89
|
+
{e('size')}: {sizeFrom}, {e('modifyTime')}: {formatTimeAuto(modifyTimeFrom)}
|
|
90
|
+
</p>
|
|
91
|
+
<p className='pd1b'>
|
|
92
|
+
({fromPath})
|
|
93
|
+
</p>
|
|
94
|
+
</AnimateText>
|
|
95
|
+
</div>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
function renderFooter () {
|
|
99
|
+
return (
|
|
100
|
+
<div className='mgq1t pd1y alignright'>
|
|
101
|
+
<Button
|
|
102
|
+
type='dashed'
|
|
103
|
+
className='mg1l'
|
|
104
|
+
onClick={() => act(fileActions.cancel)}
|
|
105
|
+
>
|
|
106
|
+
{e('cancel')}
|
|
107
|
+
</Button>
|
|
108
|
+
<Button
|
|
109
|
+
type='dashed'
|
|
110
|
+
className='mg1l'
|
|
111
|
+
onClick={() => act(fileActions.skip)}
|
|
112
|
+
>
|
|
113
|
+
{e('skip')}
|
|
114
|
+
</Button>
|
|
115
|
+
<Button
|
|
116
|
+
type='dashed'
|
|
117
|
+
className='mg1l'
|
|
118
|
+
onClick={() => act(fileActions.skipAll)}
|
|
119
|
+
>
|
|
120
|
+
{e('skipAll')}
|
|
121
|
+
</Button>
|
|
122
|
+
<Button
|
|
123
|
+
danger
|
|
124
|
+
className='mg1l'
|
|
125
|
+
onClick={
|
|
126
|
+
() => act(fileActions.mergeOrOverwrite)
|
|
127
|
+
}
|
|
128
|
+
>
|
|
129
|
+
{isDirectory ? e('merge') : e('overwrite')}
|
|
130
|
+
</Button>
|
|
131
|
+
<Button
|
|
132
|
+
type='primary'
|
|
133
|
+
className='mg1l'
|
|
134
|
+
onClick={
|
|
135
|
+
() => act(fileActions.rename)
|
|
136
|
+
}
|
|
137
|
+
>
|
|
138
|
+
{e('rename')}
|
|
139
|
+
</Button>
|
|
140
|
+
<div className='pd1t'>
|
|
141
|
+
<Button
|
|
142
|
+
type='dashed'
|
|
143
|
+
danger
|
|
144
|
+
className='mg1l'
|
|
145
|
+
title={
|
|
146
|
+
isDirectory
|
|
147
|
+
? e('mergeDesc')
|
|
148
|
+
: e('overwriteDesc')
|
|
149
|
+
}
|
|
150
|
+
onClick={
|
|
151
|
+
() => act(fileActions.mergeOrOverwriteAll)
|
|
152
|
+
}
|
|
153
|
+
>
|
|
154
|
+
{isDirectory ? e('mergeAll') : e('overwriteAll')}
|
|
155
|
+
</Button>
|
|
156
|
+
<Button
|
|
157
|
+
type='primary'
|
|
158
|
+
className='mg1l'
|
|
159
|
+
title={e('renameDesc')}
|
|
160
|
+
onClick={
|
|
161
|
+
() => act(fileActions.renameAll)
|
|
162
|
+
}
|
|
163
|
+
>
|
|
164
|
+
{e('renameAll')}
|
|
165
|
+
</Button>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
const modalProps = {
|
|
171
|
+
open: true,
|
|
172
|
+
width: 500,
|
|
173
|
+
title: e('fileConflict'),
|
|
174
|
+
footer: renderFooter(),
|
|
175
|
+
onCancel: () => act(fileActions.cancel)
|
|
176
|
+
}
|
|
177
|
+
return (
|
|
178
|
+
<Modal
|
|
179
|
+
{...modalProps}
|
|
180
|
+
>
|
|
181
|
+
{renderContent()}
|
|
182
|
+
</Modal>
|
|
183
|
+
)
|
|
184
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* file/folder icon by ext or name
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { getIconForFile, getIconForFolder } from 'vscode-icons-js'
|
|
6
|
+
// import Icon from '@ant-design/icons'
|
|
7
|
+
|
|
8
|
+
export default function FileIcon ({ file, ...extra }) {
|
|
9
|
+
const { extIconPath } = window.pre
|
|
10
|
+
const name = file.isDirectory
|
|
11
|
+
? getIconForFolder(file.name)
|
|
12
|
+
: getIconForFile(file.name)
|
|
13
|
+
// const svg = <img src={iconPath + name} alt='' />
|
|
14
|
+
return (
|
|
15
|
+
<img
|
|
16
|
+
src={extIconPath + name}
|
|
17
|
+
height={12}
|
|
18
|
+
alt=''
|
|
19
|
+
{...extra}
|
|
20
|
+
/>
|
|
21
|
+
)
|
|
22
|
+
}
|