-
Notifications
You must be signed in to change notification settings - Fork 268
/
PreferencesKubernetesConnectionDetailsSummary.svelte
56 lines (52 loc) · 2.36 KB
/
PreferencesKubernetesConnectionDetailsSummary.svelte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<script lang="ts">
import type { KubernetesProviderConnection } from '@podman-desktop/api';
import type { ProviderKubernetesConnectionInfo } from '../../../../main/src/plugin/api/provider-info';
import type { IConfigurationPropertyRecordedSchema } from '../../../../main/src/plugin/configuration-registry';
import type { IProviderConnectionConfigurationPropertyRecorded } from './Util';
export let properties: IConfigurationPropertyRecordedSchema[] = [];
export let providerInternalId: string | undefined = undefined;
export let kubernetesConnectionInfo: ProviderKubernetesConnectionInfo | undefined = undefined;
let tmpProviderContainerConfiguration: IProviderConnectionConfigurationPropertyRecorded[] = [];
$: Promise.all(
properties.map(async configurationKey => {
return {
...configurationKey,
value: configurationKey.id
? await window.getConfigurationValue(
configurationKey.id,
kubernetesConnectionInfo as unknown as KubernetesProviderConnection,
)
: undefined,
connection: kubernetesConnectionInfo?.name || '',
providerId: providerInternalId || '',
};
}),
).then(value => (tmpProviderContainerConfiguration = value.flat()));
$: providerConnectionConfiguration = tmpProviderContainerConfiguration.filter(
configurationKey => configurationKey.value !== undefined,
);
</script>
<div class="h-full bg-zinc-900">
{#if kubernetesConnectionInfo}
<div class="flex pl-8 py-4 flex-col w-full text-sm">
<div class="flex flex-row mt-5">
<span class="font-semibold min-w-[150px]">Name</span>
<span aria-label="{kubernetesConnectionInfo.name}">{kubernetesConnectionInfo.name}</span>
</div>
{#each providerConnectionConfiguration as connectionSetting}
<div class="flex flex-row mt-5">
<span class="font-semibold min-w-[150px]">{connectionSetting.description}</span>
<span>{connectionSetting.value}</span>
</div>
{/each}
<div class="flex flex-row mt-5">
<span class="font-semibold min-w-[150px]">Type</span>
<span aria-label="kubernetes">Kubernetes</span>
</div>
<div class="flex flex-row mt-5">
<span class="font-semibold min-w-[150px]">Endpoint</span>
<span aria-label="{kubernetesConnectionInfo.endpoint.apiURL}">{kubernetesConnectionInfo.endpoint.apiURL}</span>
</div>
</div>
{/if}
</div>