$(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) }).done(function (data) { const context = getHashParam("context") 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($("