feat(frontend) : add DatabaseInfo type and service

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-04-08 16:05:26 +02:00
parent df755d521c
commit 1cb2ff2130
3 changed files with 19 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
import type { DashboardResponse, EnvironmentHealth } from './dto/dashboard' import type { DashboardResponse, EnvironmentHealth, DatabaseInfo } from './dto/dashboard'
export function getDashboard(): Promise<DashboardResponse> { export function getDashboard(): Promise<DashboardResponse> {
return useApi().get<DashboardResponse>('/dashboard', undefined, { return useApi().get<DashboardResponse>('/dashboard', undefined, {
@@ -11,3 +11,9 @@ export function getEnvironmentHealth(envId: number): Promise<EnvironmentHealth>
toast: false, toast: false,
}) })
} }
export function getDatabaseInfo(envId: number): Promise<DatabaseInfo> {
return useApi().get<DatabaseInfo>(`/environments/${envId}/database`, undefined, {
toast: false,
})
}

View File

@@ -12,6 +12,7 @@ type Environment = {
deployScriptPath: string deployScriptPath: string
maintenanceFilePath: string maintenanceFilePath: string
appUrl?: string appUrl?: string
databaseName?: string
logFiles: LogFile[] logFiles: LogFile[]
maintenance: boolean maintenance: boolean
} }
@@ -22,6 +23,7 @@ type EnvironmentWrite = {
deployScriptPath: string deployScriptPath: string
maintenanceFilePath: string maintenanceFilePath: string
appUrl?: string appUrl?: string
databaseName?: string
logFiles: LogFile[] logFiles: LogFile[]
} }

View File

@@ -22,6 +22,16 @@ type PortMapping = {
protocol: string protocol: string
} }
type DatabaseInfo = {
connected: boolean
name: string
size: string
tableCount: number
activeConnections: number
cacheHitRatio: number
largestTable: string
}
type EnvironmentHealth = { type EnvironmentHealth = {
status: string status: string
version: string version: string