feat: filter entity selectors by global provider filter

Provider selectors in notification tracker, command tracker, and actions
forms now only show providers matching the global provider type filter.
Command config selector in command trackers also filters by provider type.
This commit is contained in:
2026-03-23 21:54:13 +03:00
parent 0702ec72af
commit c451f3dd72
3 changed files with 14 additions and 6 deletions
+5 -3
View File
@@ -52,9 +52,11 @@
return caps && caps.action_types && caps.action_types.length > 0;
}));
let providerItems = $derived(actionProviders.map((p: any) => ({
value: p.id, label: p.name, icon: providerDefaultIcon(p), desc: p.type,
})));
let providerItems = $derived(actionProviders
.filter((p: any) => !globalProviderFilter.providerType || p.type === globalProviderFilter.providerType)
.map((p: any) => ({
value: p.id, label: p.name, icon: providerDefaultIcon(p), desc: p.type,
})));
// Action types for selected provider
let selectedProviderType = $derived(providers.find((p: any) => p.id === form.provider_id)?.type || '');
@@ -31,8 +31,12 @@
let providers = $derived(providersCache.items);
let commandConfigs = $derived(commandConfigsCache.items);
let telegramBots = $derived(telegramBotsCache.items);
const providerItems = $derived(providers.map(p => ({ value: p.id, label: p.name, icon: providerDefaultIcon(p), desc: p.type })));
const configItems = $derived(filteredConfigs().map((c: any) => ({ value: c.id, label: c.name, icon: c.icon || 'mdiCog', desc: c.provider_type })));
const providerItems = $derived(providers
.filter(p => !globalProviderFilter.providerType || p.type === globalProviderFilter.providerType)
.map(p => ({ value: p.id, label: p.name, icon: providerDefaultIcon(p), desc: p.type })));
const configItems = $derived(filteredConfigs()
.filter((c: any) => !globalProviderFilter.providerType || c.provider_type === globalProviderFilter.providerType)
.map((c: any) => ({ value: c.id, label: c.name, icon: c.icon || 'mdiCog', desc: c.provider_type })));
const botItems = $derived(telegramBots.map(b => ({ value: b.id, label: b.name, icon: b.icon || 'mdiRobot', desc: b.bot_username ? `@${b.bot_username}` : '' })));
let loaded = $state(false);
let showForm = $state(false);
@@ -34,7 +34,9 @@
(!effectiveProviderId || t.provider_id === effectiveProviderId)
));
let providers = $derived(providersCache.items);
const providerItems = $derived(providers.map(p => ({ value: p.id, label: p.name, icon: providerDefaultIcon(p), desc: p.type })));
const providerItems = $derived(providers
.filter(p => !globalProviderFilter.providerType || p.type === globalProviderFilter.providerType)
.map(p => ({ value: p.id, label: p.name, icon: providerDefaultIcon(p), desc: p.type })));
let targets = $derived(targetsCache.items);
let trackingConfigs = $derived(trackingConfigsCache.items);
let templateConfigs = $derived(templateConfigsCache.items);