@electerm/electerm-react 1.35.6 → 1.36.2
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 +1 -0
- package/client/components/auth/login.jsx +2 -0
- package/client/components/bookmark-form/color-picker.jsx +1 -0
- package/client/components/bookmark-form/local-form-ui.jsx +6 -2
- package/client/components/bookmark-form/telnet-form-ui.jsx +2 -0
- package/client/components/main/custom-css.jsx +1 -1
- package/client/components/setting-panel/keywords-form.jsx +124 -0
- package/client/components/setting-panel/{setting.jsx → setting-common.jsx} +2 -288
- package/client/components/setting-panel/setting-terminal.jsx +494 -0
- package/client/components/setting-panel/tab-settings.jsx +6 -2
- package/client/components/sftp/list-table-ui.jsx +3 -2
- package/client/components/terminal/highlight-addon.js +63 -0
- package/client/components/terminal/index.jsx +12 -41
- package/client/store/index.js +11 -5
- package/client/store/init-state.js +130 -128
- package/client/store/setting.js +2 -1
- package/package.json +1 -1
package/client/store/index.js
CHANGED
|
@@ -35,7 +35,8 @@ import {
|
|
|
35
35
|
sidebarPanelWidth,
|
|
36
36
|
paneMap,
|
|
37
37
|
settingSyncId,
|
|
38
|
-
settingShortcutsId
|
|
38
|
+
settingShortcutsId,
|
|
39
|
+
settingTerminalId
|
|
39
40
|
} from '../common/constants'
|
|
40
41
|
import getInitItem from '../common/init-setting-item'
|
|
41
42
|
import {
|
|
@@ -45,6 +46,7 @@ import {
|
|
|
45
46
|
const { prefix } = window
|
|
46
47
|
const ss = prefix('settingSync')
|
|
47
48
|
const s = prefix('setting')
|
|
49
|
+
const sss = prefix('ssh')
|
|
48
50
|
|
|
49
51
|
function getReverseColor (hex) {
|
|
50
52
|
// Check if the input is a valid hex color code
|
|
@@ -86,7 +88,7 @@ class Store {
|
|
|
86
88
|
constructor () {
|
|
87
89
|
Object.assign(
|
|
88
90
|
this,
|
|
89
|
-
initState
|
|
91
|
+
initState()
|
|
90
92
|
)
|
|
91
93
|
}
|
|
92
94
|
|
|
@@ -248,12 +250,16 @@ class Store {
|
|
|
248
250
|
get setting () {
|
|
249
251
|
return [
|
|
250
252
|
{
|
|
251
|
-
id:
|
|
252
|
-
title:
|
|
253
|
+
id: settingTerminalId,
|
|
254
|
+
title: sss('terminal')
|
|
253
255
|
},
|
|
254
256
|
{
|
|
255
257
|
id: settingShortcutsId,
|
|
256
258
|
title: s('settingShortcuts')
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
id: settingSyncId,
|
|
262
|
+
title: ss('settingSync')
|
|
257
263
|
}
|
|
258
264
|
]
|
|
259
265
|
}
|
|
@@ -344,7 +350,7 @@ batchInputHistory(Store)
|
|
|
344
350
|
transferExtend(Store)
|
|
345
351
|
addressBookmarkExtend(Store)
|
|
346
352
|
|
|
353
|
+
export const StateStore = Store
|
|
347
354
|
const store = manage(new Store())
|
|
348
355
|
|
|
349
|
-
window.store = store
|
|
350
356
|
export default store
|
|
@@ -53,132 +53,134 @@ export const getInitItem = (arr, tab) => {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
export default {
|
|
57
|
-
|
|
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
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
56
|
+
export default () => {
|
|
57
|
+
return {
|
|
58
|
+
// common
|
|
59
|
+
wsInited: false,
|
|
60
|
+
configLoaded: false,
|
|
61
|
+
loadTime: 0,
|
|
62
|
+
lastDataUpdateTime: 0,
|
|
63
|
+
_tabs: '[]',
|
|
64
|
+
currentTabId: '',
|
|
65
|
+
termFocused: false,
|
|
66
|
+
_history: '[]',
|
|
67
|
+
_bookmarks: '[]',
|
|
68
|
+
_bookmarkGroups: JSON.stringify(
|
|
69
|
+
getDefaultBookmarkGroups([])
|
|
70
|
+
),
|
|
71
|
+
_config: '{}',
|
|
72
|
+
_terminalThemes: JSON.stringify([
|
|
73
|
+
buildDefaultThemes()
|
|
74
|
+
]),
|
|
75
|
+
_itermThemes: '[]',
|
|
76
|
+
currentBookmarkGroupId: defaultBookmarkGroupId,
|
|
77
|
+
_expandedKeys: ls.getItem(expandedKeysLsKey) || JSON.stringify([
|
|
78
|
+
defaultBookmarkGroupId
|
|
79
|
+
]),
|
|
80
|
+
bookmarkSelectMode: false,
|
|
81
|
+
_checkedKeys: ls.getItem(checkedKeysLsKey) || '[]',
|
|
82
|
+
_addressBookmarks: '[]',
|
|
83
|
+
_addressBookmarksLocal: ls.getItem(localAddrBookmarkLsKey) || '[]',
|
|
84
|
+
|
|
85
|
+
// init session control
|
|
86
|
+
selectedSessions: [],
|
|
87
|
+
sessionModalVisible: false,
|
|
88
|
+
|
|
89
|
+
// sftp
|
|
90
|
+
fileOperation: fileOperationsMap.cp, // cp or mv
|
|
91
|
+
transferTab: 'transfer',
|
|
92
|
+
_transferHistory: '[]',
|
|
93
|
+
_fileTransfers: '[]',
|
|
94
|
+
_sftpSortSetting: ls.getItem(sftpDefaultSortSettingKey) || JSON.stringify({
|
|
95
|
+
local: {
|
|
96
|
+
prop: 'modifyTime',
|
|
97
|
+
direction: 'asc'
|
|
98
|
+
},
|
|
99
|
+
remote: {
|
|
100
|
+
prop: 'modifyTime',
|
|
101
|
+
direction: 'desc'
|
|
102
|
+
}
|
|
103
|
+
}),
|
|
104
|
+
|
|
105
|
+
// for settings related
|
|
106
|
+
_setting: '',
|
|
107
|
+
_settingItem: JSON.stringify(getInitItem([], settingMap.bookmarks)),
|
|
108
|
+
settingTab: settingMap.bookmarks, // setting tab
|
|
109
|
+
autofocustrigger: Date.now(),
|
|
110
|
+
bookmarkId: undefined,
|
|
111
|
+
showModal: 0,
|
|
112
|
+
activeTerminalId: '',
|
|
113
|
+
|
|
114
|
+
// setting sync related
|
|
115
|
+
isSyncingSetting: false,
|
|
116
|
+
isSyncUpload: false,
|
|
117
|
+
isSyncDownload: false,
|
|
118
|
+
syncSetting: {},
|
|
119
|
+
syncType: syncTypes.github,
|
|
120
|
+
_fonts: '[]',
|
|
121
|
+
|
|
122
|
+
// term search
|
|
123
|
+
termSearchOpen: false,
|
|
124
|
+
termSearch: '',
|
|
125
|
+
termSearchMatchCount: 0,
|
|
126
|
+
termSearchMatchIndex: 0,
|
|
127
|
+
_termSearchOptions: JSON.stringify({
|
|
128
|
+
caseSensitive: false,
|
|
129
|
+
wholeWord: false,
|
|
130
|
+
regex: false,
|
|
131
|
+
decorations: {
|
|
132
|
+
activeMatchColorOverviewRuler: 'yellow'
|
|
133
|
+
}
|
|
134
|
+
}),
|
|
135
|
+
|
|
136
|
+
// quick commands
|
|
137
|
+
_quickCommands: '[]',
|
|
138
|
+
quickCommandId: '',
|
|
139
|
+
openQuickCommandBar: false,
|
|
140
|
+
pinnedQuickCommandBar: false,
|
|
141
|
+
|
|
142
|
+
// sidebar
|
|
143
|
+
openedSideBar: ls.getItem(openedSidebarKey),
|
|
144
|
+
menuOpened: false,
|
|
145
|
+
pinned: ls.getItem(sidebarPinnedKey) === 'true',
|
|
146
|
+
|
|
147
|
+
// info/help modal
|
|
148
|
+
showInfoModal: false,
|
|
149
|
+
infoModalTab: infoTabs.info,
|
|
150
|
+
commandLineHelp: '',
|
|
151
|
+
|
|
152
|
+
// editor
|
|
153
|
+
showEditor: false,
|
|
154
|
+
|
|
155
|
+
// file/info modal
|
|
156
|
+
showFileModal: false,
|
|
157
|
+
|
|
158
|
+
// update
|
|
159
|
+
_upgradeInfo: '{}',
|
|
160
|
+
|
|
161
|
+
// serial list related
|
|
162
|
+
_serials: '[]',
|
|
163
|
+
loaddingSerials: false,
|
|
164
|
+
|
|
165
|
+
// transfer list
|
|
166
|
+
transports: [],
|
|
167
|
+
|
|
168
|
+
_sshConfigItems: '[]',
|
|
169
|
+
|
|
170
|
+
appPath: '',
|
|
171
|
+
exePath: '',
|
|
172
|
+
isPortable: false,
|
|
173
|
+
installSrc: '',
|
|
174
|
+
|
|
175
|
+
_langs: '[]',
|
|
176
|
+
|
|
177
|
+
// batch inputs
|
|
178
|
+
batchInputs: ls.getItemJSON(batchInputLsKey, []),
|
|
179
|
+
|
|
180
|
+
// ui
|
|
181
|
+
innerWidth: window.innerWidth,
|
|
182
|
+
height: 500,
|
|
183
|
+
isMaximized: window.pre.runSync('isMaximized'),
|
|
184
|
+
terminalFullScreen: false
|
|
185
|
+
}
|
|
184
186
|
}
|
package/client/store/setting.js
CHANGED
|
@@ -11,6 +11,7 @@ import copy from 'json-deep-copy'
|
|
|
11
11
|
import {
|
|
12
12
|
settingMap,
|
|
13
13
|
settingCommonId,
|
|
14
|
+
settingSyncId,
|
|
14
15
|
modals
|
|
15
16
|
} from '../common/constants'
|
|
16
17
|
import { buildNewTheme } from '../common/terminal-theme'
|
|
@@ -150,7 +151,7 @@ export default Store => {
|
|
|
150
151
|
store.storeAssign({
|
|
151
152
|
settingTab: settingMap.setting
|
|
152
153
|
})
|
|
153
|
-
store.setSettingItem(copy(store.setting
|
|
154
|
+
store.setSettingItem(copy(store.setting.find(d => d.id === settingSyncId)))
|
|
154
155
|
store.openSettingModal()
|
|
155
156
|
}
|
|
156
157
|
|