fix(web): /machine terminal visible prop, stop/restart confirmation, accurate waiting label
This commit is contained in:
@@ -235,6 +235,13 @@ export const MachineShell = () => {
|
||||
|
||||
const activeFile = activeFilePath ? files[activeFilePath] : undefined;
|
||||
const running = Boolean(status?.running);
|
||||
const starting = pendingAction === 'start' || pendingAction === 'restart';
|
||||
// The terminal only shows this while the box is not running. Distinguish a box
|
||||
// that is starting/restarting from one that is simply stopped so the label is
|
||||
// accurate instead of always claiming "Starting…".
|
||||
const terminalWaitingLabel = starting
|
||||
? 'Starting your machine…'
|
||||
: 'Machine is stopped — start it to open a terminal.';
|
||||
|
||||
return (
|
||||
<main className='space-y-6'>
|
||||
@@ -339,9 +346,10 @@ export const MachineShell = () => {
|
||||
>
|
||||
<XtermSession
|
||||
active={running}
|
||||
visible={activeTab === 'terminal'}
|
||||
tokenUrl='/api/box/terminal-token'
|
||||
sessionKey={username}
|
||||
waitingLabel='Starting your machine…'
|
||||
waitingLabel={terminalWaitingLabel}
|
||||
label='your machine'
|
||||
/>
|
||||
</TabsContent>
|
||||
|
||||
Reference in New Issue
Block a user