mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Indent to spaces
Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
parent
4a3510848e
commit
da3c8d00c7
@ -34,83 +34,83 @@ import { KubeObject } from "../../../common/k8s-api/kube-object";
|
|||||||
const css = makeCss(styles);
|
const css = makeCss(styles);
|
||||||
|
|
||||||
export class CatalogEntityItem<T extends CatalogEntity> implements ItemObject {
|
export class CatalogEntityItem<T extends CatalogEntity> implements ItemObject {
|
||||||
constructor(public entity: T) {}
|
constructor(public entity: T) {}
|
||||||
|
|
||||||
get kind() {
|
get kind() {
|
||||||
return this.entity.kind;
|
return this.entity.kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
get apiVersion() {
|
get apiVersion() {
|
||||||
return this.entity.apiVersion;
|
return this.entity.apiVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
get name() {
|
get name() {
|
||||||
return this.entity.metadata.name;
|
return this.entity.metadata.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
getName() {
|
getName() {
|
||||||
return this.entity.metadata.name;
|
return this.entity.metadata.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
get id() {
|
get id() {
|
||||||
return this.entity.metadata.uid;
|
return this.entity.metadata.uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
getId() {
|
getId() {
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@computed get phase() {
|
@computed get phase() {
|
||||||
return this.entity.status.phase;
|
return this.entity.status.phase;
|
||||||
}
|
}
|
||||||
|
|
||||||
get enabled() {
|
get enabled() {
|
||||||
return this.entity.status.enabled ?? true;
|
return this.entity.status.enabled ?? true;
|
||||||
}
|
}
|
||||||
|
|
||||||
get labels() {
|
get labels() {
|
||||||
return KubeObject.stringifyLabels(this.entity.metadata.labels);
|
return KubeObject.stringifyLabels(this.entity.metadata.labels);
|
||||||
}
|
}
|
||||||
|
|
||||||
getLabelBadges(onClick?: React.MouseEventHandler<any>) {
|
getLabelBadges(onClick?: React.MouseEventHandler<any>) {
|
||||||
return this.labels
|
return this.labels
|
||||||
.map(label => (
|
.map(label => (
|
||||||
<Badge
|
<Badge
|
||||||
className={css.badge}
|
className={css.badge}
|
||||||
key={label}
|
key={label}
|
||||||
label={label}
|
label={label}
|
||||||
title={label}
|
title={label}
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
navigation.searchParams.set(searchUrlParam.name, label);
|
navigation.searchParams.set(searchUrlParam.name, label);
|
||||||
onClick?.(event);
|
onClick?.(event);
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
}}
|
}}
|
||||||
expandable={false}
|
expandable={false}
|
||||||
/>
|
/>
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
get source() {
|
get source() {
|
||||||
return this.entity.metadata.source || "unknown";
|
return this.entity.metadata.source || "unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
get searchFields() {
|
get searchFields() {
|
||||||
return [
|
return [
|
||||||
this.name,
|
this.name,
|
||||||
this.id,
|
this.id,
|
||||||
this.phase,
|
this.phase,
|
||||||
`source=${this.source}`,
|
`source=${this.source}`,
|
||||||
...this.labels,
|
...this.labels,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
onRun(ctx: CatalogEntityActionContext) {
|
onRun(ctx: CatalogEntityActionContext) {
|
||||||
this.entity.onRun(ctx);
|
this.entity.onRun(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
async onContextMenuOpen(ctx: any) {
|
async onContextMenuOpen(ctx: any) {
|
||||||
return this.entity.onContextMenuOpen(ctx);
|
return this.entity.onContextMenuOpen(ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user