-
+
Name
@@ -163,6 +164,8 @@
Looks like you don't have any charts
installed. "Repository" section may be a good place to start.
+
There are no releases matching your filter criteria. Reset your filters or install more charts.
+
diff --git a/pkg/dashboard/static/list-view.js b/pkg/dashboard/static/list-view.js
index 1db4745..9847f0c 100644
--- a/pkg/dashboard/static/list-view.js
+++ b/pkg/dashboard/static/list-view.js
@@ -6,19 +6,21 @@ function loadChartsList() {
$.getJSON("/api/helm/charts").fail(function (xhr) {
reportError("Failed to get list of charts", xhr)
}).done(function (data) {
- chartsCards.empty()
+ chartsCards.empty().hide()
$("#installedList .header h2 span").text(data.length)
data.forEach(function (elm) {
let card = buildChartCard(elm);
chartsCards.append(card)
})
-
+ filterInstalledList(chartsCards.find(".row"))
+ chartsCards.show()
if (!data.length) {
$("#installedList .no-charts").show()
}
})
}
+
function buildChartCard(elm) {
const card = $(`
@@ -28,21 +30,21 @@ function buildChartCard(elm) {
`)
-
+
const chartName = elm.chart.substring(0, elm.chart.lastIndexOf("-"))
$.getJSON("/api/helm/repo/search?name=" + chartName).fail(function (xhr) {
reportError("Failed to get repo name for charts", xhr)
}).done(function (data) {
- if(data.length > 0) {
+ if (data.length > 0) {
$.getJSON("/api/helm/charts/show?name=" + data[0].name).fail(function (xhr) {
reportError("Failed to get list of charts", xhr)
}).done(function (data) {
- if(data) {
- var res = data[0]
- if(res.icon) {
+ if (data) {
+ const res = data[0];
+ if (res.icon) {
card.find(".rel-name").attr("style", "background-image: url(" + res.icon + ")")
}
- if(res.description) {
+ if (res.description) {
card.find(".rel-name div").text(res.description)
}
}
@@ -57,6 +59,10 @@ function buildChartCard(elm) {
card.find(".rel-chart span").text(elm.chart)
card.find(".rel-date span").text(getAge(elm))
+ card.data("namespace", elm.namespace)
+ card.data("name", elm.name)
+ card.data("chart", elm.chart)
+
statusStyle(elm.status, card, card.find(".rel-status span"))
card.find("a").attr("href", '#context=' + getHashParam('context') + '&namespace=' + elm.namespace + '&name=' + elm.name)
@@ -74,3 +80,6 @@ function buildChartCard(elm) {
return card;
}
+$("#installedSearch").keyup(function () {
+ filterInstalledList($("#installedList .body .row"))
+})
diff --git a/pkg/dashboard/static/repo.js b/pkg/dashboard/static/repo.js
index 9b9be9e..1e1ac63 100644
--- a/pkg/dashboard/static/repo.js
+++ b/pkg/dashboard/static/repo.js
@@ -131,7 +131,7 @@ function repoChartClicked() {
window.location.reload()
} else {
const contexts = $("body").data("contexts")
- contextNamespace = contexts.filter(obj => {return obj.Name === getHashParam("context")})[0].Namespace
+ const contextNamespace = contexts.filter(obj => {return obj.Name === getHashParam("context")})[0].Namespace
popUpUpgrade(elm, contextNamespace)
}
}
\ No newline at end of file
diff --git a/pkg/dashboard/static/scripts.js b/pkg/dashboard/static/scripts.js
index 1539762..0d55145 100644
--- a/pkg/dashboard/static/scripts.js
+++ b/pkg/dashboard/static/scripts.js
@@ -1,33 +1,16 @@
$(function () {
- const clusterSelect = $("#cluster");
- clusterSelect.change(function () {
- window.location.href = "/#context=" + clusterSelect.find("input:radio:checked").val()
- window.location.reload()
- })
- $.getJSON("/api/kube/contexts").fail(function (xhr) {
- reportError("Failed to get list of clusters", xhr)
+ let limNS = null
+ $.getJSON("/status").fail(function (xhr) { // maybe /options call in the future
+ reportError("Failed to get tool version", xhr)
}).done(function (data) {
- $("body").data("contexts", data)
- const context = getHashParam("context")
- data.sort((a, b) => (getCleanClusterName(a.Name) > getCleanClusterName(b.Name)) - (getCleanClusterName(a.Name) < getCleanClusterName(b.Name)))
- fillClusterList(data, context);
-
- initView(); // can only do it after loading cluster list
-
- $.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($("