{#if disabled} {:else}
{#if directTerminals.length > 0}
{$i18n.t('Direct')}
{#each directTerminals as terminal} {@const label = terminal.name || terminal.url.replace(/^https?:\/\//, '')}
openInfo(terminal.url, label)} onFiles={() => openFiles(terminal.url, label)} />
{/each} {/if} {#each systemSections as section}
{section.devices ? $i18n.t('Your devices') : $i18n.t('Terminals')} {#if !section.devices}
{#if writable.length} {/if} {#if $user?.role === 'admin'} {/if}
{/if}
{#each section.terminals as terminal} {@const label = terminal.name || $i18n.t('Terminal')} {@const owned = canManage(terminal, manageable)} {@const reachable = terminal.scope !== 'chat' || isSavedChatId($activeChatId)}
machineStatus(terminal.id) : null} onRestart={() => confirmLifecycle(terminal.id, label, 'restart')} onStop={() => confirmLifecycle(terminal.id, label, 'stop')} onStart={() => runLifecycle(terminal.id, label, 'start')} onInfo={reachable ? () => openInfo(terminal.id, label) : null} onFiles={reachable ? () => openFiles(terminal.id, label) : null} onSettings={owned ? () => openTerminalDialog(terminal.id) : null} />
{/each} {/each}
{/if}
{#if info} {#key info} (info = null)} /> {/key} {/if} {#if folderTarget && (selectedSystemTerminal?.scope !== 'chat' || isSavedChatId(chatId))} {#key `${$user?.id}:${folderTarget.selector}:${chatId ?? ''}`} { if (isSavedChatId(chatId)) { await updateChatById(localStorage.token, chatId!, { working_directory: path }); } }} {disabled} /> {/key} {/if} {#if showTerminals} {/if} {#if files} {#key files} (files = null)} /> {/key} {/if} pending && runLifecycle(pending.id, pending.name, pending.action)} />