feat(frontend) : add DatabaseInfo type and service
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { DashboardResponse, EnvironmentHealth } from './dto/dashboard'
|
||||
import type { DashboardResponse, EnvironmentHealth, DatabaseInfo } from './dto/dashboard'
|
||||
|
||||
export function getDashboard(): Promise<DashboardResponse> {
|
||||
return useApi().get<DashboardResponse>('/dashboard', undefined, {
|
||||
@@ -11,3 +11,9 @@ export function getEnvironmentHealth(envId: number): Promise<EnvironmentHealth>
|
||||
toast: false,
|
||||
})
|
||||
}
|
||||
|
||||
export function getDatabaseInfo(envId: number): Promise<DatabaseInfo> {
|
||||
return useApi().get<DatabaseInfo>(`/environments/${envId}/database`, undefined, {
|
||||
toast: false,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ type Environment = {
|
||||
deployScriptPath: string
|
||||
maintenanceFilePath: string
|
||||
appUrl?: string
|
||||
databaseName?: string
|
||||
logFiles: LogFile[]
|
||||
maintenance: boolean
|
||||
}
|
||||
@@ -22,6 +23,7 @@ type EnvironmentWrite = {
|
||||
deployScriptPath: string
|
||||
maintenanceFilePath: string
|
||||
appUrl?: string
|
||||
databaseName?: string
|
||||
logFiles: LogFile[]
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,16 @@ type PortMapping = {
|
||||
protocol: string
|
||||
}
|
||||
|
||||
type DatabaseInfo = {
|
||||
connected: boolean
|
||||
name: string
|
||||
size: string
|
||||
tableCount: number
|
||||
activeConnections: number
|
||||
cacheHitRatio: number
|
||||
largestTable: string
|
||||
}
|
||||
|
||||
type EnvironmentHealth = {
|
||||
status: string
|
||||
version: string
|
||||
|
||||
Reference in New Issue
Block a user