Restyle fixes (#14)

* Applying style fixes

* Implement more notes

* Improvements

* Applying v2 design

* flyout restyle

* fix spec rev

* Status icons

* Restyle top line and footer

* Shorter err msg
This commit is contained in:
Andrey Pokhilko
2022-10-02 11:50:28 +01:00
committed by GitHub
parent 1b6dc4159a
commit 1e3a706698
10 changed files with 250 additions and 150 deletions

View File

@@ -4,6 +4,7 @@ $("#btnUpgradeCheck").click(function () {
self.find(".spinner-border").show()
const repoName = self.data("repo")
$("#btnUpgrade span").text("Checking...")
$("#btnUpgrade .icon").removeClass("bi-arrow-up bi-check-circle").addClass("bi-hourglass-split")
$.post("/api/helm/repo/update?name=" + repoName).fail(function (xhr) {
reportError("Failed to update chart repo", xhr)
}).done(function () {
@@ -20,7 +21,11 @@ function checkUpgradeable(name) {
$.getJSON("/api/helm/repo/search?name=" + name).fail(function (xhr) {
reportError("Failed to find chart in repo", xhr)
}).done(function (data) {
if (!data) {
if (!data || !data.length) {
$("#btnUpgrade span").text("No upgrades")
$("#btnUpgrade .icon").removeClass("bi-hourglass-split").addClass("bi-x-octagon")
$("#btnUpgrade").prop("disabled", true)
$("#btnUpgradeCheck").prop("disabled", true)
return
}
@@ -38,8 +43,10 @@ function checkUpgradeable(name) {
$("#btnUpgradeCheck").prop("disabled", false)
if (canUpgrade) {
$("#btnUpgrade span").text("Upgrade to " + elm.version)
$("#btnUpgrade .icon").removeClass("bi-hourglass-split").addClass("bi-arrow-up")
} else {
$("#btnUpgrade span").text("No upgrades")
$("#btnUpgrade span").text("Up-to-date")
$("#btnUpgrade .icon").removeClass("bi-hourglass-split").addClass("bi-check-circle")
}
$("#btnUpgrade").off("click").click(function () {
@@ -58,12 +65,11 @@ function popUpUpgrade(self, verCur, elm) {
$('#upgradeModalLabel select').val(elm.version).trigger("change")
const myModal = new bootstrap.Offcanvas(document.getElementById('upgradeModal'), {});
const myModal = new bootstrap.Modal(document.getElementById('upgradeModal'), {});
myModal.show()
const btnConfirm = $("#upgradeModal .btn-confirm");
btnConfirm.prop("disabled", true).off('click').click(function () {
console.log("working")
btnConfirm.prop("disabled", true).prepend('<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>')
$.ajax({
url: url + "&version=" + $('#upgradeModalLabel select').val(),
@@ -122,7 +128,7 @@ $("#btnUninstall").click(function () {
})
})
const myModal = new bootstrap.Offcanvas(document.getElementById('confirmModal'));
const myModal = new bootstrap.Modal(document.getElementById('confirmModal'));
myModal.show()
let qstr = "name=" + chart + "&namespace=" + namespace + "&revision=" + revision
@@ -160,7 +166,7 @@ $("#btnRollback").click(function () {
})
})
const myModal = new bootstrap.Offcanvas(document.getElementById('confirmModal'), {});
const myModal = new bootstrap.Modal(document.getElementById('confirmModal'), {});
myModal.show()
let qstr = "name=" + chart + "&namespace=" + namespace + "&revision=" + revisionNew + "&revisionDiff=" + revisionCur