@electerm/electerm-react 5.0.7 → 5.0.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.
- package/client/components/common/logo-elem.jsx +1 -1
- package/client/components/common/logo.styl +8 -2
- package/client/components/footer/cmd-history.jsx +13 -7
- package/client/components/footer/cmd-history.styl +8 -0
- package/client/components/quick-commands/quick-commands-box.jsx +2 -19
- package/client/components/quick-commands/quick-commands-select.jsx +10 -20
- package/client/components/sidebar/history.jsx +13 -10
- package/client/components/sidebar/sidebar.styl +6 -0
- package/client/components/tabs/no-session.jsx +1 -1
- package/client/components/tabs/no-session.styl +31 -8
- package/client/css/mobile.styl +18 -6
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ import './logo.styl'
|
|
|
9
9
|
|
|
10
10
|
export default function LogoElem () {
|
|
11
11
|
return (
|
|
12
|
-
<h1 className='mg3y font50'>
|
|
12
|
+
<h1 className='logo-elem mg3y font50'>
|
|
13
13
|
<span className='iblock pd3 morph-shape mg1l mg1r'>
|
|
14
14
|
<img src={logoPath2} className='iblock mwm-100 mg1l mg1r logo-filter logo-img' />
|
|
15
15
|
</span>
|
|
@@ -3,8 +3,14 @@
|
|
|
3
3
|
.logo-img-small
|
|
4
4
|
height 28px
|
|
5
5
|
border-radius 28px
|
|
6
|
-
|
|
6
|
+
// the h1 vertical margin so the logo stops dominating the no-session panel.
|
|
7
|
+
.is-mobile
|
|
8
|
+
.logo-elem
|
|
9
|
+
margin-top 8px
|
|
10
|
+
margin-bottom 8px
|
|
11
|
+
.morph-shape
|
|
12
|
+
padding 6px
|
|
7
13
|
.logo-img
|
|
8
|
-
height
|
|
14
|
+
height 32px
|
|
9
15
|
.logo-img-small
|
|
10
16
|
height 20px
|
|
@@ -111,13 +111,19 @@ export default auto(function CmdHistory (props) {
|
|
|
111
111
|
}
|
|
112
112
|
return (
|
|
113
113
|
<div className='cmd-history-header pd2b'>
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
114
|
+
<div className='cmd-history-sort'>
|
|
115
|
+
<Switch
|
|
116
|
+
checked={sortByFrequency}
|
|
117
|
+
onChange={handleSortByFrequencyChange}
|
|
118
|
+
size='small'
|
|
119
|
+
/>
|
|
120
|
+
<span
|
|
121
|
+
className='cmd-history-sort-label pointer'
|
|
122
|
+
onClick={() => handleSortByFrequencyChange(!sortByFrequency)}
|
|
123
|
+
>
|
|
124
|
+
{e('sortByFrequency')}
|
|
125
|
+
</span>
|
|
126
|
+
</div>
|
|
121
127
|
<UnorderedListOutlined
|
|
122
128
|
className='cmd-history-clear-icon pointer clear-ai-icon icon-hover'
|
|
123
129
|
title={e('clear')}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* quick commands footer selection wrap
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { useState
|
|
5
|
+
import { useState } from 'react'
|
|
6
6
|
import { quickCommandLabelsLsKey, pinnedQuickCommandBarKey } from '../../common/constants'
|
|
7
7
|
import { sortBy } from 'lodash-es'
|
|
8
8
|
import { Button, Input, Select, Space, Flex } from 'antd'
|
|
@@ -25,21 +25,6 @@ const { Option } = Select
|
|
|
25
25
|
export default function QuickCommandsFooterBox (props) {
|
|
26
26
|
const [keyword, setKeyword] = useState('')
|
|
27
27
|
const [label, setLabel] = useState(ls.getItem(quickCommandLabelsLsKey, ''))
|
|
28
|
-
const timer = useRef(null)
|
|
29
|
-
|
|
30
|
-
function handleMouseLeave () {
|
|
31
|
-
timer.current = setTimeout(() => {
|
|
32
|
-
toggle(false)
|
|
33
|
-
}, 500)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function handleMouseEnter () {
|
|
37
|
-
clearTimeout(timer.current)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function toggle (openQuickCommandBar) {
|
|
41
|
-
window.store.openQuickCommandBar = openQuickCommandBar
|
|
42
|
-
}
|
|
43
28
|
|
|
44
29
|
function handleTogglePinned () {
|
|
45
30
|
const current = !window.store.pinnedQuickCommandBar
|
|
@@ -209,9 +194,7 @@ export default function QuickCommandsFooterBox (props) {
|
|
|
209
194
|
className: 'qm-wrap-tooltip',
|
|
210
195
|
style: {
|
|
211
196
|
left: w
|
|
212
|
-
}
|
|
213
|
-
onMouseLeave: handleMouseLeave,
|
|
214
|
-
onMouseEnter: handleMouseEnter
|
|
197
|
+
}
|
|
215
198
|
}
|
|
216
199
|
return (
|
|
217
200
|
<div
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* quick commands footer selection
|
|
3
|
+
*
|
|
4
|
+
* Click to toggle the quick-command bar. Click-based so it works identically
|
|
5
|
+
* on touch (mobile) and mouse (desktop) — the old hover-to-open model was
|
|
6
|
+
* unreliable on Android, where a tap synthesizes mouseleave and cancels the
|
|
7
|
+
* open timer.
|
|
3
8
|
*/
|
|
4
9
|
|
|
5
10
|
import { PureComponent } from 'react'
|
|
@@ -7,33 +12,18 @@ import { Button } from 'antd'
|
|
|
7
12
|
import './qm.styl'
|
|
8
13
|
|
|
9
14
|
export default class QuickCommandsFooter extends PureComponent {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
handleOpen = () => {
|
|
16
|
-
this.timer = setTimeout(this.act, 500)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
act = () => {
|
|
20
|
-
window.store.openQuickCommandBar = true
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
handleMouseLeave = () => {
|
|
24
|
-
clearTimeout(this.timer)
|
|
15
|
+
handleClick = () => {
|
|
16
|
+
const { store } = window
|
|
17
|
+
store.openQuickCommandBar = !store.openQuickCommandBar
|
|
25
18
|
}
|
|
26
19
|
|
|
27
20
|
render () {
|
|
28
21
|
return (
|
|
29
|
-
<div
|
|
30
|
-
className='fleft relative quick-command-trigger-wrap'
|
|
31
|
-
onMouseEnter={this.handleOpen}
|
|
32
|
-
onMouseLeave={this.handleMouseLeave}
|
|
33
|
-
>
|
|
22
|
+
<div className='fleft relative quick-command-trigger-wrap'>
|
|
34
23
|
<Button
|
|
35
24
|
size='small'
|
|
36
25
|
type='text'
|
|
26
|
+
onClick={this.handleClick}
|
|
37
27
|
>
|
|
38
28
|
Q
|
|
39
29
|
</Button>
|
|
@@ -44,22 +44,25 @@ export default auto(function HistoryPanel (props) {
|
|
|
44
44
|
}
|
|
45
45
|
return (
|
|
46
46
|
<div className='history-header pd2x pd2b'>
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
<div className='history-sort'>
|
|
48
|
+
<Switch
|
|
49
|
+
checked={sortByFrequency}
|
|
50
|
+
onChange={handleSortByFrequencyChange}
|
|
51
|
+
size='small'
|
|
52
|
+
/>
|
|
53
|
+
<span
|
|
54
|
+
className='history-sort-label pointer'
|
|
55
|
+
onClick={() => handleSortByFrequencyChange(!sortByFrequency)}
|
|
56
|
+
>
|
|
57
|
+
{e('sortByFrequency')}
|
|
58
|
+
</span>
|
|
59
|
+
</div>
|
|
50
60
|
<UnorderedListOutlined
|
|
51
61
|
{...clearIconProps}
|
|
52
62
|
/>
|
|
53
63
|
</div>
|
|
54
64
|
)
|
|
55
65
|
}
|
|
56
|
-
const switchProps = {
|
|
57
|
-
checkedChildren: e('sortByFrequency'),
|
|
58
|
-
unCheckedChildren: e('sortByFrequency'),
|
|
59
|
-
checked: sortByFrequency,
|
|
60
|
-
onChange: handleSortByFrequencyChange,
|
|
61
|
-
size: 'small'
|
|
62
|
-
}
|
|
63
66
|
const clearIconProps = {
|
|
64
67
|
className: 'history-clear-icon pointer clear-ai-icon icon-hover',
|
|
65
68
|
title: window.translate('clear'),
|
|
@@ -51,7 +51,7 @@ export default function NoSessionPanel ({ height, onNewTab, onNewSsh, batch }) {
|
|
|
51
51
|
)}
|
|
52
52
|
<QuickConnect batch={batch} />
|
|
53
53
|
</div>
|
|
54
|
-
<div className='
|
|
54
|
+
<div className='no-session-logo'>
|
|
55
55
|
<LogoElem />
|
|
56
56
|
</div>
|
|
57
57
|
<div className='no-session-history' onClick={handleClick}>
|
|
@@ -1,28 +1,51 @@
|
|
|
1
1
|
.no-sessions
|
|
2
2
|
background var(--main)
|
|
3
3
|
text-align center
|
|
4
|
-
|
|
4
|
+
// stack buttons / logo / history; the history flexes to fill the remaining
|
|
5
|
+
// height, so the layout adapts to logo size and button wrapping without any
|
|
6
|
+
// fixed pixel offsets.
|
|
7
|
+
display flex
|
|
8
|
+
flex-direction column
|
|
5
9
|
position absolute
|
|
6
10
|
top 36px
|
|
7
11
|
left 0
|
|
8
12
|
right 0
|
|
9
13
|
bottom 0
|
|
14
|
+
padding 50px 0
|
|
10
15
|
z-index 11
|
|
11
16
|
.no-session-btns
|
|
17
|
+
flex-shrink 0
|
|
12
18
|
display flex
|
|
13
19
|
flex-wrap wrap
|
|
14
20
|
justify-content center
|
|
15
21
|
align-items center
|
|
16
22
|
gap 8px
|
|
17
23
|
padding-bottom 8px
|
|
24
|
+
.no-session-logo
|
|
25
|
+
flex-shrink 0
|
|
26
|
+
padding 32px 0
|
|
18
27
|
.no-session-history
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
flex 1
|
|
29
|
+
min-height 0
|
|
30
|
+
display flex
|
|
31
|
+
flex-direction column
|
|
32
|
+
overflow hidden
|
|
24
33
|
.sidebar-panel-history
|
|
25
|
-
|
|
34
|
+
// override the global sidebar absolute positioning (top:112px) so the
|
|
35
|
+
// history fills this flex item instead.
|
|
36
|
+
position static
|
|
37
|
+
flex 1
|
|
38
|
+
min-height 0
|
|
26
39
|
.pd2x
|
|
27
40
|
width 400px
|
|
28
|
-
margin 0 auto
|
|
41
|
+
margin 0 auto
|
|
42
|
+
.is-mobile
|
|
43
|
+
.no-sessions
|
|
44
|
+
padding 20px 0
|
|
45
|
+
.no-session-logo
|
|
46
|
+
padding 8px 0
|
|
47
|
+
.no-session-history
|
|
48
|
+
.sidebar-panel-history
|
|
49
|
+
.pd2x
|
|
50
|
+
width auto
|
|
51
|
+
max-width 400px
|
package/client/css/mobile.styl
CHANGED
|
@@ -178,12 +178,21 @@
|
|
|
178
178
|
|
|
179
179
|
// ---------------------------------------------------------------------------
|
|
180
180
|
// Touch-primary devices only (feature-detected via pointer media query, not
|
|
181
|
-
// UA sniffing or viewport width).
|
|
182
|
-
//
|
|
183
|
-
//
|
|
184
|
-
//
|
|
185
|
-
//
|
|
186
|
-
//
|
|
181
|
+
// UA sniffing or viewport width). Desktop browsers (even with touchscreens or
|
|
182
|
+
// narrow windows) report pointer: fine, so this never matches them.
|
|
183
|
+
//
|
|
184
|
+
// 1. iOS Safari and Android Chrome auto-zoom the page when focusing an input
|
|
185
|
+
// with font-size < 16px, and never zoom back out on blur, leaving the page
|
|
186
|
+
// stuck zoomed. Force 16px on all focusable form fields (antd inputs default
|
|
187
|
+
// to 14px) to prevent the zoom.
|
|
188
|
+
//
|
|
189
|
+
// 2. Mobile browsers also inflate text to improve readability
|
|
190
|
+
// (-webkit-text-size-adjust defaults to auto). Inside a fixed-size container
|
|
191
|
+
// this makes the text taller than its wrapper, so it gets clipped — the
|
|
192
|
+
// clearest victim is the antd small Switch, whose track is only 16px tall /
|
|
193
|
+
// 28px wide with overflow:hidden; the "sort by frequency" label gets blown
|
|
194
|
+
// past the track and chopped. Pin to 100% so the declared font-size is
|
|
195
|
+
// honored.
|
|
187
196
|
// ---------------------------------------------------------------------------
|
|
188
197
|
@media (pointer: coarse)
|
|
189
198
|
input,
|
|
@@ -194,3 +203,6 @@
|
|
|
194
203
|
.ant-input-number-input,
|
|
195
204
|
.ant-select-selection-search-input
|
|
196
205
|
font-size 16px !important
|
|
206
|
+
html
|
|
207
|
+
-webkit-text-size-adjust 100%
|
|
208
|
+
text-size-adjust 100%
|