From 91fd3793c735e3d371a3e55f43d1bdb799324e95 Mon Sep 17 00:00:00 2001 From: Andrei Pohilko Date: Thu, 8 Sep 2022 16:07:46 +0100 Subject: [PATCH] Don't offer to describe non-existing --- pkg/dashboard/static/scripts.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/dashboard/static/scripts.js b/pkg/dashboard/static/scripts.js index 8a4bbe1..bfc2d28 100644 --- a/pkg/dashboard/static/scripts.js +++ b/pkg/dashboard/static/scripts.js @@ -341,11 +341,15 @@ function showResources(namespace, chart, revision) { badge.addClass("bg-danger") } - resBlock.find(".form-control.col-sm-4").empty().append(badge).append("" + (data.status.message ? data.status.message : '') + "").prepend("") + const statusBlock = resBlock.find(".form-control.col-sm-4"); + statusBlock.empty().append(badge).append("" + (data.status.message ? data.status.message : '') + "") - resBlock.find(".fa-search-plus").click(function () { - showDescribe(ns, res.kind, res.metadata.name) - }) + if (badge.text()!=="NotFound") { + statusBlock.prepend("") + statusBlock.find(".fa-search-plus").click(function () { + showDescribe(ns, res.kind, res.metadata.name) + }) + } }) } })