feat: complete kiro platform support

This commit is contained in:
nianzs
2026-04-29 18:20:46 +08:00
parent fcaa8ea86a
commit b09bcb6a3c
39 changed files with 2063 additions and 164 deletions
+8 -4
View File
@@ -324,8 +324,8 @@
</div>
</div>
<!-- Web Search Emulation (Anthropic only, hidden when global disabled) -->
<div v-if="section.platform === 'anthropic' && webSearchGlobalEnabled" class="border-t border-gray-200 pt-3 dark:border-dark-600">
<!-- Web Search Emulation (supported platforms only, hidden when global disabled) -->
<div v-if="supportsWebSearchEmulation(section.platform) && webSearchGlobalEnabled" class="border-t border-gray-200 pt-3 dark:border-dark-600">
<div class="flex items-center justify-between">
<div>
<label class="text-xs font-medium text-gray-700 dark:text-gray-300">
@@ -718,7 +718,7 @@ const form = reactive({
let abortController: AbortController | null = null
// ── Platform config ──
const platformOrder: GroupPlatform[] = ['anthropic', 'openai', 'gemini', 'antigravity']
const platformOrder: GroupPlatform[] = ['anthropic', 'openai', 'gemini', 'antigravity', 'kiro']
// ── Helpers ──
function formatDate(value: string): string {
@@ -758,6 +758,10 @@ function getGroupsForPlatform(platform: GroupPlatform): AdminGroup[] {
return allGroups.value.filter(g => g.platform === platform)
}
function supportsWebSearchEmulation(platform: GroupPlatform): boolean {
return platform === 'anthropic' || platform === 'kiro'
}
// ── Group helpers ──
const groupToChannelMap = computed(() => {
const map = new Map<number, Channel>()
@@ -1037,7 +1041,7 @@ function formToAPI(): { group_ids: number[], model_pricing: ChannelModelPricing[
const wsEmulation: Record<string, boolean> = {}
for (const section of form.platforms) {
if (!section.enabled) continue
if (section.platform === 'anthropic') {
if (supportsWebSearchEmulation(section.platform)) {
wsEmulation[section.platform] = !!section.web_search_emulation
}
}
@@ -967,7 +967,8 @@ const platformFilterOptions = computed(() => [
{ value: 'anthropic', label: 'Anthropic' },
{ value: 'openai', label: 'OpenAI' },
{ value: 'gemini', label: 'Gemini' },
{ value: 'antigravity', label: 'Antigravity' }
{ value: 'antigravity', label: 'Antigravity' },
{ value: 'kiro', label: 'Kiro' }
])
// Group options for assign (only subscription type groups)
@@ -111,7 +111,8 @@ const platformOptions = computed(() => [
{ value: 'openai', label: 'OpenAI' },
{ value: 'anthropic', label: 'Anthropic' },
{ value: 'gemini', label: 'Gemini' },
{ value: 'antigravity', label: 'Antigravity' }
{ value: 'antigravity', label: 'Antigravity' },
{ value: 'kiro', label: 'Kiro' }
])
const timeRangeOptions = computed(() => [