@electerm/electerm-react 1.36.1 → 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.
@@ -15,6 +15,8 @@ import './login.styl'
15
15
  const { prefix } = window
16
16
  const f = prefix('form')
17
17
 
18
+ window.store = store
19
+
18
20
  export default class Login extends Component {
19
21
  state = {
20
22
  pass: '',
@@ -88,7 +88,7 @@ class Store {
88
88
  constructor () {
89
89
  Object.assign(
90
90
  this,
91
- initState
91
+ initState()
92
92
  )
93
93
  }
94
94
 
@@ -350,7 +350,7 @@ batchInputHistory(Store)
350
350
  transferExtend(Store)
351
351
  addressBookmarkExtend(Store)
352
352
 
353
+ export const StateStore = Store
353
354
  const store = manage(new Store())
354
355
 
355
- window.store = store
356
356
  export default store
@@ -53,132 +53,134 @@ export const getInitItem = (arr, tab) => {
53
53
  }
54
54
  }
55
55
 
56
- export default {
57
- // common
58
- wsInited: false,
59
- configLoaded: false,
60
- loadTime: 0,
61
- lastDataUpdateTime: 0,
62
- _tabs: '[]',
63
- currentTabId: '',
64
- termFocused: false,
65
- _history: '[]',
66
- _bookmarks: '[]',
67
- _bookmarkGroups: JSON.stringify(
68
- getDefaultBookmarkGroups([])
69
- ),
70
- _config: '{}',
71
- _terminalThemes: JSON.stringify([
72
- buildDefaultThemes()
73
- ]),
74
- _itermThemes: '[]',
75
- currentBookmarkGroupId: defaultBookmarkGroupId,
76
- _expandedKeys: ls.getItem(expandedKeysLsKey) || JSON.stringify([
77
- defaultBookmarkGroupId
78
- ]),
79
- bookmarkSelectMode: false,
80
- _checkedKeys: ls.getItem(checkedKeysLsKey) || '[]',
81
- _addressBookmarks: '[]',
82
- _addressBookmarksLocal: ls.getItem(localAddrBookmarkLsKey) || '[]',
83
-
84
- // init session control
85
- selectedSessions: [],
86
- sessionModalVisible: false,
87
-
88
- // sftp
89
- fileOperation: fileOperationsMap.cp, // cp or mv
90
- transferTab: 'transfer',
91
- _transferHistory: '[]',
92
- _fileTransfers: '[]',
93
- _sftpSortSetting: ls.getItem(sftpDefaultSortSettingKey) || JSON.stringify({
94
- local: {
95
- prop: 'modifyTime',
96
- direction: 'asc'
97
- },
98
- remote: {
99
- prop: 'modifyTime',
100
- direction: 'desc'
101
- }
102
- }),
103
-
104
- // for settings related
105
- _setting: '',
106
- _settingItem: JSON.stringify(getInitItem([], settingMap.bookmarks)),
107
- settingTab: settingMap.bookmarks, // setting tab
108
- autofocustrigger: Date.now(),
109
- bookmarkId: undefined,
110
- showModal: 0,
111
- activeTerminalId: '',
112
-
113
- // setting sync related
114
- isSyncingSetting: false,
115
- isSyncUpload: false,
116
- isSyncDownload: false,
117
- syncSetting: {},
118
- syncType: syncTypes.github,
119
- _fonts: '[]',
120
-
121
- // term search
122
- termSearchOpen: false,
123
- termSearch: '',
124
- termSearchMatchCount: 0,
125
- termSearchMatchIndex: 0,
126
- _termSearchOptions: JSON.stringify({
127
- caseSensitive: false,
128
- wholeWord: false,
129
- regex: false,
130
- decorations: {
131
- activeMatchColorOverviewRuler: 'yellow'
132
- }
133
- }),
134
-
135
- // quick commands
136
- _quickCommands: '[]',
137
- quickCommandId: '',
138
- openQuickCommandBar: false,
139
- pinnedQuickCommandBar: false,
140
-
141
- // sidebar
142
- openedSideBar: ls.getItem(openedSidebarKey),
143
- menuOpened: false,
144
- pinned: ls.getItem(sidebarPinnedKey) === 'true',
145
-
146
- // info/help modal
147
- showInfoModal: false,
148
- infoModalTab: infoTabs.info,
149
- commandLineHelp: '',
150
-
151
- // editor
152
- showEditor: false,
153
-
154
- // file/info modal
155
- showFileModal: false,
156
-
157
- // update
158
- _upgradeInfo: '{}',
159
-
160
- // serial list related
161
- _serials: '[]',
162
- loaddingSerials: false,
163
-
164
- // transfer list
165
- transports: [],
166
-
167
- _sshConfigItems: '[]',
168
-
169
- appPath: '',
170
- exePath: '',
171
- isPortable: false,
172
- installSrc: '',
173
-
174
- _langs: '[]',
175
-
176
- // batch inputs
177
- batchInputs: ls.getItemJSON(batchInputLsKey, []),
178
-
179
- // ui
180
- innerWidth: window.innerWidth,
181
- height: 500,
182
- isMaximized: window.pre.runSync('isMaximized'),
183
- terminalFullScreen: false
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electerm/electerm-react",
3
- "version": "1.36.1",
3
+ "version": "1.36.2",
4
4
  "description": "react components src for electerm",
5
5
  "main": "./client/components/main/main.jsx",
6
6
  "license": "MIT",