remove dead group stats and dashboard wrapper
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user