mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Show Delete menu item only for local cluster
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
7d6209a31c
commit
08215c8184
@ -15,6 +15,10 @@
|
||||
max-width: 600px;
|
||||
min-width: calc(45 * var(--unit));
|
||||
}
|
||||
|
||||
b {
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
|
||||
.dialogContent {
|
||||
|
||||
@ -49,20 +49,13 @@ function initKubernetesClusters() {
|
||||
catalogCategoryRegistry
|
||||
.getForGroupKind("entity.k8slens.dev", "KubernetesCluster")
|
||||
.on("contextMenuOpen", (entity, context) => {
|
||||
context.menuItems.push({
|
||||
title: "Delete",
|
||||
icon: "delete",
|
||||
onClick: () => deleteLocalCluster(entity.metadata.uid),
|
||||
confirm: {
|
||||
// TODO: change this to be a <p> tag with better formatting once this code can accept it.
|
||||
message: `Delete the "${entity.metadata.name}" context from "${entity.spec.kubeconfigPath}"?`
|
||||
}
|
||||
});
|
||||
context.menuItems.push({
|
||||
title: "Remove",
|
||||
icon: "delete",
|
||||
onClick: () => onClusterDelete(entity.metadata.uid)
|
||||
});
|
||||
if (entity.metadata?.source == "local") {
|
||||
context.menuItems.push({
|
||||
title: "Delete",
|
||||
icon: "delete",
|
||||
onClick: () => onClusterDelete(entity.metadata.uid)
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user