mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 11:48:04 +00:00
Few UI Enhancements (#79)
- Add Install/Upgrade keywork dynamically on popup - Sort Repo list alphabetically - Sort CLuster list alphabetically Co-authored-by: Harshit Mehta <harshitm@nvidia.com>
This commit is contained in:
@@ -62,10 +62,12 @@ function popUpUpgrade(elm, ns, name, verCur, lastRev) {
|
|||||||
$("#upgradeModal .rel-cluster").text(getHashParam("context"))
|
$("#upgradeModal .rel-cluster").text(getHashParam("context"))
|
||||||
|
|
||||||
if (verCur) {
|
if (verCur) {
|
||||||
|
$("#upgradeModalLabel .type").text("Upgrade")
|
||||||
$("#upgradeModal .ver-old").show().find("span").text(verCur)
|
$("#upgradeModal .ver-old").show().find("span").text(verCur)
|
||||||
$("#upgradeModal .rel-name").prop("disabled", true).val(name)
|
$("#upgradeModal .rel-name").prop("disabled", true).val(name)
|
||||||
$("#upgradeModal .rel-ns").prop("disabled", true).val(ns)
|
$("#upgradeModal .rel-ns").prop("disabled", true).val(ns)
|
||||||
} else {
|
} else {
|
||||||
|
$("#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("")
|
||||||
|
|||||||
@@ -343,7 +343,7 @@
|
|||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="modal-title" id="upgradeModalLabel">
|
<h4 class="modal-title" id="upgradeModalLabel">
|
||||||
Install <b class='text-success name'></b>
|
<span class="type"></span> <b class='text-success name'></b>
|
||||||
</h4>
|
</h4>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ function loadRepoView() {
|
|||||||
reportError("Failed to get list of repositories", xhr)
|
reportError("Failed to get list of repositories", xhr)
|
||||||
}).done(function (data) {
|
}).done(function (data) {
|
||||||
const items = $("#sectionRepo .repo-list ul").empty()
|
const items = $("#sectionRepo .repo-list ul").empty()
|
||||||
|
data.sort((a, b) => (a.name > b.name) - (a.name < b.name))
|
||||||
|
|
||||||
data.forEach(function (elm) {
|
data.forEach(function (elm) {
|
||||||
let opt = $('<li class="mb-2"><label><input type="radio" name="cluster" class="me-2"/><span></span></label></li>');
|
let opt = $('<li class="mb-2"><label><input type="radio" name="cluster" class="me-2"/><span></span></label></li>');
|
||||||
opt.attr('title', elm.url)
|
opt.attr('title', elm.url)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ $(function () {
|
|||||||
reportError("Failed to get list of clusters", xhr)
|
reportError("Failed to get list of clusters", xhr)
|
||||||
}).done(function (data) {
|
}).done(function (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)))
|
||||||
fillClusterList(data, context);
|
fillClusterList(data, context);
|
||||||
|
|
||||||
initView(); // can only do it after loading cluster list
|
initView(); // can only do it after loading cluster list
|
||||||
|
|||||||
Reference in New Issue
Block a user