feat: add provider type selector to tracking-configs, use IconGridSelect everywhere
- Tracking Configs: add provider type field (was missing entirely) - All 4 config pages: provider type uses IconGridSelect during creation, shown as read-only text during editing (provider type is immutable) - Pages: tracking-configs, command-configs, template-configs, command-template-configs
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
import ConfirmModal from '$lib/components/ConfirmModal.svelte';
|
||||
import Hint from '$lib/components/Hint.svelte';
|
||||
import IconButton from '$lib/components/IconButton.svelte';
|
||||
import IconGridSelect from '$lib/components/IconGridSelect.svelte';
|
||||
import Modal from '$lib/components/Modal.svelte';
|
||||
import JinjaEditor from '$lib/components/JinjaEditor.svelte';
|
||||
import { snackSuccess, snackError } from '$lib/stores/snackbar.svelte';
|
||||
@@ -110,6 +111,9 @@
|
||||
// Provider capabilities: loaded dynamically
|
||||
let allCapabilities = $state<Record<string, any>>({});
|
||||
let providerTypes = $derived(Object.keys(allCapabilities));
|
||||
const providerTypeItems = $derived(providerTypes.map(pt => ({
|
||||
value: pt, icon: 'mdiCamera', label: allCapabilities[pt]?.display_name || pt,
|
||||
})));
|
||||
|
||||
// Dynamic slot definitions based on selected provider_type
|
||||
let notificationSlots = $derived<{name: string, description: string}[]>(
|
||||
@@ -244,13 +248,8 @@
|
||||
|
||||
{#if !editing}
|
||||
<div>
|
||||
<label for="tpc-provider" class="block text-sm font-medium mb-1">{t('templateConfig.providerType')}</label>
|
||||
<select id="tpc-provider" bind:value={form.provider_type}
|
||||
class="w-full px-3 py-2 border border-[var(--color-border)] rounded-md text-sm bg-[var(--color-background)]">
|
||||
{#each providerTypes as pt}
|
||||
<option value={pt}>{allCapabilities[pt]?.display_name || pt} ({pt})</option>
|
||||
{/each}
|
||||
</select>
|
||||
<label class="block text-sm font-medium mb-1">{t('templateConfig.providerType')}</label>
|
||||
<IconGridSelect items={providerTypeItems} bind:value={form.provider_type} columns={2} />
|
||||
</div>
|
||||
{:else}
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user