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> {
|
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,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -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[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user