Cosmetics

This commit is contained in:
Andrei Pohilko
2022-11-08 14:37:48 +00:00
parent 2454fcf47c
commit dadf2d1bde
6 changed files with 23 additions and 22 deletions

View File

@@ -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($("<option>", {
value: item,
text: item
}))
})
})
$.getJSON("/api/helm/repo/search?name=" + elm.name).fail(function (xhr) {
reportError("Failed to find chart in repo", xhr)
}).done(function (vers) {

View File

@@ -14,6 +14,18 @@ $(function () {
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($("<option>", {
value: item,
text: item
}))
})
})
$.getJSON("/api/scanners").fail(function (xhr) {
reportError("Failed to get list of scanners", xhr)
}).done(function (data) {
@@ -137,7 +149,7 @@ function getCleanClusterName(rawClusterName) {
const region = clusterSplit.at(-3)
return region + "/" + clusterName + ' [AWS]'
}
if (rawClusterName.indexOf('gke') === 0) {
// GKE cluster
return rawClusterName.split('_').at(-2) + '/' + rawClusterName.split('_').at(-1) + ' [GKE]'