mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-26 06:18:04 +00:00
Sort resources by interesting items (#89)
* sort resources by intersting items * add body class * reuse the name data
This commit is contained in:
@@ -143,6 +143,7 @@ $("#nav-tab [data-tab]").click(function () {
|
|||||||
|
|
||||||
function showResources(namespace, chart, revision) {
|
function showResources(namespace, chart, revision) {
|
||||||
const resBody = $("#nav-resources .body");
|
const resBody = $("#nav-resources .body");
|
||||||
|
const interestingResources = ["STATEFULSET", "DEAMONSET", "DEPLOYMENT"];
|
||||||
resBody.empty().append('<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>');
|
resBody.empty().append('<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>');
|
||||||
let qstr = "name=" + chart + "&namespace=" + namespace + "&revision=" + revision
|
let qstr = "name=" + chart + "&namespace=" + namespace + "&revision=" + revision
|
||||||
let url = "/api/helm/charts/resources"
|
let url = "/api/helm/charts/resources"
|
||||||
@@ -157,6 +158,7 @@ function showResources(namespace, chart, revision) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resBody.empty();
|
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++) {
|
for (let i = 0; i < data.length; i++) {
|
||||||
const res = data[i]
|
const res = data[i]
|
||||||
const resBlock = $(`
|
const resBlock = $(`
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ nav .nav-tabs .nav-link.active {
|
|||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
#installedList .b-shadow:hover {
|
#installedList .body .b-shadow:hover {
|
||||||
box-shadow: 0 3px 15px rgba(0, 0, 0, 0.18);
|
box-shadow: 0 3px 15px rgba(0, 0, 0, 0.18);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user