mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 16:43:35 +00:00
Revert "feat: 完整国际化支持 - Web 管理界面多语言实现"
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<div class="relative top-20 mx-auto w-96 rounded-md border bg-white p-5 shadow-lg">
|
||||
<div class="mt-3">
|
||||
<div class="mb-4 flex items-center justify-between">
|
||||
<h3 class="text-lg font-medium text-gray-900">{{ $t('user.changeRoleModal.title') }}</h3>
|
||||
<h3 class="text-lg font-medium text-gray-900">Change User Role</h3>
|
||||
<button class="text-gray-400 hover:text-gray-600" @click="$emit('close')">
|
||||
<svg class="h-6 w-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path
|
||||
@@ -54,7 +54,7 @@
|
||||
: 'bg-blue-100 text-blue-800'
|
||||
]"
|
||||
>
|
||||
{{ $t('user.changeRoleModal.currentRole', { role: user.role }) }}
|
||||
Current: {{ user.role }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -64,9 +64,7 @@
|
||||
<!-- Role Selection -->
|
||||
<form class="space-y-4" @submit.prevent="handleSubmit">
|
||||
<div>
|
||||
<label class="mb-2 block text-sm font-medium text-gray-700">
|
||||
{{ $t('user.changeRoleModal.newRole') }}
|
||||
</label>
|
||||
<label class="mb-2 block text-sm font-medium text-gray-700"> New Role </label>
|
||||
<div class="space-y-2">
|
||||
<label class="flex items-center">
|
||||
<input
|
||||
@@ -77,12 +75,8 @@
|
||||
value="user"
|
||||
/>
|
||||
<div class="ml-3">
|
||||
<div class="text-sm font-medium text-gray-900">
|
||||
{{ $t('user.changeRoleModal.roles.user') }}
|
||||
</div>
|
||||
<div class="text-xs text-gray-500">
|
||||
{{ $t('user.changeRoleModal.roles.userDesc') }}
|
||||
</div>
|
||||
<div class="text-sm font-medium text-gray-900">User</div>
|
||||
<div class="text-xs text-gray-500">Regular user with basic permissions</div>
|
||||
</div>
|
||||
</label>
|
||||
<label class="flex items-center">
|
||||
@@ -94,12 +88,8 @@
|
||||
value="admin"
|
||||
/>
|
||||
<div class="ml-3">
|
||||
<div class="text-sm font-medium text-gray-900">
|
||||
{{ $t('user.changeRoleModal.roles.admin') }}
|
||||
</div>
|
||||
<div class="text-xs text-gray-500">
|
||||
{{ $t('user.changeRoleModal.roles.adminDesc') }}
|
||||
</div>
|
||||
<div class="text-sm font-medium text-gray-900">Administrator</div>
|
||||
<div class="text-xs text-gray-500">Full access to manage users and system</div>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
@@ -121,15 +111,15 @@
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<h3 class="text-sm font-medium text-yellow-800">
|
||||
{{ $t('user.changeRoleModal.roleChangeWarning.title') }}
|
||||
</h3>
|
||||
<h3 class="text-sm font-medium text-yellow-800">Role Change Warning</h3>
|
||||
<div class="mt-2 text-sm text-yellow-700">
|
||||
<p v-if="selectedRole === 'admin'">
|
||||
{{ $t('user.changeRoleModal.roleChangeWarning.grantAdmin') }}
|
||||
Granting admin privileges will give this user full access to the system,
|
||||
including the ability to manage other users and their API keys.
|
||||
</p>
|
||||
<p v-else>
|
||||
{{ $t('user.changeRoleModal.roleChangeWarning.removeAdmin') }}
|
||||
Removing admin privileges will restrict this user to only managing their own
|
||||
API keys and viewing their own usage statistics.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -160,7 +150,7 @@
|
||||
type="button"
|
||||
@click="$emit('close')"
|
||||
>
|
||||
{{ $t('user.changeRoleModal.cancel') }}
|
||||
Cancel
|
||||
</button>
|
||||
<button
|
||||
class="rounded-md border border-transparent bg-blue-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
@@ -188,9 +178,9 @@
|
||||
fill="currentColor"
|
||||
></path>
|
||||
</svg>
|
||||
{{ $t('user.changeRoleModal.updating') }}
|
||||
Updating...
|
||||
</span>
|
||||
<span v-else>{{ $t('user.changeRoleModal.updateRole') }}</span>
|
||||
<span v-else>Update Role</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -204,9 +194,6 @@
|
||||
import { ref, watch } from 'vue'
|
||||
import { apiClient } from '@/config/api'
|
||||
import { showToast } from '@/utils/toast'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const props = defineProps({
|
||||
show: {
|
||||
@@ -239,7 +226,7 @@ const handleSubmit = async () => {
|
||||
})
|
||||
|
||||
if (response.success) {
|
||||
showToast(t('user.changeRoleModal.roleUpdated', { role: selectedRole.value }), 'success')
|
||||
showToast(`User role updated to ${selectedRole.value}`, 'success')
|
||||
emit('updated')
|
||||
} else {
|
||||
error.value = response.message || 'Failed to update user role'
|
||||
|
||||
Reference in New Issue
Block a user