fix namespaces not updating when switching cluster (#102)

This commit is contained in:
ronahk
2022-11-16 11:59:38 +02:00
committed by GitHub
parent 1393b117cf
commit d0dbb42492

View File

@@ -13,20 +13,21 @@ $(function () {
fillClusterList(data, context); fillClusterList(data, context);
initView(); // can only do it after loading cluster list initView(); // can only do it after loading cluster list
})
$.getJSON("/api/kube/namespaces").fail(function (xhr) {
$.getJSON("/api/kube/namespaces").fail(function (xhr) { reportError("Failed to get namespaces", xhr)
reportError("Failed to get namespaces", xhr) }).done(function(res) {
}).done(function(res) { const ns = res.items.map(i => i.metadata.name)
const ns = res.items.map(i => i.metadata.name) $.each(ns, function(i, item) {
$.each(ns, function(i, item) { $("#upgradeModal #ns-datalist").append($("<option>", {
$("#upgradeModal #ns-datalist").append($("<option>", { value: item,
value: item, text: item
text: item }))
})) })
}) })
}) })
$.getJSON("/api/scanners").fail(function (xhr) { $.getJSON("/api/scanners").fail(function (xhr) {
reportError("Failed to get list of scanners", xhr) reportError("Failed to get list of scanners", xhr)
}).done(function (data) { }).done(function (data) {