@electerm/electerm-react 5.5.66 → 5.5.76
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 +12 -0
- package/client/common/default-setting.js +1 -0
- package/client/common/distribute-tabs.js +42 -0
- package/client/common/import-task.js +46 -3
- package/client/common/parse-quick-connect.js +1 -0
- package/client/common/quick-connect-string.js +134 -0
- package/client/common/ui-theme-color.mjs +136 -0
- package/client/common/update-check.js +14 -0
- package/client/components/ai/ai-output.jsx +5 -0
- package/client/components/ai/ai.styl +19 -0
- package/client/components/bookmark-form/copy-bookmark.jsx +83 -0
- package/client/components/bookmark-form/form-renderer.jsx +13 -1
- package/client/components/bookmark-form/index.jsx +20 -1
- package/client/components/bookmark-form/render-form.jsx +2 -2
- package/client/components/main/ui-theme.jsx +1 -20
- package/client/components/main/upgrade.jsx +2 -0
- package/client/components/setting-panel/install-command.jsx +151 -0
- package/client/components/setting-panel/setting-common.jsx +5 -0
- package/client/components/setting-panel/setting-terminal.jsx +9 -1
- package/client/components/terminal/mixins/term-attach.js +10 -2
- package/client/components/terminal/mixins/term-socket.js +12 -2
- package/client/components/terminal/mixins/term-suggestions.js +16 -3
- package/client/components/terminal/osc52-addon.js +7 -2
- package/client/components/terminal/session-status-overlay.jsx +44 -0
- package/client/components/terminal/ssh-reload-state.js +41 -2
- package/client/components/terminal/startup-queue.js +6 -2
- package/client/components/terminal/terminal.jsx +13 -2
- package/client/components/terminal/terminal.styl +14 -5
- package/client/store/sync.js +46 -18
- package/client/store/tab.js +45 -2
- package/client/store/watch.js +8 -0
- package/package.json +1 -1
- package/client/components/terminal/reconnect-overlay.jsx +0 -14
package/client/store/tab.js
CHANGED
|
@@ -19,6 +19,7 @@ import newTerm, { updateCount } from '../common/new-terminal.js'
|
|
|
19
19
|
import { action } from 'manate'
|
|
20
20
|
import { shouldCaptureTerminalReloadState } from '../components/terminal/ssh-reload-state.js'
|
|
21
21
|
import dangerousSessionFields from '../common/dangerous-session-fields'
|
|
22
|
+
import { distributeTabsEvenly } from '../common/distribute-tabs'
|
|
22
23
|
|
|
23
24
|
function captureSshSessionState (tab, config) {
|
|
24
25
|
return shouldCaptureTerminalReloadState(tab, config)
|
|
@@ -491,12 +492,45 @@ export default Store => {
|
|
|
491
492
|
}
|
|
492
493
|
ntb.batch = (currentLayoutBatch + 1) % maxBatch
|
|
493
494
|
if (layout === 'c1') {
|
|
494
|
-
store.setLayout('c2')
|
|
495
|
+
store.setLayout('c2', false)
|
|
495
496
|
}
|
|
496
497
|
store.addTab(ntb)
|
|
497
498
|
}
|
|
498
499
|
|
|
499
|
-
|
|
500
|
+
// Spread tabs over the panes of a layout with more panes.
|
|
501
|
+
// Only used when leaving the single layout: once more than one pane is on
|
|
502
|
+
// screen the arrangement is the user's, and is left alone.
|
|
503
|
+
Store.prototype.distributeTabs = function (newCount) {
|
|
504
|
+
const { store } = window
|
|
505
|
+
const { tabs } = store
|
|
506
|
+
if (tabs.length < 2) {
|
|
507
|
+
return
|
|
508
|
+
}
|
|
509
|
+
// contiguous chunks keep the tab order: [A B C D E] -> [A B] [C D] [E]
|
|
510
|
+
const batches = distributeTabsEvenly(tabs.length, newCount)
|
|
511
|
+
tabs.forEach((t, i) => {
|
|
512
|
+
t.batch = batches[i]
|
|
513
|
+
})
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// make sure every pane has a valid active tab
|
|
517
|
+
Store.prototype.fixActiveTabIds = function (count) {
|
|
518
|
+
const { store } = window
|
|
519
|
+
for (let b = 0; b < count; b++) {
|
|
520
|
+
const inBatch = store.tabs.filter(t => t.batch === b)
|
|
521
|
+
const key = `activeTabId${b}`
|
|
522
|
+
if (!inBatch.some(t => t.id === store[key])) {
|
|
523
|
+
store[key] = inBatch.length ? inBatch[0].id : ''
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
const active = store.tabs.find(t => t.id === store.activeTabId)
|
|
527
|
+
if (active) {
|
|
528
|
+
store[`activeTabId${active.batch}`] = active.id
|
|
529
|
+
store.currentLayoutBatch = active.batch
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
Store.prototype.setLayout = function (layout, redistribute = true) {
|
|
500
534
|
const { store } = window
|
|
501
535
|
const prevLayout = store.layout
|
|
502
536
|
const { activeTabId } = store
|
|
@@ -533,6 +567,15 @@ export default Store => {
|
|
|
533
567
|
if (store.currentLayoutBatch >= newBatchCount) {
|
|
534
568
|
store.currentLayoutBatch = newBatchCount - 1
|
|
535
569
|
}
|
|
570
|
+
} else if (
|
|
571
|
+
redistribute &&
|
|
572
|
+
store.config.autoDistributeTabsWhenLayoutChange &&
|
|
573
|
+
prevBatchCount === 1 &&
|
|
574
|
+
newBatchCount > 1
|
|
575
|
+
) {
|
|
576
|
+
// leaving the single layout: hand the tabs out evenly
|
|
577
|
+
store.distributeTabs(newBatchCount)
|
|
578
|
+
store.fixActiveTabIds(newBatchCount)
|
|
536
579
|
}
|
|
537
580
|
store.focus()
|
|
538
581
|
}
|
package/client/store/watch.js
CHANGED
|
@@ -82,6 +82,14 @@ export default store => {
|
|
|
82
82
|
}
|
|
83
83
|
return store[name]
|
|
84
84
|
}, schedule)
|
|
85
|
+
// Make the current store contents the watcher's baseline, so a later
|
|
86
|
+
// start() diffs against the store rather than a snapshot that no longer
|
|
87
|
+
// describes it. Needed after a rolled-back import: the store has just been
|
|
88
|
+
// restored to its pre-import state, and diffing that against the snapshot
|
|
89
|
+
// taken before the import would be read as "every record was removed".
|
|
90
|
+
window[`watch${name}`].reseed = () => {
|
|
91
|
+
refsStatic.add('oldState-' + name, deepCopy(store.getItems(name)) || [])
|
|
92
|
+
}
|
|
85
93
|
window[`watch${name}`].start()
|
|
86
94
|
}
|
|
87
95
|
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { memo } from 'react'
|
|
2
|
-
|
|
3
|
-
const e = window.translate
|
|
4
|
-
|
|
5
|
-
export default memo(function ReconnectOverlay ({ countdown }) {
|
|
6
|
-
if (countdown === null || countdown === undefined) {
|
|
7
|
-
return null
|
|
8
|
-
}
|
|
9
|
-
return (
|
|
10
|
-
<div className='terminal-reconnect-overlay'>
|
|
11
|
-
{e('autoReconnectTerminal')}: {countdown}s
|
|
12
|
-
</div>
|
|
13
|
-
)
|
|
14
|
-
})
|