11<script lang =" ts" >
2- import { faPlay , faRotateRight , faStop , faTrash } from ' @fortawesome/free-solid-svg-icons' ;
2+ import { faEdit , faPlay , faRotateRight , faStop , faTrash } from ' @fortawesome/free-solid-svg-icons' ;
33import type {
44 ProviderContainerConnectionInfo ,
55 ProviderInfo ,
@@ -8,6 +8,8 @@ import type {
88import LoadingIconButton from ' ../ui/LoadingIconButton.svelte' ;
99import { type ConnectionCallback , eventCollect , startTask } from ' ./preferences-connection-rendering-task' ;
1010import { type IConnectionRestart , type IConnectionStatus } from ' ./Util' ;
11+ import { router } from ' tinro' ;
12+ import { Buffer } from ' buffer' ;
1113
1214export let connectionStatus: IConnectionStatus | undefined ;
1315export let provider: ProviderInfo ;
@@ -97,6 +99,17 @@ async function stopConnectionProvider(
9799 }
98100}
99101
102+ async function editConnectionProvider(
103+ provider : ProviderInfo ,
104+ providerConnectionInfo : ProviderContainerConnectionInfo | ProviderKubernetesConnectionInfo ,
105+ ): Promise <void > {
106+ router .goto (
107+ ` /preferences/container-connection/edit/${provider .internalId }/${Buffer .from (providerConnectionInfo .name ).toString (
108+ ' base64' ,
109+ )} ` ,
110+ );
111+ }
112+
100113async function deleteConnectionProvider(
101114 provider : ProviderInfo ,
102115 providerConnectionInfo : ProviderContainerConnectionInfo | ProviderKubernetesConnectionInfo ,
@@ -169,6 +182,14 @@ function getLoggerHandler(
169182 state =" {connectionStatus }"
170183 leftPosition =" left-[0.22rem]" />
171184 {/if }
185+ {#if connection .lifecycleMethods .includes (' edit' )}
186+ <LoadingIconButton
187+ clickAction =" {() => editConnectionProvider (provider , connection )}"
188+ action =" edit"
189+ icon =" {faEdit }"
190+ state =" {connectionStatus }"
191+ leftPosition =" left-[0.22rem]" />
192+ {/if }
172193 {#if connection .lifecycleMethods .includes (' delete' )}
173194 <div class =" mr-2 text-sm" >
174195 <LoadingIconButton
0 commit comments