UNPKG

@alauda-fe/common

Version:

Alauda frontend team common codes.

78 lines (77 loc) 2.1 kB
import { KubernetesResource } from '../../core/public-api'; export type DataType = 'project' | 'namespace' | 'cluster' | 'service_mesh'; export interface ClusterResource extends KubernetesResource { status: { phase: string; conditions: Array<{ type: string; status: string; reason: string; }>; }; spec: { displayName: string; type: 'Baremetal' | 'Imported'; }; } export type DisplayMode = 'row' | 'card' | 'row-lite'; export interface DisabledState { disabled: boolean; tooltip?: string; } export interface DataItemBase { name: string; displayName: string; timestamp: string; state?: DisabledState; __origin: KubernetesResource; cluster?: string; serviceMeshGroupName?: string; serviceMeshName?: string; serviceMeshIstioVersion?: string; } export declare enum ClusterArch { amd64 = "x86", arm64 = "ARM", hybrid = "Hybrid" } export interface NamespaceDataItem extends DataItemBase { admin: string; serviceMeshClusters?: string[]; serviceMeshIstioVersion?: string; clusterArch?: ClusterArch; clusterDisplayName?: string; } export interface ProjectDataItem extends DataItemBase { status: 'normal' | 'abnormal'; admin: string; } export interface ClusterDataItem extends DataItemBase { status: 'normal' | 'abnormal'; } export type DataItem = NamespaceDataItem & ProjectDataItem & ClusterDataItem; export declare enum ConfigurableField { Cluster = "cluster", Status = "status", ServiceMesh = "servicemesh", ServiceMeshGroup = "servicemeshgroup", ServiceMeshClusters = "servicemeshClusters", Time = "time", Action = "action" } export type DisableFn = (resource: KubernetesResource) => { disabled: boolean; tooltip?: string; }; export interface SelectedNamespaceValue { project: string; cluster: string; name: string; servicemesh?: string; istioVersion?: string; } export interface ResourceDataNumbers { project?: number; cluster?: number; namespace?: number; }