feat(frontend): show Grok monitoring and Free plan badge

This commit is contained in:
superman2003
2026-07-14 12:24:42 +08:00
parent 0a64a6d8ce
commit d2d3fcf57b
17 changed files with 423 additions and 18 deletions
@@ -109,6 +109,8 @@ import { useI18n } from 'vue-i18n'
import type { APIMode, BodyOverrideMode, Provider } from '@/api/admin/channelMonitor'
import {
API_MODE_RESPONSES,
DEFAULT_GROK_MODEL,
PROVIDER_GROK,
PROVIDER_OPENAI,
} from '@/constants/channelMonitor'
@@ -305,11 +307,12 @@ const bodyPlaceholder = computed(() => {
}
return '{\n "model": "gpt-4o-mini",\n "instructions": "You are a health check endpoint. Reply briefly.",\n "input": "Reply with exactly: ok",\n "max_output_tokens": 20,\n "stream": false\n}'
}
if (props.provider === PROVIDER_OPENAI) {
if (props.provider === PROVIDER_OPENAI || props.provider === PROVIDER_GROK) {
if (props.bodyOverrideMode === 'merge') {
return '{\n "max_tokens": 20\n}'
}
return '{\n "model": "gpt-4o-mini",\n "messages": [{"role":"user","content":"Reply with exactly: ok"}],\n "max_tokens": 20,\n "stream": false\n}'
const model = props.provider === PROVIDER_GROK ? DEFAULT_GROK_MODEL : 'gpt-4o-mini'
return `{\n "model": "${model}",\n "messages": [{"role":"user","content":"Reply with exactly: ok"}],\n "max_tokens": 20,\n "stream": false\n}`
}
if (props.bodyOverrideMode === 'merge') {
return '{\n "system": "You are Claude Code..."\n}'