+ {@const label = terminal.name || terminal.url.replace(/^https?:\/\//, '')}
+
-
-
-
+
openInfo(terminal.url, label)} />
{/each}
{/if}
-
+
{#each systemSections as section}
{section.devices ? $i18n.t('Your devices') : $i18n.t('Terminals')}
- {#if !section.devices && $user?.role === 'admin'}
-
-
-
+ {#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')}
+
- {#if terminal.template_id || terminal.scope !== 'chat' || isSavedChatId($activeChatId)}
-
- {#if terminal.template_id}
-
-
-
- {/if}
- {#if terminal.scope !== 'chat' || isSavedChatId($activeChatId)}
-
-
-
- {/if}
-
- {/if}
+
+ {
+ restartTarget = { id: terminal.id, name: label };
+ show = false;
+ showRestart = true;
+ }
+ : null}
+ onInfo={terminal.scope !== 'chat' || isSavedChatId($activeChatId)
+ ? () => openInfo(terminal.id, label)
+ : null}
+ onSettings={canManage(terminal, manageable)
+ ? () => openTerminalDialog(terminal.id)
+ : null}
+ />
+
{/each}
- {#if !section.devices}
- {#await connections then allowed}
- {#if allowed.length}
-
- {/if}
- {/await}
- {/if}
{/each}
@@ -520,10 +484,17 @@
{#if showTerminals}
{/if}
+
+
diff --git a/src/lib/components/chat/UserTerminalsModal.svelte b/src/lib/components/chat/UserTerminalsModal.svelte
index e6cc4dd7c3..b420073a2d 100644
--- a/src/lib/components/chat/UserTerminalsModal.svelte
+++ b/src/lib/components/chat/UserTerminalsModal.svelte
@@ -1,58 +1,140 @@
-
-
- {editing
- ? $i18n.t(editing.id ? 'Configure terminal' : 'New terminal')
- : sharing
- ? `${$i18n.t('Share')} ${sharing.name}`
- : $i18n.t('Terminals')}
+
+
+ {terminalId ? name || $i18n.t('Terminal settings') : $i18n.t('New terminal')}
-
+
+ {#if terminalId && !loading}
+
(showAccess = true)}
+ />
+ {/if}
+
+
-
- {#if error}
- {error}
-
{/if}
- {#if editing}
-