fix: update instance item type

This commit is contained in:
jialin
2026-05-28 15:51:51 +08:00
committed by jialin
parent b590aa746b
commit 9488fc1251
2 changed files with 17 additions and 1 deletions
@@ -63,13 +63,29 @@ export interface InstanceServicePort {
protocol?: InstanceServicePortProtocol; protocol?: InstanceServicePortProtocol;
} }
export interface InstanceStatusAllocationItem {
id: string;
manufacturer: string;
accelerators: [
{
id: string;
index: number;
mode: string;
allocated: number;
}
];
}
export interface InstanceStatus { export interface InstanceStatus {
namespace?: string; namespace?: string;
phase?: string; phase?: string;
phaseMessage?: string; phaseMessage?: string;
nodeName?: string;
accessAddresses?: string[];
hostIPs?: InstanceIP[]; hostIPs?: InstanceIP[];
podIPs?: InstanceIP[]; podIPs?: InstanceIP[];
ports?: InstanceServicePort[]; ports?: InstanceServicePort[];
allocations?: InstanceStatusAllocationItem[];
} }
// instance list item // instance list item
@@ -33,7 +33,7 @@ type ConnectEntry =
}; };
const getConnectEntries = (record: ListItem): ConnectEntry[] => { const getConnectEntries = (record: ListItem): ConnectEntry[] => {
const ip = record.status?.hostIPs?.[0]?.ip; const ip = record.status?.accessAddresses?.[0];
const ports = record.status?.ports || []; const ports = record.status?.ports || [];
const configPorts = record.spec?.ports || []; const configPorts = record.spec?.ports || [];