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:
@@ -12,6 +12,7 @@
|
||||
import EmptyState from '$lib/components/EmptyState.svelte';
|
||||
import ConfirmModal from '$lib/components/ConfirmModal.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';
|
||||
@@ -50,6 +51,9 @@
|
||||
// Provider capabilities
|
||||
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,
|
||||
})));
|
||||
let commandSlots = $derived<SlotDef[]>(
|
||||
allCapabilities[form.provider_type]?.command_slots || []
|
||||
);
|
||||
@@ -231,13 +235,8 @@
|
||||
|
||||
{#if !editing}
|
||||
<div>
|
||||
<label for="ct-provider" class="block text-sm font-medium mb-1">{t('templateConfig.providerType')}</label>
|
||||
<select id="ct-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