File tree Expand file tree Collapse file tree 4 files changed +33
-2
lines changed Expand file tree Collapse file tree 4 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -339,7 +339,7 @@ button.small .icon {
339
339
}
340
340
341
341
# panel # drag-handle {
342
- width : 100 % ;
342
+ flex-grow : 2 ;
343
343
height : 100% ;
344
344
cursor : grab;
345
345
}
@@ -359,6 +359,19 @@ button.small .icon {
359
359
background : # 008184 ;
360
360
}
361
361
362
+ .panel-bar # connection-status {
363
+ display : flex;
364
+ align-items : center;
365
+ gap : 10px ;
366
+ color : white;
367
+ }
368
+
369
+ .panel-bar # connection-status img {
370
+ width : 1.25em ;
371
+ height : 1.25em ;
372
+ filter : invert (1 );
373
+ }
374
+
362
375
.panel-bar .term-operations {
363
376
transition : opacity 0.15s ;
364
377
display : flex;
Original file line number Diff line number Diff line change @@ -213,6 +213,20 @@ async function store(state, emitter) {
213
213
emitter . emit ( 'render' )
214
214
} )
215
215
216
+ emitter . on ( 'connect' , async ( ) => {
217
+ try {
218
+ state . availablePorts = await getAvailablePorts ( )
219
+ } catch ( e ) {
220
+ console . error ( 'Could not get available ports. ' , e )
221
+ }
222
+
223
+ if ( state . availablePorts . length == 1 ) {
224
+ emitter . emit ( 'select-port' , state . availablePorts [ 0 ] )
225
+ } else {
226
+ emitter . emit ( 'open-connection-dialog' )
227
+ }
228
+ } )
229
+
216
230
// CODE EXECUTION
217
231
emitter . on ( 'run' , async ( onlySelected = false ) => {
218
232
log ( 'run' )
Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ function ReplPanel(state, emit) {
18
18
return html `
19
19
< div id ="panel " style ="height: ${ state . panelHeight } px ">
20
20
< div class ="panel-bar ">
21
+ < div id ="connection-status " style ="visibility:${ state . isConnected ? 'visible' : 'hidden' } ; ">
22
+ < img src ="media/connect.svg " />
23
+ < div > ${ state . isConnected ? 'Connected to ' + state . connectedPort : '' } </ div >
24
+ </ div >
21
25
< div id ="drag-handle "
22
26
onmousedown =${ ( ) => emit ( 'start-resizing-panel' ) }
23
27
onmouseup =${ ( ) => emit ( 'stop-resizing-panel' ) }
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ function Toolbar(state, emit) {
18
18
icon : state . isConnected ? 'connect.svg' : 'disconnect.svg' ,
19
19
label : state . isConnected ? 'Disconnect' : 'Connect' ,
20
20
tooltip : state . isConnected ? `Disconnect (${ metaKeyString } +Shift+D)` : `Connect (${ metaKeyString } +Shift+C)` ,
21
- onClick : ( ) => state . isConnected ? emit ( 'disconnect' ) : emit ( 'open-connection-dialog ' ) ,
21
+ onClick : ( ) => state . isConnected ? emit ( 'disconnect' ) : emit ( 'connect ' ) ,
22
22
active : state . isConnected ,
23
23
first : true
24
24
} ) }
You can’t perform that action at this time.
0 commit comments