mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix: make registry.add more backward compatible
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
296ba9023f
commit
e671d07eb2
@ -56,30 +56,30 @@ export class ExtensionLoader {
|
|||||||
|
|
||||||
loadOnMain() {
|
loadOnMain() {
|
||||||
logger.info('[EXTENSIONS-LOADER]: load on main')
|
logger.info('[EXTENSIONS-LOADER]: load on main')
|
||||||
this.autoInitExtensions((extension: LensMainExtension) => [
|
this.autoInitExtensions((ext: LensMainExtension) => [
|
||||||
registries.menuRegistry.add(extension, extension.appMenus)
|
registries.menuRegistry.add(ext.appMenus, { ext })
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
loadOnClusterManagerRenderer() {
|
loadOnClusterManagerRenderer() {
|
||||||
logger.info('[EXTENSIONS-LOADER]: load on main renderer (cluster manager)')
|
logger.info('[EXTENSIONS-LOADER]: load on main renderer (cluster manager)')
|
||||||
this.autoInitExtensions((extension: LensRendererExtension) => [
|
this.autoInitExtensions((ext: LensRendererExtension) => [
|
||||||
registries.globalPageRegistry.add(extension, extension.globalPages),
|
registries.globalPageRegistry.add(ext.globalPages, { ext }),
|
||||||
registries.globalPageMenuRegistry.add(extension, extension.globalPageMenus),
|
registries.globalPageMenuRegistry.add(ext.globalPageMenus, { ext }),
|
||||||
registries.appPreferenceRegistry.add(extension, extension.appPreferences),
|
registries.appPreferenceRegistry.add(ext.appPreferences, { ext }),
|
||||||
registries.clusterFeatureRegistry.add(extension, extension.clusterFeatures),
|
registries.clusterFeatureRegistry.add(ext.clusterFeatures, { ext }),
|
||||||
registries.statusBarRegistry.add(extension, extension.statusBarItems),
|
registries.statusBarRegistry.add(ext.statusBarItems, { ext }),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
loadOnClusterRenderer() {
|
loadOnClusterRenderer() {
|
||||||
logger.info('[EXTENSIONS-LOADER]: load on cluster renderer (dashboard)')
|
logger.info('[EXTENSIONS-LOADER]: load on cluster renderer (dashboard)')
|
||||||
this.autoInitExtensions((extension: LensRendererExtension) => [
|
this.autoInitExtensions((ext: LensRendererExtension) => [
|
||||||
registries.clusterPageRegistry.add(extension, extension.clusterPages),
|
registries.clusterPageRegistry.add(ext.clusterPages, { ext }),
|
||||||
registries.clusterPageMenuRegistry.add(extension, extension.clusterPageMenus),
|
registries.clusterPageMenuRegistry.add(ext.clusterPageMenus, { ext }),
|
||||||
registries.kubeObjectMenuRegistry.add(extension, extension.kubeObjectMenuItems),
|
registries.kubeObjectMenuRegistry.add(ext.kubeObjectMenuItems, { ext }),
|
||||||
registries.kubeObjectDetailRegistry.add(extension, extension.kubeObjectDetailItems),
|
registries.kubeObjectDetailRegistry.add(ext.kubeObjectDetailItems, { ext }),
|
||||||
registries.kubeObjectStatusRegistry.add(extension, extension.kubeObjectStatusTexts)
|
registries.kubeObjectStatusRegistry.add(ext.kubeObjectStatusTexts, { ext })
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,11 @@
|
|||||||
import { action, observable } from "mobx";
|
import { action, observable } from "mobx";
|
||||||
import { LensExtension } from "../lens-extension";
|
import { LensExtension } from "../lens-extension";
|
||||||
|
|
||||||
|
export interface BaseRegistryAddMeta {
|
||||||
|
ext?: LensExtension | null;
|
||||||
|
merge?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
export class BaseRegistry<T extends object = any> {
|
export class BaseRegistry<T extends object = any> {
|
||||||
private items = observable.map<LensExtension, T[]>([], { deep: false });
|
private items = observable.map<LensExtension, T[]>([], { deep: false });
|
||||||
|
|
||||||
@ -15,23 +20,28 @@ export class BaseRegistry<T extends object = any> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
add(ext: LensExtension | null, items: T[], merge = true) {
|
add(items: T | T[], { ext = null, merge = true }: BaseRegistryAddMeta = {}) {
|
||||||
|
const itemsList: T[] = Array.isArray(items) ? items : [items];
|
||||||
if (merge && this.items.has(ext)) {
|
if (merge && this.items.has(ext)) {
|
||||||
const newItems = new Set(this.items.get(ext));
|
const newItems = new Set(this.items.get(ext));
|
||||||
items.forEach(item => newItems.add(item))
|
itemsList.forEach(item => newItems.add(item))
|
||||||
this.items.set(ext, [...newItems]);
|
this.items.set(ext, [...newItems]);
|
||||||
} else {
|
} else {
|
||||||
this.items.set(ext, items);
|
this.items.set(ext, itemsList);
|
||||||
}
|
}
|
||||||
return () => this.remove(ext, items)
|
return () => this.remove(itemsList, ext)
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
remove(ext: LensExtension | null, items: T[]) {
|
remove(items: T[], key: LensExtension = null) {
|
||||||
const storedItems = this.items.get(ext);
|
const storedItems = this.items.get(key);
|
||||||
if (storedItems) {
|
if (storedItems) {
|
||||||
const newItems = storedItems.filter(item => !items.includes(item)); // works because of {deep: false};
|
const newItems = storedItems.filter(item => !items.includes(item)); // works because of {deep: false};
|
||||||
this.items.set(ext, newItems);
|
if (newItems.length > 0) {
|
||||||
|
this.items.set(key, newItems)
|
||||||
|
} else {
|
||||||
|
this.items.delete(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -128,12 +128,10 @@ export class HpaDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "HorizontalPodAutoscaler",
|
||||||
kind: "HorizontalPodAutoscaler",
|
apiVersions: ["autoscaling/v1"],
|
||||||
apiVersions: ["autoscaling/v1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <HpaDetails {...props} />
|
||||||
Details: (props) => <HpaDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -94,12 +94,10 @@ export class ConfigMapDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "ConfigMap",
|
||||||
kind: "ConfigMap",
|
apiVersions: ["v1"],
|
||||||
apiVersions: ["v1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <ConfigMapDetails {...props} />
|
||||||
Details: (props) => <ConfigMapDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -54,12 +54,10 @@ export class PodDisruptionBudgetDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "PodDisruptionBudget",
|
||||||
kind: "PodDisruptionBudget",
|
apiVersions: ["policy/v1beta1"],
|
||||||
apiVersions: ["policy/v1beta1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <PodDisruptionBudgetDetails {...props} />
|
||||||
Details: (props) => <PodDisruptionBudgetDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -16,6 +16,8 @@ import { ReplicaSetDetails } from "../+workloads-replicasets";
|
|||||||
interface Props extends KubeObjectDetailsProps<ResourceQuota> {
|
interface Props extends KubeObjectDetailsProps<ResourceQuota> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onlyNumbers = /$[0-9]*^/g;
|
||||||
|
|
||||||
function transformUnit(name: string, value: string): number {
|
function transformUnit(name: string, value: string): number {
|
||||||
if (name.includes("memory") || name.includes("storage")) {
|
if (name.includes("memory") || name.includes("storage")) {
|
||||||
return unitsToBytes(value)
|
return unitsToBytes(value)
|
||||||
@ -96,12 +98,10 @@ export class ResourceQuotaDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "ResourceQuota",
|
||||||
kind: "ResourceQuota",
|
apiVersions: ["v1"],
|
||||||
apiVersions: ["v1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <ReplicaSetDetails {...props} />
|
||||||
Details: (props) => <ReplicaSetDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -113,12 +113,10 @@ export class SecretDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "Secret",
|
||||||
kind: "Secret",
|
apiVersions: ["v1"],
|
||||||
apiVersions: ["v1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <SecretDetails {...props} />
|
||||||
Details: (props) => <SecretDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -134,12 +134,10 @@ export class CRDDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "CustomResourceDefinition",
|
||||||
kind: "CustomResourceDefinition",
|
apiVersions: ["apiextensions.k8s.io/v1", "apiextensions.k8s.io/v1beta1"],
|
||||||
apiVersions: ["apiextensions.k8s.io/v1", "apiextensions.k8s.io/v1beta1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <CRDDetails {...props} />
|
||||||
Details: (props) => <CRDDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -74,12 +74,10 @@ export class EventDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "Event",
|
||||||
kind: "Event",
|
apiVersions: ["v1"],
|
||||||
apiVersions: ["v1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <EventDetails {...props}/>
|
||||||
Details: (props) => <EventDetails {...props}/>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -56,12 +56,10 @@ export class NamespaceDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "Namespace",
|
||||||
kind: "Namespace",
|
apiVersions: ["v1"],
|
||||||
apiVersions: ["v1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <NamespaceDetails {...props} />
|
||||||
Details: (props) => <NamespaceDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import { DrawerTitle } from "../drawer";
|
|||||||
import { KubeEventDetails } from "../+events/kube-event-details";
|
import { KubeEventDetails } from "../+events/kube-event-details";
|
||||||
import { KubeObjectDetailsProps } from "../kube-object";
|
import { KubeObjectDetailsProps } from "../kube-object";
|
||||||
import { Endpoint } from "../../api/endpoints";
|
import { Endpoint } from "../../api/endpoints";
|
||||||
|
import { _i18n } from "../../i18n";
|
||||||
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
|
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
|
||||||
import { EndpointSubsetList } from "./endpoint-subset-list";
|
import { EndpointSubsetList } from "./endpoint-subset-list";
|
||||||
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
|
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
|
||||||
@ -37,12 +38,10 @@ export class EndpointDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "Endpoints",
|
||||||
kind: "Endpoints",
|
apiVersions: ["v1"],
|
||||||
apiVersions: ["v1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <EndpointDetails {...props} />
|
||||||
Details: (props) => <EndpointDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -134,12 +134,10 @@ export class IngressDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "Ingress",
|
||||||
kind: "Ingress",
|
apiVersions: ["extensions/v1beta1"],
|
||||||
apiVersions: ["extensions/v1beta1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <IngressDetails {...props} />
|
||||||
Details: (props) => <IngressDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -144,12 +144,10 @@ export class NetworkPolicyDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "NetworkPolicy",
|
||||||
kind: "NetworkPolicy",
|
apiVersions: ["networking.k8s.io/v1"],
|
||||||
apiVersions: ["networking.k8s.io/v1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <NetworkPolicyDetails {...props} />
|
||||||
Details: (props) => <NetworkPolicyDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -85,12 +85,10 @@ export class ServiceDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "Service",
|
||||||
kind: "Service",
|
apiVersions: ["v1"],
|
||||||
apiVersions: ["v1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <ServiceDetails {...props} />
|
||||||
Details: (props) => <ServiceDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -155,12 +155,10 @@ export class NodeDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "Node",
|
||||||
kind: "Node",
|
apiVersions: ["v1"],
|
||||||
apiVersions: ["v1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <NodeDetails {...props} />
|
||||||
Details: (props) => <NodeDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -209,12 +209,10 @@ export class PodSecurityPolicyDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "PodSecurityPolicy",
|
||||||
kind: "PodSecurityPolicy",
|
apiVersions: ["policy/v1beta1"],
|
||||||
apiVersions: ["policy/v1beta1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <PodSecurityPolicyDetails {...props}/>
|
||||||
Details: (props) => <PodSecurityPolicyDetails {...props}/>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -62,12 +62,10 @@ export class StorageClassDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "StorageClass",
|
||||||
kind: "StorageClass",
|
apiVersions: ["storage.k8s.io/v1"],
|
||||||
apiVersions: ["storage.k8s.io/v1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <StorageClassDetails {...props} />
|
||||||
Details: (props) => <StorageClassDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -95,12 +95,10 @@ export class PersistentVolumeClaimDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "PersistentVolumeClaim",
|
||||||
kind: "PersistentVolumeClaim",
|
apiVersions: ["v1"],
|
||||||
apiVersions: ["v1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <PersistentVolumeClaimDetails {...props} />
|
||||||
Details: (props) => <PersistentVolumeClaimDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -103,12 +103,10 @@ export class PersistentVolumeDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "PersistentVolume",
|
||||||
kind: "PersistentVolume",
|
apiVersions: ["v1"],
|
||||||
apiVersions: ["v1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <PersistentVolumeDetails {...props} />
|
||||||
Details: (props) => <PersistentVolumeDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -125,19 +125,17 @@ export class RoleBindingDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "RoleBinding",
|
||||||
kind: "RoleBinding",
|
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||||
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <RoleBindingDetails {...props} />
|
||||||
Details: (props) => <RoleBindingDetails {...props} />
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
kind: "ClusterRoleBinding",
|
|
||||||
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
|
||||||
components: {
|
|
||||||
Details: (props) => <RoleBindingDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "ClusterRoleBinding",
|
||||||
|
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||||
|
components: {
|
||||||
|
Details: (props) => <RoleBindingDetails {...props} />
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -66,19 +66,18 @@ export class RoleDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "Role",
|
||||||
kind: "Role",
|
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||||
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <RoleDetails {...props}/>
|
||||||
Details: (props) => <RoleDetails {...props}/>
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
kind: "ClusterRole",
|
|
||||||
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
|
||||||
components: {
|
|
||||||
Details: (props) => <RoleDetails {...props}/>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|
||||||
|
kubeObjectDetailRegistry.add({
|
||||||
|
kind: "ClusterRole",
|
||||||
|
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||||
|
components: {
|
||||||
|
Details: (props) => <RoleDetails {...props}/>
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@ -132,12 +132,10 @@ export class ServiceAccountsDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "ServiceAccount",
|
||||||
kind: "ServiceAccount",
|
apiVersions: ["v1"],
|
||||||
apiVersions: ["v1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <ServiceAccountsDetails {...props} />
|
||||||
Details: (props) => <ServiceAccountsDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -77,12 +77,10 @@ function ServiceAccountMenu(props: KubeObjectMenuProps<ServiceAccount>) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectMenuRegistry.add(null, [
|
kubeObjectMenuRegistry.add({
|
||||||
{
|
kind: "ServiceAccount",
|
||||||
kind: "ServiceAccount",
|
apiVersions: ["v1"],
|
||||||
apiVersions: ["v1"],
|
components: {
|
||||||
components: {
|
MenuItem: ServiceAccountMenu
|
||||||
MenuItem: ServiceAccountMenu
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -87,12 +87,10 @@ export class CronJobDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "CronJob",
|
||||||
kind: "CronJob",
|
apiVersions: ["batch/v1"],
|
||||||
apiVersions: ["batch/v1"],
|
components: {
|
||||||
components: {
|
Details: (props) => <CronJobDetails {...props} />
|
||||||
Details: (props) => <CronJobDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -88,12 +88,10 @@ export function CronJobMenu(props: KubeObjectMenuProps<CronJob>) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectMenuRegistry.add(null, [
|
kubeObjectMenuRegistry.add({
|
||||||
{
|
kind: "CronJob",
|
||||||
kind: "CronJob",
|
apiVersions: ["batch/v1beta1"],
|
||||||
apiVersions: ["batch/v1beta1"],
|
components: {
|
||||||
components: {
|
MenuItem: CronJobMenu
|
||||||
MenuItem: CronJobMenu
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -97,12 +97,10 @@ export class DaemonSetDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "DaemonSet",
|
||||||
kind: "DaemonSet",
|
apiVersions: ["apps/v1"],
|
||||||
apiVersions: ["apps/v1"],
|
components: {
|
||||||
components: {
|
Details: (props: any) => <DaemonSetDetails {...props} />
|
||||||
Details: (props: any) => <DaemonSetDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { disposeOnUnmount, observer } from "mobx-react";
|
|||||||
import { t, Trans } from "@lingui/macro";
|
import { t, Trans } from "@lingui/macro";
|
||||||
import { DrawerItem } from "../drawer";
|
import { DrawerItem } from "../drawer";
|
||||||
import { Badge } from "../badge";
|
import { Badge } from "../badge";
|
||||||
import { Deployment } from "../../api/endpoints";
|
import { Deployment, deploymentApi } from "../../api/endpoints";
|
||||||
import { cssNames } from "../../utils";
|
import { cssNames } from "../../utils";
|
||||||
import { PodDetailsTolerations } from "../+workloads-pods/pod-details-tolerations";
|
import { PodDetailsTolerations } from "../+workloads-pods/pod-details-tolerations";
|
||||||
import { PodDetailsAffinities } from "../+workloads-pods/pod-details-affinities";
|
import { PodDetailsAffinities } from "../+workloads-pods/pod-details-affinities";
|
||||||
@ -122,12 +122,10 @@ export class DeploymentDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "Deployment",
|
||||||
kind: "Deployment",
|
apiVersions: ["apps/v1"],
|
||||||
apiVersions: ["apps/v1"],
|
components: {
|
||||||
components: {
|
Details: (props: any) => <DeploymentDetails {...props} />
|
||||||
Details: (props: any) => <DeploymentDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -129,12 +129,10 @@ export function DeploymentMenu(props: KubeObjectMenuProps<Deployment>) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectMenuRegistry.add(null, [
|
kubeObjectMenuRegistry.add({
|
||||||
{
|
kind: "Deployment",
|
||||||
kind: "Deployment",
|
apiVersions: ["apps/v1"],
|
||||||
apiVersions: ["apps/v1"],
|
components: {
|
||||||
components: {
|
MenuItem: DeploymentMenu
|
||||||
MenuItem: DeploymentMenu
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -107,12 +107,10 @@ export class JobDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "Job",
|
||||||
kind: "Job",
|
apiVersions: ["batch/v1"],
|
||||||
apiVersions: ["batch/v1"],
|
components: {
|
||||||
components: {
|
Details: (props: any) => <JobDetails {...props}/>
|
||||||
Details: (props: any) => <JobDetails {...props}/>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -221,12 +221,10 @@ export class PodDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "Pod",
|
||||||
kind: "Pod",
|
apiVersions: ["v1"],
|
||||||
apiVersions: ["v1"],
|
components: {
|
||||||
components: {
|
Details: (props: any) => <PodDetails {...props} />
|
||||||
Details: (props: any) => <PodDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -97,12 +97,10 @@ export class ReplicaSetDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "ReplicaSet",
|
||||||
kind: "ReplicaSet",
|
apiVersions: ["apps/v1"],
|
||||||
apiVersions: ["apps/v1"],
|
components: {
|
||||||
components: {
|
Details: (props: any) => <ReplicaSetDetails {...props} />
|
||||||
Details: (props: any) => <ReplicaSetDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
@ -96,12 +96,10 @@ export class StatefulSetDetails extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
kubeObjectDetailRegistry.add(null, [
|
kubeObjectDetailRegistry.add({
|
||||||
{
|
kind: "StatefulSet",
|
||||||
kind: "StatefulSet",
|
apiVersions: ["apps/v1"],
|
||||||
apiVersions: ["apps/v1"],
|
components: {
|
||||||
components: {
|
Details: (props: any) => <StatefulSetDetails {...props} />
|
||||||
Details: (props: any) => <StatefulSetDetails {...props} />
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user