mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 11:48:04 +00:00
Use namespace defined in kubeconfig as default in install view (#99)
* respect defualt namespace from kubeconfig * respect defualt namespace from kubeconfig * Replace exists with available - avoid confusion in status * use data attribute * remove commented line * fix
This commit is contained in:
@@ -70,7 +70,7 @@ function popUpUpgrade(elm, ns, name, verCur, lastRev) {
|
|||||||
$("#upgradeModalLabel .type").text("Install")
|
$("#upgradeModalLabel .type").text("Install")
|
||||||
$("#upgradeModal .ver-old").hide()
|
$("#upgradeModal .ver-old").hide()
|
||||||
$("#upgradeModal .rel-name").prop("disabled", false).val(elm.name.split("/").pop())
|
$("#upgradeModal .rel-name").prop("disabled", false).val(elm.name.split("/").pop())
|
||||||
$("#upgradeModal .rel-ns").prop("disabled", false).val("")
|
$("#upgradeModal .rel-ns").prop("disabled", false).val(ns)
|
||||||
}
|
}
|
||||||
|
|
||||||
$.getJSON("/api/helm/repo/search?name=" + elm.name).fail(function (xhr) {
|
$.getJSON("/api/helm/repo/search?name=" + elm.name).fail(function (xhr) {
|
||||||
|
|||||||
@@ -130,6 +130,8 @@ function repoChartClicked() {
|
|||||||
setHashParam("chart", elm.installed_name)
|
setHashParam("chart", elm.installed_name)
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
} else {
|
} else {
|
||||||
popUpUpgrade(elm)
|
const contexts = $("body").data("contexts")
|
||||||
|
contextNamespace = contexts.filter(obj => {return obj.Name === getHashParam("context")})[0].Namespace
|
||||||
|
popUpUpgrade(elm, contextNamespace)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,10 +4,10 @@ $(function () {
|
|||||||
window.location.href = "/#context=" + clusterSelect.find("input:radio:checked").val()
|
window.location.href = "/#context=" + clusterSelect.find("input:radio:checked").val()
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
})
|
})
|
||||||
|
|
||||||
$.getJSON("/api/kube/contexts").fail(function (xhr) {
|
$.getJSON("/api/kube/contexts").fail(function (xhr) {
|
||||||
reportError("Failed to get list of clusters", xhr)
|
reportError("Failed to get list of clusters", xhr)
|
||||||
}).done(function (data) {
|
}).done(function (data) {
|
||||||
|
$("body").data("contexts", data)
|
||||||
const context = getHashParam("context")
|
const context = getHashParam("context")
|
||||||
data.sort((a, b) => (getCleanClusterName(a.Name) > getCleanClusterName(b.Name)) - (getCleanClusterName(a.Name) < getCleanClusterName(b.Name)))
|
data.sort((a, b) => (getCleanClusterName(a.Name) > getCleanClusterName(b.Name)) - (getCleanClusterName(a.Name) < getCleanClusterName(b.Name)))
|
||||||
fillClusterList(data, context);
|
fillClusterList(data, context);
|
||||||
|
|||||||
Reference in New Issue
Block a user