diff --git a/ui/arduino/main.css b/ui/arduino/main.css index cc0e95c..37fa561 100644 --- a/ui/arduino/main.css +++ b/ui/arduino/main.css @@ -273,7 +273,7 @@ button.small .icon { } #panel #drag-handle { - width: 100%; + flex-grow: 2; height: 100%; cursor: grab; } @@ -293,6 +293,19 @@ button.small .icon { background: #008184; } +.panel-bar #connection-status { + display: flex; + align-items: center; + gap: 10px; + color: white; +} + +.panel-bar #connection-status img { + width: 1.25em; + height: 1.25em; + filter: invert(1); +} + .panel-bar .term-operations { transition: opacity 0.15s; display: flex; diff --git a/ui/arduino/store.js b/ui/arduino/store.js index 09a373e..116c0dc 100644 --- a/ui/arduino/store.js +++ b/ui/arduino/store.js @@ -210,6 +210,20 @@ async function store(state, emitter) { emitter.emit('render') }) + emitter.on('connect', async () => { + try { + state.availablePorts = await getAvailablePorts() + } catch(e) { + console.error('Could not get available ports. ', e) + } + + if(state.availablePorts.length == 1) { + emitter.emit('select-port', state.availablePorts[0]) + } else { + emitter.emit('open-connection-dialog') + } + }) + // CODE EXECUTION emitter.on('run', async (onlySelected = false) => { log('run') diff --git a/ui/arduino/views/components/repl-panel.js b/ui/arduino/views/components/repl-panel.js index 3974d50..7a89fbd 100644 --- a/ui/arduino/views/components/repl-panel.js +++ b/ui/arduino/views/components/repl-panel.js @@ -13,6 +13,10 @@ function ReplPanel(state, emit) { return html`