From 3f00e8ef6d0216937e0ba655054bcea09651b417 Mon Sep 17 00:00:00 2001 From: ronahk <74967920+ronahk@users.noreply.github.com> Date: Thu, 10 Nov 2022 18:51:14 +0200 Subject: [PATCH] Sort resources by interesting items (#89) * sort resources by intersting items * add body class * reuse the name data --- pkg/dashboard/static/details-view.js | 2 ++ pkg/dashboard/static/styles.css | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/dashboard/static/details-view.js b/pkg/dashboard/static/details-view.js index 728d954..7144a7c 100644 --- a/pkg/dashboard/static/details-view.js +++ b/pkg/dashboard/static/details-view.js @@ -143,6 +143,7 @@ $("#nav-tab [data-tab]").click(function () { function showResources(namespace, chart, revision) { const resBody = $("#nav-resources .body"); + const interestingResources = ["STATEFULSET", "DEAMONSET", "DEPLOYMENT"]; resBody.empty().append(''); let qstr = "name=" + chart + "&namespace=" + namespace + "&revision=" + revision let url = "/api/helm/charts/resources" @@ -157,6 +158,7 @@ function showResources(namespace, chart, revision) { } resBody.empty(); + data = data.sort(function(a, b){return interestingResources.indexOf(a.kind.toUpperCase()) - interestingResources.indexOf(b.kind.toUpperCase())}).reverse(); for (let i = 0; i < data.length; i++) { const res = data[i] const resBlock = $(` diff --git a/pkg/dashboard/static/styles.css b/pkg/dashboard/static/styles.css index 96596a7..cc9f6c3 100644 --- a/pkg/dashboard/static/styles.css +++ b/pkg/dashboard/static/styles.css @@ -227,7 +227,7 @@ nav .nav-tabs .nav-link.active { background-color: transparent; } -#installedList .b-shadow:hover { +#installedList .body .b-shadow:hover { box-shadow: 0 3px 15px rgba(0, 0, 0, 0.18); }