mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Introduce ResourceStatus type that resolver needs to return
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
1 parent
9f433da8e1
commit
42829ade73
2 files changed
+5
-11
No files matched your search
@@ -8,21 +8,15 @@ export enum ResourceStatusColor {
|
|||||||
ERROR = "error"
|
ERROR = "error"
|
||||||
}
|
}
|
||||||
|
|
||||||
export abstract class ResourceStatusResolver {
|
export type ResourceStatus = {
|
||||||
protected object: KubeObject
|
text: string;
|
||||||
|
color: string;
|
||||||
constructor(object: KubeObject) {
|
|
||||||
this.object = object
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract getStatusText(): string
|
|
||||||
public abstract getStatusColor(): string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ResourceStatusRegistration {
|
export interface ResourceStatusRegistration {
|
||||||
kind: string;
|
kind: string;
|
||||||
apiVersions: string[];
|
apiVersions: string[];
|
||||||
resolver: (object: KubeObject) => ResourceStatusResolver;
|
resolver: (object: KubeObject) => ResourceStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ResourceStatusRegistry extends BaseRegistry<ResourceStatusRegistration> {
|
export class ResourceStatusRegistry extends BaseRegistry<ResourceStatusRegistration> {
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
export { ResourceStatusResolver as Resolver, ResourceStatusColor as Color } from "../registries/resource-status-registry"
|
export { ResourceStatus as Status, ResourceStatusColor as Color } from "../registries/resource-status-registry"
|
||||||
Reference in new issue
Block a user