mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
- Allow registering handlers - Cannot remove menu items - Can add menu items in any location - Add example of StatefulSets - Could be used to deprecate the old API Signed-off-by: Sebastian Malton <sebastian@malton.name>
23 lines
740 B
TypeScript
23 lines
740 B
TypeScript
/**
|
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
*/
|
|
|
|
import type { KubeObjectHandlerRegistration } from "./handler";
|
|
import { StatefulSetScaleDialog } from "../components/+workloads-statefulsets/statefulset-scale-dialog";
|
|
import type { StatefulSet } from "../../common/k8s-api/endpoints";
|
|
|
|
export const staticKubeObjectContextMenuHandlers: KubeObjectHandlerRegistration[] = [
|
|
{
|
|
kind: "StatefulSet",
|
|
apiVersions: ["apps/v1"],
|
|
onContextMenuOpen: (ctx) => {
|
|
ctx.menuItems.push({
|
|
icon: "open_with",
|
|
title: "Scale",
|
|
onClick: (obj: StatefulSet) => StatefulSetScaleDialog.open(obj),
|
|
});
|
|
},
|
|
},
|
|
];
|