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;
|
max-width: 600px;
|
||||||
min-width: calc(45 * var(--unit));
|
min-width: calc(45 * var(--unit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
b {
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialogContent {
|
.dialogContent {
|
||||||
|
|||||||
@ -49,20 +49,13 @@ function initKubernetesClusters() {
|
|||||||
catalogCategoryRegistry
|
catalogCategoryRegistry
|
||||||
.getForGroupKind("entity.k8slens.dev", "KubernetesCluster")
|
.getForGroupKind("entity.k8slens.dev", "KubernetesCluster")
|
||||||
.on("contextMenuOpen", (entity, context) => {
|
.on("contextMenuOpen", (entity, context) => {
|
||||||
context.menuItems.push({
|
if (entity.metadata?.source == "local") {
|
||||||
title: "Delete",
|
context.menuItems.push({
|
||||||
icon: "delete",
|
title: "Delete",
|
||||||
onClick: () => deleteLocalCluster(entity.metadata.uid),
|
icon: "delete",
|
||||||
confirm: {
|
onClick: () => onClusterDelete(entity.metadata.uid)
|
||||||
// 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)
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user