mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 21:17:30 +00:00
Revert "Merge pull request #424 from Wangnov/feat/i18n"
This reverts commit1d915d8327, reversing changes made to009f7c84f6.
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
]"
|
||||
@click="handleTabChange('overview')"
|
||||
>
|
||||
{{ t('user.dashboard.overview') }}
|
||||
Overview
|
||||
</button>
|
||||
<button
|
||||
:class="[
|
||||
@@ -43,7 +43,7 @@
|
||||
]"
|
||||
@click="handleTabChange('api-keys')"
|
||||
>
|
||||
{{ t('user.dashboard.apiKeys') }}
|
||||
API Keys
|
||||
</button>
|
||||
<button
|
||||
:class="[
|
||||
@@ -54,7 +54,7 @@
|
||||
]"
|
||||
@click="handleTabChange('usage')"
|
||||
>
|
||||
{{ t('user.dashboard.usageStats') }}
|
||||
Usage Stats
|
||||
</button>
|
||||
<button
|
||||
:class="[
|
||||
@@ -72,8 +72,7 @@
|
||||
</div>
|
||||
<div class="flex items-center space-x-4">
|
||||
<div class="text-sm text-gray-700 dark:text-gray-300">
|
||||
{{ t('user.dashboard.welcome') }},
|
||||
<span class="font-medium">{{ userStore.userName }}</span>
|
||||
Welcome, <span class="font-medium">{{ userStore.userName }}</span>
|
||||
</div>
|
||||
|
||||
<!-- 主题切换按钮 -->
|
||||
@@ -83,7 +82,7 @@
|
||||
class="rounded-md px-3 py-2 text-sm font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"
|
||||
@click="handleLogout"
|
||||
>
|
||||
{{ t('user.dashboard.logout') }}
|
||||
Logout
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -95,11 +94,9 @@
|
||||
<!-- Overview Tab -->
|
||||
<div v-if="activeTab === 'overview'" class="space-y-6">
|
||||
<div>
|
||||
<h1 class="text-2xl font-semibold text-gray-900 dark:text-white">
|
||||
{{ t('user.dashboard.title') }}
|
||||
</h1>
|
||||
<h1 class="text-2xl font-semibold text-gray-900 dark:text-white">Dashboard Overview</h1>
|
||||
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">
|
||||
{{ t('user.dashboard.welcomeMessage') }}
|
||||
Welcome to your Claude Relay dashboard
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -126,7 +123,7 @@
|
||||
<div class="ml-5 w-0 flex-1">
|
||||
<dl>
|
||||
<dt class="truncate text-sm font-medium text-gray-500 dark:text-gray-400">
|
||||
{{ t('user.dashboard.activeApiKeys') }}
|
||||
Active API Keys
|
||||
</dt>
|
||||
<dd class="text-lg font-medium text-gray-900 dark:text-white">
|
||||
{{ apiKeysStats.active }}
|
||||
@@ -158,7 +155,7 @@
|
||||
<div class="ml-5 w-0 flex-1">
|
||||
<dl>
|
||||
<dt class="truncate text-sm font-medium text-gray-500 dark:text-gray-400">
|
||||
{{ t('user.dashboard.deletedApiKeys') }}
|
||||
Deleted API Keys
|
||||
</dt>
|
||||
<dd class="text-lg font-medium text-gray-900 dark:text-white">
|
||||
{{ apiKeysStats.deleted }}
|
||||
@@ -190,7 +187,7 @@
|
||||
<div class="ml-5 w-0 flex-1">
|
||||
<dl>
|
||||
<dt class="truncate text-sm font-medium text-gray-500 dark:text-gray-400">
|
||||
{{ t('user.dashboard.totalRequests') }}
|
||||
Total Requests
|
||||
</dt>
|
||||
<dd class="text-lg font-medium text-gray-900 dark:text-white">
|
||||
{{ formatNumber(userProfile?.totalUsage?.requests || 0) }}
|
||||
@@ -222,7 +219,7 @@
|
||||
<div class="ml-5 w-0 flex-1">
|
||||
<dl>
|
||||
<dt class="truncate text-sm font-medium text-gray-500 dark:text-gray-400">
|
||||
{{ t('user.dashboard.inputTokens') }}
|
||||
Input Tokens
|
||||
</dt>
|
||||
<dd class="text-lg font-medium text-gray-900 dark:text-white">
|
||||
{{ formatNumber(userProfile?.totalUsage?.inputTokens || 0) }}
|
||||
@@ -254,7 +251,7 @@
|
||||
<div class="ml-5 w-0 flex-1">
|
||||
<dl>
|
||||
<dt class="truncate text-sm font-medium text-gray-500 dark:text-gray-400">
|
||||
{{ t('user.dashboard.totalCost') }}
|
||||
Total Cost
|
||||
</dt>
|
||||
<dd class="text-lg font-medium text-gray-900 dark:text-white">
|
||||
${{ (userProfile?.totalUsage?.totalCost || 0).toFixed(4) }}
|
||||
@@ -270,38 +267,30 @@
|
||||
<div class="rounded-lg bg-white shadow dark:bg-gray-800">
|
||||
<div class="px-4 py-5 sm:p-6">
|
||||
<h3 class="text-lg font-medium leading-6 text-gray-900 dark:text-white">
|
||||
{{ t('user.dashboard.accountInformation') }}
|
||||
Account Information
|
||||
</h3>
|
||||
<div class="mt-5 border-t border-gray-200 dark:border-gray-700">
|
||||
<dl class="divide-y divide-gray-200 dark:divide-gray-700">
|
||||
<div class="py-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:py-5">
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">
|
||||
{{ t('user.dashboard.username') }}
|
||||
</dt>
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Username</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 dark:text-white sm:col-span-2 sm:mt-0">
|
||||
{{ userProfile?.username }}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="py-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:py-5">
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">
|
||||
{{ t('user.dashboard.displayName') }}
|
||||
</dt>
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Display Name</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 dark:text-white sm:col-span-2 sm:mt-0">
|
||||
{{ userProfile?.displayName || t('user.dashboard.notAvailable') }}
|
||||
{{ userProfile?.displayName || 'N/A' }}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="py-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:py-5">
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">
|
||||
{{ t('user.dashboard.email') }}
|
||||
</dt>
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Email</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 dark:text-white sm:col-span-2 sm:mt-0">
|
||||
{{ userProfile?.email || t('user.dashboard.notAvailable') }}
|
||||
{{ userProfile?.email || 'N/A' }}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="py-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:py-5">
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">
|
||||
{{ t('user.dashboard.role') }}
|
||||
</dt>
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Role</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 dark:text-white sm:col-span-2 sm:mt-0">
|
||||
<span
|
||||
class="inline-flex items-center rounded-full bg-blue-100 px-2.5 py-0.5 text-xs font-medium text-blue-800 dark:bg-blue-900 dark:text-blue-200"
|
||||
@@ -311,19 +300,15 @@
|
||||
</dd>
|
||||
</div>
|
||||
<div class="py-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:py-5">
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">
|
||||
{{ t('user.dashboard.memberSince') }}
|
||||
</dt>
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Member Since</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 dark:text-white sm:col-span-2 sm:mt-0">
|
||||
{{ formatDate(userProfile?.createdAt) }}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="py-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:py-5">
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">
|
||||
{{ t('user.dashboard.lastLogin') }}
|
||||
</dt>
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Last Login</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 dark:text-white sm:col-span-2 sm:mt-0">
|
||||
{{ formatDate(userProfile?.lastLoginAt) || t('user.dashboard.notAvailable') }}
|
||||
{{ formatDate(userProfile?.lastLoginAt) || 'N/A' }}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
@@ -353,7 +338,6 @@
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
import { useThemeStore } from '@/stores/theme'
|
||||
import { showToast } from '@/utils/toast'
|
||||
@@ -363,7 +347,6 @@ import UserUsageStats from '@/components/user/UserUsageStats.vue'
|
||||
import TutorialView from '@/views/TutorialView.vue'
|
||||
|
||||
const router = useRouter()
|
||||
const { t } = useI18n()
|
||||
const userStore = useUserStore()
|
||||
const themeStore = useThemeStore()
|
||||
|
||||
@@ -402,11 +385,11 @@ const handleTabChange = (tab) => {
|
||||
const handleLogout = async () => {
|
||||
try {
|
||||
await userStore.logout()
|
||||
showToast(t('user.dashboard.logoutSuccess'), 'success')
|
||||
showToast('Logged out successfully', 'success')
|
||||
router.push('/user-login')
|
||||
} catch (error) {
|
||||
console.error('Logout error:', error)
|
||||
showToast(t('user.dashboard.logoutFailed'), 'error')
|
||||
showToast('Logout failed', 'error')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -415,7 +398,7 @@ const loadUserProfile = async () => {
|
||||
userProfile.value = await userStore.getUserProfile()
|
||||
} catch (error) {
|
||||
console.error('Failed to load user profile:', error)
|
||||
showToast(t('user.dashboard.loadProfileFailed'), 'error')
|
||||
showToast('Failed to load user profile', 'error')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user