From dadf2d1bde10702bff434c8ab1e19566e017d615 Mon Sep 17 00:00:00 2001 From: Andrei Pohilko Date: Tue, 8 Nov 2022 14:37:48 +0000 Subject: [PATCH] Cosmetics --- Makefile | 2 +- pkg/dashboard/handlers/kubeHandlers.go | 1 + pkg/dashboard/static/actions.js | 12 ------------ pkg/dashboard/static/scripts.js | 14 +++++++++++++- pkg/dashboard/subproc/data.go | 8 ++++++++ pkg/dashboard/subproc/helmTypes.go | 8 -------- 6 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 00ca229..b34eaf2 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ pull: ; $(info $(M) Pulling source...) @ .PHONY: build build: $(BIN) ; $(info $(M) Building executable...) @ ## Build program binary - $Q $(GO) build \ + go build \ -ldflags '-X main.version=$(VERSION) -X main.buildDate=$(DATE)' \ -o bin/dashboard . diff --git a/pkg/dashboard/handlers/kubeHandlers.go b/pkg/dashboard/handlers/kubeHandlers.go index 377bc0e..918b7b8 100644 --- a/pkg/dashboard/handlers/kubeHandlers.go +++ b/pkg/dashboard/handlers/kubeHandlers.go @@ -39,6 +39,7 @@ func (h *KubeHandler) GetResourceInfo(c *gin.Context) { return } + // custom logic to provide most meaningful status for the resource if res.Status.Phase == "Active" || res.Status.Phase == "Error" { _ = res.Name + "" } else if res.Status.Phase == "" && len(res.Status.Conditions) > 0 { diff --git a/pkg/dashboard/static/actions.js b/pkg/dashboard/static/actions.js index 11e1a25..31413cb 100644 --- a/pkg/dashboard/static/actions.js +++ b/pkg/dashboard/static/actions.js @@ -71,18 +71,6 @@ function popUpUpgrade(elm, ns, name, verCur, lastRev) { $("#upgradeModal .rel-ns").prop("disabled", false).val("") } - $.getJSON("/api/kube/namespaces").fail(function (xhr) { - reportError("Failed to get namespaces", xhr) - }).done(function(res) { - const ns = res.items.map(i => i.metadata.name) - $.each(ns, function(i, item) { - $("#upgradeModal #ns-datalist").append($("