mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 21:17:30 +00:00
feat: 完成web/admin-spa/src/components/apikeys的国际化并修复语法错误和警告
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -11,7 +11,9 @@
|
||||
>
|
||||
<i class="fas fa-layer-group text-sm text-white sm:text-base" />
|
||||
</div>
|
||||
<h3 class="text-lg font-bold text-gray-900 sm:text-xl">{{ t('groupManagement.title') }}</h3>
|
||||
<h3 class="text-lg font-bold text-gray-900 sm:text-xl">
|
||||
{{ t('groupManagement.title') }}
|
||||
</h3>
|
||||
</div>
|
||||
<button
|
||||
class="p-1 text-gray-400 transition-colors hover:text-gray-600"
|
||||
@@ -31,10 +33,14 @@
|
||||
|
||||
<!-- 创建分组表单 -->
|
||||
<div v-if="showCreateForm" class="mb-6 rounded-lg border border-blue-200 bg-blue-50 p-4">
|
||||
<h4 class="mb-4 text-lg font-semibold text-gray-900">{{ t('groupManagement.createGroup') }}</h4>
|
||||
<h4 class="mb-4 text-lg font-semibold text-gray-900">
|
||||
{{ t('groupManagement.createGroup') }}
|
||||
</h4>
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label class="mb-2 block text-sm font-semibold text-gray-700">{{ t('groupManagement.groupNameRequired') }}</label>
|
||||
<label class="mb-2 block text-sm font-semibold text-gray-700">{{
|
||||
t('groupManagement.groupNameRequired')
|
||||
}}</label>
|
||||
<input
|
||||
v-model="createForm.name"
|
||||
class="form-input w-full"
|
||||
@@ -44,7 +50,9 @@
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="mb-2 block text-sm font-semibold text-gray-700">{{ t('groupManagement.platformTypeRequired') }}</label>
|
||||
<label class="mb-2 block text-sm font-semibold text-gray-700">{{
|
||||
t('groupManagement.platformTypeRequired')
|
||||
}}</label>
|
||||
<div class="flex gap-4">
|
||||
<label class="flex cursor-pointer items-center">
|
||||
<input v-model="createForm.platform" class="mr-2" type="radio" value="claude" />
|
||||
@@ -62,7 +70,9 @@
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="mb-2 block text-sm font-semibold text-gray-700">{{ t('groupManagement.descriptionOptional') }}</label>
|
||||
<label class="mb-2 block text-sm font-semibold text-gray-700">{{
|
||||
t('groupManagement.descriptionOptional')
|
||||
}}</label>
|
||||
<textarea
|
||||
v-model="createForm.description"
|
||||
class="form-input w-full resize-none"
|
||||
@@ -80,7 +90,9 @@
|
||||
<div v-if="creating" class="loading-spinner mr-2" />
|
||||
{{ creating ? t('groupManagement.creating') : t('groupManagement.create') }}
|
||||
</button>
|
||||
<button class="btn btn-secondary px-4 py-2" @click="cancelCreate">{{ t('groupManagement.cancel') }}</button>
|
||||
<button class="btn btn-secondary px-4 py-2" @click="cancelCreate">
|
||||
{{ t('groupManagement.cancel') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -184,7 +196,9 @@
|
||||
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label class="mb-2 block text-sm font-semibold text-gray-700">{{ t('groupManagement.groupNameRequired') }}</label>
|
||||
<label class="mb-2 block text-sm font-semibold text-gray-700">{{
|
||||
t('groupManagement.groupNameRequired')
|
||||
}}</label>
|
||||
<input
|
||||
v-model="editForm.name"
|
||||
class="form-input w-full"
|
||||
@@ -194,7 +208,9 @@
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="mb-2 block text-sm font-semibold text-gray-700">{{ t('groupManagement.platformTypeLabel') }}</label>
|
||||
<label class="mb-2 block text-sm font-semibold text-gray-700">{{
|
||||
t('groupManagement.platformTypeLabel')
|
||||
}}</label>
|
||||
<div class="rounded-lg bg-gray-100 px-3 py-2 text-sm text-gray-600">
|
||||
{{
|
||||
editForm.platform === 'claude'
|
||||
@@ -203,12 +219,16 @@
|
||||
? 'Gemini'
|
||||
: 'OpenAI'
|
||||
}}
|
||||
<span class="ml-2 text-xs text-gray-500">{{ t('groupManagement.cannotModify') }}</span>
|
||||
<span class="ml-2 text-xs text-gray-500">{{
|
||||
t('groupManagement.cannotModify')
|
||||
}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="mb-2 block text-sm font-semibold text-gray-700">{{ t('groupManagement.descriptionOptional') }}</label>
|
||||
<label class="mb-2 block text-sm font-semibold text-gray-700">{{
|
||||
t('groupManagement.descriptionOptional')
|
||||
}}</label>
|
||||
<textarea
|
||||
v-model="editForm.description"
|
||||
class="form-input w-full resize-none"
|
||||
@@ -226,7 +246,9 @@
|
||||
<div v-if="updating" class="loading-spinner mr-2" />
|
||||
{{ updating ? t('groupManagement.updating') : t('groupManagement.update') }}
|
||||
</button>
|
||||
<button class="btn btn-secondary flex-1 px-4 py-2" @click="cancelEdit">{{ t('groupManagement.cancel') }}</button>
|
||||
<button class="btn btn-secondary flex-1 px-4 py-2" @click="cancelEdit">
|
||||
{{ t('groupManagement.cancel') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
<i class="fas fa-link text-white" />
|
||||
</div>
|
||||
<div class="flex-1">
|
||||
<h4 class="mb-3 font-semibold text-blue-900 dark:text-blue-200">{{ t('oauthFlow.claudeAccountAuth') }}</h4>
|
||||
<h4 class="mb-3 font-semibold text-blue-900 dark:text-blue-200">
|
||||
{{ t('oauthFlow.claudeAccountAuth') }}
|
||||
</h4>
|
||||
<p class="mb-4 text-sm text-blue-800 dark:text-blue-300">
|
||||
{{ t('oauthFlow.claudeAuthDescription') }}
|
||||
</p>
|
||||
@@ -115,14 +117,17 @@
|
||||
</p>
|
||||
<p class="mb-3 text-sm text-blue-700 dark:text-blue-300">
|
||||
{{ t('oauthFlow.step3Description') }}
|
||||
<strong>{{ t('oauthFlow.authorizationCode') }}</strong>{{ t('oauthFlow.step3DescriptionMiddle') }}
|
||||
<strong>{{ t('oauthFlow.authorizationCode') }}</strong
|
||||
>{{ t('oauthFlow.step3DescriptionMiddle') }}
|
||||
</p>
|
||||
<div class="space-y-3">
|
||||
<div>
|
||||
<label
|
||||
class="mb-2 block text-sm font-semibold text-gray-700 dark:text-gray-300"
|
||||
>
|
||||
<i class="fas fa-key mr-2 text-blue-500" />{{ t('oauthFlow.authorizationCode') }}
|
||||
<i class="fas fa-key mr-2 text-blue-500" />{{
|
||||
t('oauthFlow.authorizationCode')
|
||||
}}
|
||||
</label>
|
||||
<textarea
|
||||
v-model="authCode"
|
||||
@@ -157,7 +162,9 @@
|
||||
<i class="fas fa-robot text-white" />
|
||||
</div>
|
||||
<div class="flex-1">
|
||||
<h4 class="mb-3 font-semibold text-green-900 dark:text-green-200">{{ t('oauthFlow.geminiAccountAuth') }}</h4>
|
||||
<h4 class="mb-3 font-semibold text-green-900 dark:text-green-200">
|
||||
{{ t('oauthFlow.geminiAccountAuth') }}
|
||||
</h4>
|
||||
<p class="mb-4 text-sm text-green-800 dark:text-green-300">
|
||||
{{ t('oauthFlow.geminiAuthDescription') }}
|
||||
</p>
|
||||
@@ -266,7 +273,9 @@
|
||||
<label
|
||||
class="mb-2 block text-sm font-semibold text-gray-700 dark:text-gray-300"
|
||||
>
|
||||
<i class="fas fa-key mr-2 text-green-500" />{{ t('oauthFlow.authorizationCode') }}
|
||||
<i class="fas fa-key mr-2 text-green-500" />{{
|
||||
t('oauthFlow.authorizationCode')
|
||||
}}
|
||||
</label>
|
||||
<textarea
|
||||
v-model="authCode"
|
||||
@@ -303,7 +312,9 @@
|
||||
<i class="fas fa-brain text-white" />
|
||||
</div>
|
||||
<div class="flex-1">
|
||||
<h4 class="mb-3 font-semibold text-orange-900 dark:text-orange-200">{{ t('oauthFlow.openaiAccountAuth') }}</h4>
|
||||
<h4 class="mb-3 font-semibold text-orange-900 dark:text-orange-200">
|
||||
{{ t('oauthFlow.openaiAccountAuth') }}
|
||||
</h4>
|
||||
<p class="mb-4 text-sm text-orange-800 dark:text-orange-300">
|
||||
{{ t('oauthFlow.openaiAuthDescription') }}
|
||||
</p>
|
||||
@@ -382,7 +393,8 @@
|
||||
>
|
||||
<p class="text-xs text-amber-800 dark:text-amber-300">
|
||||
<i class="fas fa-clock mr-1" />
|
||||
<strong>{{ t('oauthFlow.openaiImportantNote') }}</strong>{{ t('oauthFlow.openaiLoadingNote') }}
|
||||
<strong>{{ t('oauthFlow.openaiImportantNote') }}</strong
|
||||
>{{ t('oauthFlow.openaiLoadingNote') }}
|
||||
</p>
|
||||
<p class="mt-2 text-xs text-amber-700 dark:text-amber-400">
|
||||
{{ t('oauthFlow.openaiAddressNote') }}
|
||||
@@ -419,14 +431,17 @@
|
||||
</p>
|
||||
<p class="mb-3 text-sm text-orange-700 dark:text-orange-300">
|
||||
{{ t('oauthFlow.step3DescriptionOpenAI') }}
|
||||
<strong class="font-mono">http://localhost:1455/...</strong> {{ t('oauthFlow.step3DescriptionOpenAIMiddle') }}
|
||||
<strong class="font-mono">http://localhost:1455/...</strong>
|
||||
{{ t('oauthFlow.step3DescriptionOpenAIMiddle') }}
|
||||
</p>
|
||||
<div class="space-y-3">
|
||||
<div>
|
||||
<label
|
||||
class="mb-2 block text-sm font-semibold text-gray-700 dark:text-gray-300"
|
||||
>
|
||||
<i class="fas fa-link mr-2 text-orange-500" />{{ t('oauthFlow.authLinkOrCode') }}
|
||||
<i class="fas fa-link mr-2 text-orange-500" />{{
|
||||
t('oauthFlow.authLinkOrCode')
|
||||
}}
|
||||
</label>
|
||||
<textarea
|
||||
v-model="authCode"
|
||||
@@ -440,17 +455,18 @@
|
||||
>
|
||||
<p class="text-xs text-blue-700 dark:text-blue-300">
|
||||
<i class="fas fa-lightbulb mr-1" />
|
||||
<strong>{{ t('oauthFlow.openaiTip') }}</strong>{{ t('oauthFlow.openaiTipText') }}
|
||||
<strong>{{ t('oauthFlow.openaiTip') }}</strong
|
||||
>{{ t('oauthFlow.openaiTipText') }}
|
||||
</p>
|
||||
<p class="mt-1 text-xs text-blue-600 dark:text-blue-400">
|
||||
{{ t('oauthFlow.openaiLinkExample') }}<span class="font-mono"
|
||||
{{ t('oauthFlow.openaiLinkExample')
|
||||
}}<span class="font-mono"
|
||||
>http://localhost:1455/auth/callback?code=ac_4hm8...</span
|
||||
>
|
||||
</p>
|
||||
<p class="text-xs text-blue-600">
|
||||
{{ t('oauthFlow.openaiCodeExample') }}<span class="font-mono"
|
||||
>ac_4hm8iqmx9A2fzMy_cwye7U3W7...</span
|
||||
>
|
||||
{{ t('oauthFlow.openaiCodeExample')
|
||||
}}<span class="font-mono">ac_4hm8iqmx9A2fzMy_cwye7U3W7...</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
<template>
|
||||
<div class="space-y-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<h4 class="text-sm font-semibold text-gray-700 dark:text-gray-300">{{ t('proxyConfig.title') }}</h4>
|
||||
<h4 class="text-sm font-semibold text-gray-700 dark:text-gray-300">
|
||||
{{ t('proxyConfig.title') }}
|
||||
</h4>
|
||||
<label class="flex cursor-pointer items-center">
|
||||
<input
|
||||
v-model="proxy.enabled"
|
||||
class="h-4 w-4 rounded border-gray-300 bg-gray-100 text-blue-600 focus:ring-blue-500"
|
||||
type="checkbox"
|
||||
/>
|
||||
<span class="ml-2 text-sm text-gray-700 dark:text-gray-300">{{ t('proxyConfig.enableProxy') }}</span>
|
||||
<span class="ml-2 text-sm text-gray-700 dark:text-gray-300">{{
|
||||
t('proxyConfig.enableProxy')
|
||||
}}</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@@ -70,9 +74,9 @@
|
||||
<div class="my-3 border-t border-gray-200 dark:border-gray-600"></div>
|
||||
|
||||
<div>
|
||||
<label class="mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300"
|
||||
>{{ t('proxyConfig.proxyType') }}</label
|
||||
>
|
||||
<label class="mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300">{{
|
||||
t('proxyConfig.proxyType')
|
||||
}}</label>
|
||||
<select
|
||||
v-model="proxy.type"
|
||||
class="form-input w-full border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-200"
|
||||
@@ -85,9 +89,9 @@
|
||||
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300"
|
||||
>{{ t('proxyConfig.hostAddress') }}</label
|
||||
>
|
||||
<label class="mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300">{{
|
||||
t('proxyConfig.hostAddress')
|
||||
}}</label>
|
||||
<input
|
||||
v-model="proxy.host"
|
||||
class="form-input w-full border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-200 dark:placeholder-gray-400"
|
||||
@@ -96,9 +100,9 @@
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label class="mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300"
|
||||
>{{ t('proxyConfig.port') }}</label
|
||||
>
|
||||
<label class="mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300">{{
|
||||
t('proxyConfig.port')
|
||||
}}</label>
|
||||
<input
|
||||
v-model="proxy.port"
|
||||
class="form-input w-full border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-200 dark:placeholder-gray-400"
|
||||
@@ -126,9 +130,9 @@
|
||||
|
||||
<div v-if="showAuth" class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300"
|
||||
>{{ t('proxyConfig.username') }}</label
|
||||
>
|
||||
<label class="mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300">{{
|
||||
t('proxyConfig.username')
|
||||
}}</label>
|
||||
<input
|
||||
v-model="proxy.username"
|
||||
class="form-input w-full border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-200 dark:placeholder-gray-400"
|
||||
@@ -137,9 +141,9 @@
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label class="mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300"
|
||||
>{{ t('proxyConfig.password') }}</label
|
||||
>
|
||||
<label class="mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300">{{
|
||||
t('proxyConfig.password')
|
||||
}}</label>
|
||||
<div class="relative">
|
||||
<input
|
||||
v-model="proxy.password"
|
||||
|
||||
Reference in New Issue
Block a user