remove dead group stats and dashboard wrapper
Some checks failed
CI / test (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Security Scan / backend-security (push) Has been cancelled
Security Scan / frontend-security (push) Has been cancelled

This commit is contained in:
2026-04-21 09:23:34 +08:00
parent 7bf0ed8681
commit 7d1d185a2f
3 changed files with 11 additions and 57 deletions

View File

@@ -16,15 +16,6 @@ import type {
UsageRequestType
} from '@/types'
/**
* Get dashboard statistics
* @returns Dashboard statistics including users, keys, accounts, and token usage
*/
export async function getStats(): Promise<DashboardStats> {
const { data } = await apiClient.get<DashboardStats>('/admin/dashboard/stats')
return data
}
export interface TrendParams {
start_date?: string
end_date?: string
@@ -297,7 +288,6 @@ export async function getBatchApiKeysUsage(
}
export const dashboardAPI = {
getStats,
getUsageTrend,
getModelStats,
getGroupStats,

View File

@@ -3,7 +3,7 @@ import { flushPromises, mount } from '@vue/test-utils'
import UsageView from '../UsageView.vue'
const { list, getStats, getSnapshotV2, getById } = vi.hoisted(() => {
const { list, getStats, getSnapshotV2, getModelStats, getById } = vi.hoisted(() => {
vi.stubGlobal('localStorage', {
getItem: vi.fn(() => null),
setItem: vi.fn(),
@@ -14,6 +14,7 @@ const { list, getStats, getSnapshotV2, getById } = vi.hoisted(() => {
list: vi.fn(),
getStats: vi.fn(),
getSnapshotV2: vi.fn(),
getModelStats: vi.fn(),
getById: vi.fn(),
}
})
@@ -40,6 +41,7 @@ vi.mock('@/api/admin', () => ({
},
dashboard: {
getSnapshotV2,
getModelStats,
},
users: {
getById,
@@ -111,6 +113,7 @@ describe('admin UsageView distribution metric toggles', () => {
list.mockReset()
getStats.mockReset()
getSnapshotV2.mockReset()
getModelStats.mockReset()
getById.mockReset()
list.mockResolvedValue({
@@ -133,6 +136,11 @@ describe('admin UsageView distribution metric toggles', () => {
models: [],
groups: [],
})
getModelStats.mockResolvedValue({
models: [],
start_date: '2026-04-19',
end_date: '2026-04-20',
})
})
afterEach(() => {