Replication Controllers (new resource view) (#7154)

* New resource view: ReplicationController -- scaffolding files

Signed-off-by: Roman <ixrock@gmail.com>

* fix: inappropriate names after copy-pasting

Signed-off-by: Roman <ixrock@gmail.com>

* update replication controller api types/spec, fix menu title

Signed-off-by: Roman <ixrock@gmail.com>

* items list + details list views (added contents from replication controllers), lint fixes

Signed-off-by: Roman <ixrock@gmail.com>

* allow to scale replication controllers

Signed-off-by: Roman <ixrock@gmail.com>

* switched for scaling replicas with `Slider` component instead of `Buttons+Input`

Signed-off-by: Roman <ixrock@gmail.com>

---------

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman authored and GitHub committed 2023-02-16 07:48:24 -05:00
1 parent de6f339fec
commit 54e874f646
17 files changed
+610 -1

No files matched your search

@@ -0,0 +1,35 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import { kubeObjectDetailItemInjectionToken } from "../kube-object-detail-item-injection-token";
import { computed } from "mobx";
import {
kubeObjectMatchesToKindAndApiVersion,
} from "../kube-object-matches-to-kind-and-api-version";
import currentKubeObjectInDetailsInjectable from "../../current-kube-object-in-details.injectable";
import { ReplicationControllerDetails } from "../../../+workloads-replicationcontrollers";
const replicationControllerDetailItemInjectable = getInjectable({
id: "replication-controller-detail-item",
instantiate(di) {
const kubeObject = di.inject(currentKubeObjectInDetailsInjectable);
return {
Component: ReplicationControllerDetails,
enabled: computed(() => isReplicationController(kubeObject.value.get()?.object)),
orderNumber: 10,
};
},
injectionToken: kubeObjectDetailItemInjectionToken,
});
export const isReplicationController = kubeObjectMatchesToKindAndApiVersion(
"ReplicationController",
["v1"],
);
export default replicationControllerDetailItemInjectable;