@electerm/electerm-react 1.51.1 → 1.51.8

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.
Files changed (64) hide show
  1. package/client/common/constants.js +1 -2
  2. package/client/common/db.js +10 -9
  3. package/client/components/batch-op/batch-op.jsx +16 -5
  4. package/client/components/bookmark-form/index.jsx +1 -1
  5. package/client/components/bookmark-form/ssh-form.jsx +3 -23
  6. package/client/components/bookmark-form/use-submit.jsx +6 -15
  7. package/client/components/context-menu/context-menu.styl +5 -5
  8. package/client/components/context-menu/history.jsx +2 -11
  9. package/client/components/context-menu/sub-tab-menu.jsx +1 -1
  10. package/client/components/footer/batch-input.jsx +10 -10
  11. package/client/components/footer/footer-entry.jsx +3 -8
  12. package/client/components/footer/tab-select.jsx +2 -2
  13. package/client/components/layout/layout-item.jsx +2 -2
  14. package/client/components/layout/layout.jsx +7 -7
  15. package/client/components/main/main.jsx +9 -5
  16. package/client/components/session/session.jsx +22 -3
  17. package/client/components/session/session.styl +3 -2
  18. package/client/components/session/sessions.jsx +4 -4
  19. package/client/components/setting-panel/list.styl +0 -1
  20. package/client/components/setting-panel/on-tree-drop.js +5 -5
  21. package/client/components/setting-panel/setting-modal.jsx +0 -12
  22. package/client/components/sftp/confirm-modal-store.jsx +0 -7
  23. package/client/components/sftp/file-mode-modal.jsx +2 -2
  24. package/client/components/sftp/sftp-entry.jsx +2 -2
  25. package/client/components/sftp/transfer-conflict-store.jsx +69 -66
  26. package/client/components/sftp/transport-action-store.jsx +32 -50
  27. package/client/components/sftp/transports-action-store.jsx +15 -15
  28. package/client/components/sftp/transports-ui-store.jsx +9 -5
  29. package/client/components/shortcuts/shortcut-control.jsx +3 -3
  30. package/client/components/sidebar/bookmark-select.jsx +1 -1
  31. package/client/components/sidebar/bookmark.jsx +4 -63
  32. package/client/components/sidebar/history-item.jsx +34 -0
  33. package/client/components/sidebar/history.jsx +17 -52
  34. package/client/components/sidebar/index.jsx +4 -34
  35. package/client/components/sidebar/sidebar-panel.jsx +107 -0
  36. package/client/components/sidebar/sidebar.styl +14 -0
  37. package/client/components/sidebar/transfer-list-control.jsx +1 -0
  38. package/client/components/sidebar/transfer.styl +1 -1
  39. package/client/components/sidebar/transport-ui.jsx +179 -37
  40. package/client/components/tabs/index.jsx +12 -12
  41. package/client/components/tabs/tab.jsx +23 -14
  42. package/client/components/terminal/index.jsx +12 -15
  43. package/client/components/terminal/term-search.jsx +4 -4
  44. package/client/components/tree-list/tree-list.jsx +8 -10
  45. package/client/entry/worker.js +5 -3
  46. package/client/store/bookmark-group.js +3 -5
  47. package/client/store/common.js +11 -1
  48. package/client/store/db-upgrade.js +0 -2
  49. package/client/store/event.js +1 -1
  50. package/client/store/index.js +2 -5
  51. package/client/store/init-state.js +9 -8
  52. package/client/store/item.js +0 -19
  53. package/client/store/load-data.js +2 -0
  54. package/client/store/quick-command.js +1 -1
  55. package/client/store/session.js +1 -1
  56. package/client/store/setting.js +2 -51
  57. package/client/store/sidebar.js +7 -8
  58. package/client/store/sync.js +7 -7
  59. package/client/store/tab.js +102 -34
  60. package/client/store/transfer-history.js +3 -9
  61. package/client/store/transfer-list.js +75 -75
  62. package/client/store/watch.js +13 -5
  63. package/package.json +1 -1
  64. package/client/components/setting-panel/tab-history.jsx +0 -43
@@ -38,7 +38,7 @@ export const contextMenuPaddingTop = 10
38
38
  export const sftpControlHeight = 42 + 30
39
39
  export const sidebarWidth = 43
40
40
  export const maxHistory = 50
41
- export const maxTransport = 1
41
+ export const maxTransport = 5
42
42
  export const maxSftpHistory = 20
43
43
  export const maxZoom = 8
44
44
  export const minZoom = 0.5
@@ -98,7 +98,6 @@ export const paneMap = buildConst([
98
98
  export const settingMap = buildConst([
99
99
  'setting',
100
100
  'bookmarks',
101
- 'history',
102
101
  'terminalThemes',
103
102
  'bookmarkGroups',
104
103
  'quickCommands',
@@ -5,7 +5,7 @@
5
5
  import {
6
6
  settingMap
7
7
  } from '../common/constants'
8
- import { without, isArray, findIndex } from 'lodash-es'
8
+ import { without, isArray } from 'lodash-es'
9
9
  import handleError from './error-handler'
10
10
  import generate from './uid'
11
11
  import safeParse from './to-simple-obj'
@@ -30,8 +30,7 @@ export const dbNames = without(
30
30
 
31
31
  export const dbNamesForWatch = without(
32
32
  Object.keys(settingMap),
33
- settingMap.setting,
34
- settingMap.history
33
+ settingMap.setting
35
34
  )
36
35
 
37
36
  /**
@@ -146,10 +145,12 @@ export async function getData (name) {
146
145
  export async function fetchInitData (dbName) {
147
146
  const res = await find(dbName)
148
147
  const order = await getData(`${dbName}:order`)
149
- const r = res.sort((a, b) => {
150
- const ai = findIndex(order, r => r === a.id)
151
- const bi = findIndex(order, r => r === b.id)
152
- return ai - bi
153
- })
154
- return JSON.stringify(r)
148
+ if (order && order.length) {
149
+ res.sort((a, b) => {
150
+ const ai = order.findIndex(r => r === a.id)
151
+ const bi = order.findIndex(r => r === b.id)
152
+ return ai - bi
153
+ })
154
+ }
155
+ return JSON.stringify(res)
155
156
  }
@@ -173,11 +173,15 @@ export default class BatchOp extends PureComponent {
173
173
  run = async (conf, index) => {
174
174
  this.updateState('working', index)
175
175
  let tab = await this.createTab(conf)
176
- .then(r => r)
177
176
  .catch(err => {
177
+ console.log('create tab error', err)
178
+ if (this.ref) {
179
+ this.ref.stop()
180
+ delete this.ref
181
+ }
178
182
  return 'Error: ' + err.message
179
183
  })
180
- if (!tab) {
184
+ if (typeof tab === 'string') {
181
185
  return this.updateState(tab, index)
182
186
  }
183
187
 
@@ -189,9 +193,16 @@ export default class BatchOp extends PureComponent {
189
193
  }
190
194
  if (conf.remotePath) {
191
195
  this.updateState('creating sftp', index)
192
- tab = await this.createSftp(tab)
193
- if (!tab) {
194
- return this.updateState('Error: ' + tab, index)
196
+ tab = await this.createSftp(tab).catch(err => {
197
+ console.log('create sftp error', err)
198
+ if (this.ref2) {
199
+ this.ref2.stop()
200
+ delete this.ref2
201
+ }
202
+ return 'Error: ' + err.message
203
+ })
204
+ if (typeof tab === 'string') {
205
+ return this.updateState(tab, index)
195
206
  }
196
207
  this.updateState('sftp created', index)
197
208
  this.updateState('transferring file', index)
@@ -125,7 +125,7 @@ export default class BookmarkIndex extends PureComponent {
125
125
  const {
126
126
  type
127
127
  } = this.props
128
- if (type !== settingMap.bookmarks && type !== settingMap.history) {
128
+ if (type !== settingMap.bookmarks) {
129
129
  return null
130
130
  }
131
131
  const { ready } = this.state
@@ -5,7 +5,7 @@ import { PureComponent } from 'react'
5
5
  import {
6
6
  message
7
7
  } from 'antd'
8
- import { findIndex, uniq, isEqual, pick } from 'lodash-es'
8
+ import { uniq, isEqual, pick } from 'lodash-es'
9
9
  import copy from 'json-deep-copy'
10
10
  import generate from '../../common/uid'
11
11
  import {
@@ -96,13 +96,11 @@ export default class BookmarkForm extends PureComponent {
96
96
  }
97
97
 
98
98
  updateBookmarkGroups = (bookmarkGroups, bookmark, categoryId) => {
99
- let index = findIndex(
100
- bookmarkGroups,
99
+ let index = bookmarkGroups.findIndex(
101
100
  bg => bg.id === categoryId
102
101
  )
103
102
  if (index < 0) {
104
- index = findIndex(
105
- bookmarkGroups,
103
+ index = bookmarkGroups.findIndex(
106
104
  bg => bg.id === defaultBookmarkGroupId
107
105
  )
108
106
  }
@@ -167,19 +165,6 @@ export default class BookmarkForm extends PureComponent {
167
165
  const bookmarkGroups = copy(
168
166
  this.props.bookmarkGroups
169
167
  )
170
- if (type === settingMap.history) {
171
- obj.id = generate()
172
- runIdle(() => {
173
- addItem(obj, settingMap.bookmarks)
174
- })
175
- this.updateBookmarkGroups(
176
- bookmarkGroups,
177
- obj,
178
- categoryId
179
- )
180
- message.success('OK', 3)
181
- return
182
- }
183
168
  if (!obj.id.startsWith(newBookmarkIdPrefix)) {
184
169
  const tar = copy(obj)
185
170
  delete tar.id
@@ -196,11 +181,6 @@ export default class BookmarkForm extends PureComponent {
196
181
  }
197
182
  } else {
198
183
  obj.id = generate()
199
- if (evt !== 'save' && evt !== 'saveAndCreateNew') {
200
- runIdle(() => {
201
- addItem(obj, settingMap.history)
202
- })
203
- }
204
184
  runIdle(() => {
205
185
  addItem(obj, settingMap.bookmarks)
206
186
  })
@@ -10,9 +10,6 @@ import {
10
10
  Button,
11
11
  Form
12
12
  } from 'antd'
13
- import {
14
- settingMap
15
- } from '../../common/constants'
16
13
  import { tailFormItemLayout } from '../../common/form-layout'
17
14
  import useFuncs from './use-form-funcs'
18
15
 
@@ -37,18 +34,12 @@ export default function useBookmarkSubmit (props) {
37
34
  className='mg1r mg1b'
38
35
  >{e('saveAndConnect')}
39
36
  </Button>
40
- {
41
- settingMap.history === props.type
42
- ? null
43
- : (
44
- <Button
45
- type='primary'
46
- className='mg1r mg1b'
47
- onClick={saveAndCreateNew}
48
- >{e('saveAndCreateNew')}
49
- </Button>
50
- )
51
- }
37
+ <Button
38
+ type='primary'
39
+ className='mg1r mg1b'
40
+ onClick={saveAndCreateNew}
41
+ >{e('saveAndCreateNew')}
42
+ </Button>
52
43
  <Button
53
44
  type='dashed'
54
45
  className='mg1r mg1b'
@@ -2,7 +2,7 @@
2
2
  .context-menu
3
3
  position: absolute
4
4
  width 280px
5
- background main-dark
5
+ background main
6
6
  box-shadow 0px 0px 3px 3px alpha(main-dark, .35)
7
7
  padding 10px 0
8
8
  z-index 999
@@ -20,7 +20,7 @@
20
20
  line-height 28px
21
21
  padding 0 16px
22
22
  &:hover
23
- background #000
23
+ background #08c
24
24
  color #eee
25
25
  cursor pointer
26
26
  &.disabled
@@ -47,7 +47,7 @@
47
47
  position absolute
48
48
  left 100%
49
49
  top 0
50
- background main-dark
50
+ background main
51
51
  box-shadow 0px 0px 3px 3px alpha(main, .35)
52
52
  max-height 300px
53
53
  overflow-y scroll
@@ -62,8 +62,8 @@
62
62
  white-space nowrap
63
63
  text-overflow ellipsis
64
64
  &:hover, &.active
65
- background-color primary
66
- color contrastColor(primary)
65
+ background-color #08c
66
+ color #eee
67
67
  .bookmarks-sub-context-menu
68
68
  width 380px
69
69
  padding 20px 10px 10px 20px
@@ -1,21 +1,12 @@
1
- import { createTitleWithTag } from '../../common/create-title'
1
+ import HistoryItem from '../sidebar/history-item'
2
2
 
3
3
  export default function HistorySubMenu (props) {
4
- const { store } = window
5
4
  return (
6
5
  <div className='sub-context-menu'>
7
6
  {
8
7
  props.history.map(item => {
9
- const title = createTitleWithTag(item)
10
8
  return (
11
- <div
12
- className='sub-context-menu-item'
13
- title={title}
14
- key={item.id}
15
- onClick={() => store.onSelectHistory(item.id)}
16
- >
17
- {title}
18
- </div>
9
+ <HistoryItem key={item.id} item={item} />
19
10
  )
20
11
  })
21
12
  }
@@ -3,7 +3,7 @@ import { createTitleWithTag } from '../../common/create-title'
3
3
 
4
4
  export default class TabsSubMenuChild extends PureComponent {
5
5
  handleClick = () => {
6
- window.store.onChangeTabId(this.props.item.id)
6
+ window.store.changeActiveTabId(this.props.item.id)
7
7
  }
8
8
 
9
9
  render () {
@@ -26,19 +26,19 @@ export default class BatchInput extends Component {
26
26
  super(props)
27
27
  this.state = {
28
28
  cmd: '',
29
- selectedTabIds: [props.currentTabId],
29
+ selectedTabIds: [props.activeTabId],
30
30
  open: false,
31
31
  enter: false
32
32
  }
33
33
  }
34
34
 
35
35
  componentDidUpdate (prevProps) {
36
- if (prevProps.currentTabId !== this.props.currentTabId) {
36
+ if (prevProps.activeTabId !== this.props.activeTabId) {
37
37
  this.setState(prevState => {
38
38
  const newSelectedTabIds = prevState.selectedTabIds.filter(
39
- id => id !== this.props.currentTabId
39
+ id => id !== this.props.activeTabId
40
40
  )
41
- newSelectedTabIds.unshift(this.props.currentTabId)
41
+ newSelectedTabIds.unshift(this.props.activeTabId)
42
42
  return {
43
43
  selectedTabIds: newSelectedTabIds
44
44
  }
@@ -72,7 +72,7 @@ export default class BatchInput extends Component {
72
72
 
73
73
  onSelectNone = () => {
74
74
  this.setState({
75
- selectedTabIds: [this.props.currentTabId]
75
+ selectedTabIds: [this.props.activeTabId]
76
76
  })
77
77
  }
78
78
 
@@ -91,7 +91,7 @@ export default class BatchInput extends Component {
91
91
  // Ensure at least the current tab is selected
92
92
  if (selectedTabIds.length === 0) {
93
93
  return {
94
- selectedTabIds: [this.props.currentTabId]
94
+ selectedTabIds: [this.props.activeTabId]
95
95
  }
96
96
  }
97
97
 
@@ -178,15 +178,15 @@ export default class BatchInput extends Component {
178
178
  }
179
179
 
180
180
  getTabs = () => {
181
- const { currentTabId } = this.props
181
+ const { activeTabId } = this.props
182
182
  return deepCopy(this.props.tabs.filter(tab => {
183
183
  return tab.type !== terminalWebType &&
184
184
  tab.type !== terminalRdpType &&
185
185
  tab.type !== terminalVncType
186
186
  })).sort((a, b) => {
187
187
  // Current tab goes first
188
- if (a.id === currentTabId) return -1
189
- if (b.id === currentTabId) return 1
188
+ if (a.id === activeTabId) return -1
189
+ if (b.id === activeTabId) return 1
190
190
  return 0
191
191
  })
192
192
  }
@@ -215,7 +215,7 @@ export default class BatchInput extends Component {
215
215
  className: 'batch-input-holder'
216
216
  }
217
217
  const tabSelectProps = {
218
- currentTabId: this.props.currentTabId,
218
+ activeTabId: this.props.activeTabId,
219
219
  tabs: this.getTabs(),
220
220
  selectedTabIds,
221
221
  onSelectAll: this.onSelectAll,
@@ -18,12 +18,7 @@ const e = window.translate
18
18
 
19
19
  export default auto(function FooterEntry (props) {
20
20
  function handleInfoPanel () {
21
- const { store } = window
22
- store.rightPanelVisible = !store.rightPanelVisible
23
- postMessage({
24
- action: terminalActions.showInfoPanel,
25
- currentTabId: store.currentTabId
26
- })
21
+ window.store.openInfoPanel()
27
22
  }
28
23
 
29
24
  function batchInput (cmd, selectedTabIds) {
@@ -38,7 +33,7 @@ export default auto(function FooterEntry (props) {
38
33
  postMessage({
39
34
  encode,
40
35
  action: terminalActions.changeEncode,
41
- currentTabId: props.store.currentTabId
36
+ activeTabId: props.store.activeTabId
42
37
  })
43
38
  }
44
39
 
@@ -58,7 +53,7 @@ export default auto(function FooterEntry (props) {
58
53
  input: batchInput,
59
54
  batchInputs: props.store.batchInputs,
60
55
  tabs: props.store.tabs,
61
- currentTabId: props.store.currentTabId
56
+ activeTabId: props.store.activeTabId
62
57
  }
63
58
  return (
64
59
  <div className='terminal-footer-unit terminal-footer-center'>
@@ -7,7 +7,7 @@ import {
7
7
  } from '@ant-design/icons'
8
8
 
9
9
  export default function TabSelect (props) {
10
- const { selectedTabIds, tabs, currentTabId } = props
10
+ const { selectedTabIds, tabs, activeTabId } = props
11
11
  function renderTabs () {
12
12
  return tabs.map(tab => {
13
13
  const selected = selectedTabIds.includes(tab.id)
@@ -16,7 +16,7 @@ export default function TabSelect (props) {
16
16
  selected,
17
17
  onSelect: props.onSelect,
18
18
  id: tab.id,
19
- isCurrent: tab.id === currentTabId
19
+ isCurrent: tab.id === activeTabId
20
20
  }
21
21
  return (
22
22
  <TabItem
@@ -18,8 +18,8 @@ export default function LayoutItem (props) {
18
18
  }
19
19
  let currentElement = target
20
20
  while (currentElement) {
21
- if (currentElement.classList && currentElement.classList.contains('tab')) {
22
- return
21
+ if (currentElement.classList && currentElement.classList.contains('layout-item')) {
22
+ break
23
23
  }
24
24
  currentElement = currentElement.parentElement
25
25
  }
@@ -102,7 +102,7 @@ export default auto(function Layout (props) {
102
102
  const sessProps = {
103
103
  batch: i,
104
104
  layout,
105
- currentBatchTabId: store[`currentTabId${i}`],
105
+ currentBatchTabId: store[`activeTabId${i}`],
106
106
  ...v,
107
107
  tabs: tabsBatch[i] || [],
108
108
  ...pick(store, [
@@ -132,7 +132,7 @@ export default auto(function Layout (props) {
132
132
  currentTab,
133
133
  config,
134
134
  ...pick(store, [
135
- 'currentTabId',
135
+ 'activeTabId',
136
136
  'termSearchOpen',
137
137
  'termSearch',
138
138
  'termSearchOptions',
@@ -161,11 +161,11 @@ export default auto(function Layout (props) {
161
161
  height,
162
162
  layoutStyle: pixedLayoutStyle,
163
163
  ...pick(store, [
164
- 'currentTabId',
165
- 'currentTabId0',
166
- 'currentTabId1',
167
- 'currentTabId2',
168
- 'currentTabId3',
164
+ 'activeTabId',
165
+ 'activeTabId0',
166
+ 'activeTabId1',
167
+ 'activeTabId2',
168
+ 'activeTabId3',
169
169
  'batch',
170
170
  'resolutions',
171
171
  'hideDelKeyTip',
@@ -27,6 +27,7 @@ import { ConfigProvider, notification, message } from 'antd'
27
27
  import InfoModal from '../sidebar/info-modal.jsx'
28
28
  import RightSidePanel from '../side-panel-r/side-panel-r'
29
29
  import { pick } from 'lodash-es'
30
+ import deepCopy from 'json-deep-copy'
30
31
  import './wrapper.styl'
31
32
 
32
33
  function setupGlobalMessageDismiss () {
@@ -131,6 +132,8 @@ export default auto(function Index (props) {
131
132
  opacity: config.opacity
132
133
  }
133
134
  }
135
+ const copiedTransfer = deepCopy(fileTransfers)
136
+ const copiedHistory = deepCopy(transferHistory)
134
137
  const sidebarProps = {
135
138
  ...pick(store, [
136
139
  'activeItemId',
@@ -143,10 +146,11 @@ export default auto(function Index (props) {
143
146
  'settingItem',
144
147
  'isSyncingSetting',
145
148
  'leftSidebarWidth',
146
- 'transferTab'
149
+ 'transferTab',
150
+ 'sidebarPanelTab'
147
151
  ]),
148
- fileTransfers,
149
- transferHistory,
152
+ fileTransfers: copiedTransfer,
153
+ transferHistory: copiedHistory,
150
154
  upgradeInfo,
151
155
  pinned
152
156
  }
@@ -161,8 +165,8 @@ export default auto(function Index (props) {
161
165
  upgradeInfo
162
166
  }
163
167
  const conflictStoreProps = {
164
- fileTransfers,
165
- _fileTransfers: store._fileTransfers
168
+ fileTransferChanged: JSON.stringify(copiedTransfer),
169
+ fileTransfers: copiedTransfer
166
170
  }
167
171
  const batchOpProps = {
168
172
  transferHistory,
@@ -61,13 +61,22 @@ export default class SessionWrapper extends Component {
61
61
  return document.getElementById(`is-${this.props.tab.id}`)
62
62
  }
63
63
 
64
+ handleClick = () => {
65
+ window.store.activeTabId = this.props.tab.id
66
+ }
67
+
64
68
  onDrop = (e) => {
65
69
  e.preventDefault()
66
70
  const { target } = e
67
71
  if (!target) {
68
72
  return
69
73
  }
70
- const fromTab = JSON.parse(e.dataTransfer.getData('fromFile'))
74
+ let fromTab
75
+ try {
76
+ fromTab = JSON.parse(e.dataTransfer.getData('fromFile'))
77
+ } catch (e) {
78
+ return
79
+ }
71
80
  const onDropElem = this.getDom()
72
81
  const { batch } = this.props.tab
73
82
  if (!onDropElem || !fromTab || fromTab.batch === batch) {
@@ -79,6 +88,15 @@ export default class SessionWrapper extends Component {
79
88
  if (!t) {
80
89
  return
81
90
  }
91
+ // Handle currentTab change if needed
92
+ const fromBatch = fromTab.batch
93
+ if (window.store[`activeTabId${fromBatch}`] === fromTab.id && fromBatch !== batch) {
94
+ // Find next tab in the same batch
95
+ const nextTab = tabs.find((t, i) =>
96
+ t.id !== fromTab.id && t.batch === fromBatch
97
+ )
98
+ window.store[`activeTabId${fromBatch}`] = nextTab ? nextTab.id : ''
99
+ }
82
100
  t.batch = batch
83
101
  this.clearCls()
84
102
  }
@@ -337,7 +355,7 @@ export default class SessionWrapper extends Component {
337
355
  handleOpenSearch = () => {
338
356
  postMessage({
339
357
  action: terminalActions.openTerminalSearch,
340
- currentTabId: this.props.tab.id
358
+ activeTabId: this.props.tab.id
341
359
  })
342
360
  }
343
361
 
@@ -501,7 +519,8 @@ export default class SessionWrapper extends Component {
501
519
  onDragEnter: this.onDragEnter,
502
520
  onDragLeave: this.onDragLeave,
503
521
  onDrop: this.onDrop,
504
- onDragEnd: this.onDragEnd
522
+ onDragEnd: this.onDragEnd,
523
+ onClick: this.handleClick
505
524
  }
506
525
  return (
507
526
  <div
@@ -57,8 +57,9 @@
57
57
  overflow hidden
58
58
  z-index 3
59
59
  padding-top 36px
60
- .session-batch-active
61
- display block
60
+ box-shadow 0px 0px 1px 1px alpha(main, .3)
61
+ &.session-batch-active
62
+ display block
62
63
 
63
64
  .web-session-wrap
64
65
  height 100vh
@@ -42,17 +42,17 @@ export default class Sessions extends Component {
42
42
  const {
43
43
  config,
44
44
  tabs,
45
- currentTabId,
45
+ activeTabId,
46
46
  sizes
47
47
  } = this.props
48
48
  return tabs.map((tab) => {
49
49
  const { id, batch } = tab
50
50
  const { height, width } = sizes[batch]
51
- const currentBatchTabId = this.props['currentTabId' + batch]
51
+ const currentBatchTabId = this.props['activeTabId' + batch]
52
52
  const cls = classNames(
53
53
  `session-wrap session-${id}`,
54
54
  {
55
- 'session-current': id === currentTabId,
55
+ 'session-current': id === activeTabId,
56
56
  'session-batch-active': id === currentBatchTabId
57
57
  }
58
58
  )
@@ -61,7 +61,7 @@ export default class Sessions extends Component {
61
61
  className: cls
62
62
  }
63
63
  const sessProps = {
64
- currentTabId,
64
+ activeTabId,
65
65
  tab,
66
66
  width,
67
67
  height,
@@ -21,7 +21,6 @@
21
21
  margin-bottom 1px
22
22
  cursor pointer
23
23
  line-height 1.8
24
- cu
25
24
  &.active
26
25
  background primary
27
26
  color contrastColor(primary)
@@ -5,7 +5,7 @@
5
5
  import {
6
6
  defaultBookmarkGroupId
7
7
  } from '../../common/constants'
8
- import { isEqual, find, findIndex, last, remove } from 'lodash-es'
8
+ import { isEqual, find, last, remove } from 'lodash-es'
9
9
  import copy from 'json-deep-copy'
10
10
 
11
11
  export default (info, props) => {
@@ -129,7 +129,7 @@ export default (info, props) => {
129
129
  ? toGroup.bookmarkIds || []
130
130
  : toGroup.bookmarkGroupIds || []
131
131
  nodeIndex = dropToGap
132
- ? findIndex(pool, d => d === toId)
132
+ ? pool.findIndex(d => d === toId)
133
133
  : pool.length
134
134
  if (dropToGap) {
135
135
  if (fromLeaf) {
@@ -143,7 +143,7 @@ export default (info, props) => {
143
143
  }
144
144
  }
145
145
  } else {
146
- nodeIndex = findIndex(bookmarkGroups, d => {
146
+ nodeIndex = bookmarkGroups.findIndex(d => {
147
147
  return d.id === toId
148
148
  })
149
149
  if (fromLeaf) {
@@ -165,7 +165,7 @@ export default (info, props) => {
165
165
  }
166
166
  const updates = []
167
167
  if (toFirstLevel) {
168
- fromIndex = findIndex(bookmarkGroups, d => d.id === fromId)
168
+ fromIndex = bookmarkGroups.findIndex(d => d.id === fromId)
169
169
  from = copy(from)
170
170
  bookmarkGroups.splice(fromIndex, 1, 'tobedel')
171
171
  bookmarkGroups.splice(nodeIndex, 0, from)
@@ -177,7 +177,7 @@ export default (info, props) => {
177
177
  const arr = fromLeaf
178
178
  ? fromGroup.bookmarkIds
179
179
  : fromGroup.bookmarkGroupIds
180
- fromIndex = findIndex(arr, d => d === fromId)
180
+ fromIndex = arr.findIndex(d => d === fromId)
181
181
  isSameCat
182
182
  ? arr.splice(fromIndex, 1, 'tobedel')
183
183
  : remove(arr, d => d === fromId)
@@ -11,7 +11,6 @@ import {
11
11
  modals
12
12
  } from '../../common/constants'
13
13
  import TabBookmarks from './tab-bookmarks'
14
- import TabHistory from './tab-history'
15
14
  import TabQuickCommands from './tab-quick-commands'
16
15
  import TabSettings from './tab-settings'
17
16
  import TabThemes from './tab-themes'
@@ -68,11 +67,6 @@ export default auto(function SettingModalWrap (props) {
68
67
  ])
69
68
  }
70
69
  const items = [
71
- {
72
- key: settingMap.history,
73
- label: e(settingMap.history),
74
- children: null
75
- },
76
70
  {
77
71
  key: settingMap.bookmarks,
78
72
  label: e(settingMap.bookmarks),
@@ -113,12 +107,6 @@ export default auto(function SettingModalWrap (props) {
113
107
  <Tabs
114
108
  {...tabsProps}
115
109
  />
116
- <TabHistory
117
- listProps={props0}
118
- settingItem={settingItem}
119
- formProps={formProps}
120
- settingTab={settingTab}
121
- />
122
110
  <TabQuickCommands
123
111
  listProps={props0}
124
112
  settingItem={settingItem}