8 Commits

Author SHA1 Message Date
Andrei Pohilko
1b6dc4159a Release 0.0.6 2022-09-29 09:01:05 +01:00
Andrei Pohilko
69609b1ee2 Fix wrapping and scrolls 2022-09-28 22:29:42 +01:00
Andrei Pohilko
bdd5b9b32e Workaround the wrap 2022-09-28 20:52:37 +01:00
Andrei Pohilko
870a1196f0 Make k8s context a URL param 2022-09-28 15:00:10 +01:00
Andrei Pohilko
c1732c86a5 Fix the binary path 2022-09-26 14:40:14 +01:00
Andrei Pohilko
388c330390 Fix unpacking 2022-09-26 14:37:53 +01:00
Andrei Pohilko
cb7c29de90 fix the name 2022-09-26 14:35:13 +01:00
Andrei Pohilko
fa6a38c50f Update install script 2022-09-26 14:33:10 +01:00
8 changed files with 41 additions and 34 deletions

View File

@@ -18,6 +18,11 @@ To install it, simply run Helm command:
helm plugin install https://github.com/komodorio/helm-dashboard.git helm plugin install https://github.com/komodorio/helm-dashboard.git
``` ```
To update the plugin to the latest version, run:
```shell
helm plugin update dashboard
```
To uninstall, run: To uninstall, run:
```shell ```shell
@@ -108,7 +113,7 @@ To install, checkout the source code and run from source dir:
helm plugin install . helm plugin install .
``` ```
Local install of plugin just creates a symlink, so making the changes and rebuilding the binary would not require to Local installation of plugin just creates a symlink, so making the changes and rebuilding the binary would not require to
reinstall a plugin. reinstall a plugin.
To use the plugin, run in your terminal: To use the plugin, run in your terminal:

View File

@@ -4,7 +4,6 @@ function revisionClicked(namespace, name, self) {
revRow.find(".active").removeClass(active).addClass(inactive) revRow.find(".active").removeClass(active).addClass(inactive)
self.removeClass(inactive).addClass(active) self.removeClass(inactive).addClass(active)
const elm = self.data("elm") const elm = self.data("elm")
console.log(elm)
setHashParam("revision", elm.revision) setHashParam("revision", elm.revision)
$("#sectionDetails span.rev").text("#"+elm.revision) $("#sectionDetails span.rev").text("#"+elm.revision)
statusStyle(elm.status, $("#none"), $("#sectionDetails .rev-details .rev-status")) statusStyle(elm.status, $("#none"), $("#sectionDetails .rev-details .rev-status"))
@@ -13,6 +12,7 @@ function revisionClicked(namespace, name, self) {
$("#sectionDetails .rev-tags .rev-chart").text(elm.chart) $("#sectionDetails .rev-tags .rev-chart").text(elm.chart)
$("#sectionDetails .rev-tags .rev-app").text(elm.app_version) $("#sectionDetails .rev-tags .rev-app").text(elm.app_version)
$("#sectionDetails .rev-tags .rev-ns").text(getHashParam("namespace")) $("#sectionDetails .rev-tags .rev-ns").text(getHashParam("namespace"))
$("#sectionDetails .rev-tags .rev-cluster").text(getHashParam("context"))
$("#revDescr").text(elm.description).removeClass("text-danger") $("#revDescr").text(elm.description).removeClass("text-danger")
if (elm.status === "failed") { if (elm.status === "failed") {

View File

@@ -17,9 +17,9 @@
</head> </head>
<body> <body>
<div class="container-fluid gx-0"> <div class="container-fluid px-0">
<!-- TOP BAR --> <!-- TOP BAR -->
<nav class="navbar navbar-expand bg-white mb-0 p-0" id="topNav"> <nav class="navbar navbar-expand bg-white mb-0 p-0 b-shadow" id="topNav">
<div class="container-fluid m-0 p-0"> <div class="container-fluid m-0 p-0">
<div class="navbar-brand"> <div class="navbar-brand">
<a href="/"><img src="static/logo.png" alt="Logo"></a> <a href="/"><img src="static/logo.png" alt="Logo"></a>
@@ -53,7 +53,7 @@
</nav> </nav>
<!-- /TOP BAR --> <!-- /TOP BAR -->
<div class="row mt-3 pt-3 mx-0 me-5" id="sectionList" style="display: none"> <div class="row mt-3 pt-3 me-5" id="sectionList" style="display: none">
<div class="col-2 ms-3"> <div class="col-2 ms-3">
<!-- FILTER BLOCK --> <!-- FILTER BLOCK -->
<div class="p-2 ps-2 bg-white rounded-1 b-shadow" id="filters"> <div class="p-2 ps-2 bg-white rounded-1 b-shadow" id="filters">
@@ -95,14 +95,14 @@
<!-- /INSTALLED LIST --> <!-- /INSTALLED LIST -->
</div> </div>
<div class="row flex-nowrap pt-0 mx-0" id="sectionDetails" style="display: none">
<div class="row pt-0 mx-0 me-0" id="sectionDetails" style="display: none"> <div class="col-2 px-4 py-4 pe-3 rev-list">
<div class="col-2 ms-3 ps-1 pt-4 rev-list">
<h3 class="fw-bold small">Revisions</h3> <h3 class="fw-bold small">Revisions</h3>
<ul class="list-unstyled"> <ul class="list-unstyled">
</ul> </ul>
</div> </div>
<div class="col ms-2 rev-details bg-white b-shadow pt-4 px-5">
<div class="col-10 rev-details bg-white b-shadow pt-4 px-5 overflow-auto">
<div><span class="rev-status fw-bold me-3"></span></div> <div><span class="rev-status fw-bold me-3"></span></div>
<div> <div>
<h1 class="name float-start">Name</h1> <h1 class="name float-start">Name</h1>
@@ -129,10 +129,12 @@
<div> <div>
Revision <span class="rev fw-bold me-4"></span> Revision <span class="rev fw-bold me-4"></span>
Upgraded on <span class="rev-date"></span> <span class="rev-date"></span>
</div> </div>
<div class="rev-tags mt-3"> <div class="rev-tags mt-3">
<span class="rounded rounded-1 me-2 p-1 px-2 bg-tag text-dark">cluster: <span
class="rev-cluster fw-bold"></span></span>
<span class="rounded rounded-1 me-2 p-1 px-2 bg-tag text-dark">namespace: <span <span class="rounded rounded-1 me-2 p-1 px-2 bg-tag text-dark">namespace: <span
class="rev-ns fw-bold"></span></span> class="rev-ns fw-bold"></span></span>
<span class="rounded rounded-1 me-2 p-1 px-2 bg-tag text-dark">chart version: <span <span class="rounded rounded-1 me-2 p-1 px-2 bg-tag text-dark">chart version: <span
@@ -258,7 +260,7 @@
</div> </div>
</div> </div>
<footer class="container-fluid small mt-3" style="z-index: -50"> <footer class="container-fluid small mt-5 mb-5" style="z-index: -50">
<div class="row align-items-end justify-content-end"> <div class="row align-items-end justify-content-end">
<div class="col-3"></div> <div class="col-3"></div>
<div class="col-4 text-center bg-white bg-opacity-50 p-2 px-3 rounded b-shadow"> <div class="col-4 text-center bg-white bg-opacity-50 p-2 px-3 rounded b-shadow">
@@ -282,8 +284,6 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/highlight.min.js" <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/highlight.min.js"
integrity="sha512-gU7kztaQEl7SHJyraPfZLQCNnrKdaQi5ndOyt4L4UPL/FHDd/uB9Je6KDARIqwnNNE27hnqoWLBq+Kpe4iHfeQ==" integrity="sha512-gU7kztaQEl7SHJyraPfZLQCNnrKdaQi5ndOyt4L4UPL/FHDd/uB9Je6KDARIqwnNNE27hnqoWLBq+Kpe4iHfeQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script> crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdn.jsdelivr.net/npm/js-cookie@3.0.1/dist/js.cookie.min.js"
integrity="sha256-0H3Nuz3aug3afVbUlsu12Puxva3CP4EhJtPExqs54Vg=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/luxon@3.0.3/build/global/luxon.min.js" <script src="https://cdn.jsdelivr.net/npm/luxon@3.0.3/build/global/luxon.min.js"
integrity="sha256-RH4TKnKcKyde0s2jc5BW3pXZl/5annY3fcZI9VrV5WQ=" crossorigin="anonymous"></script> integrity="sha256-RH4TKnKcKyde0s2jc5BW3pXZl/5annY3fcZI9VrV5WQ=" crossorigin="anonymous"></script>
<script src="static/list-view.js"></script> <script src="static/list-view.js"></script>

View File

@@ -33,7 +33,7 @@ function buildChartCard(elm) {
statusStyle(elm.status, card, card.find(".rel-status span")) statusStyle(elm.status, card, card.find(".rel-status span"))
card.find("a").attr("href", '#namespace=' + elm.namespace + '&name=' + elm.name) card.find("a").attr("href", '#context=' + getHashParam('context') + '&namespace=' + elm.namespace + '&name=' + elm.name)
card.find(".rel-name span").data("chart", elm).click(function () { card.find(".rel-name span").data("chart", elm).click(function () {
const self = $(this) const self = $(this)

View File

@@ -1,14 +1,14 @@
$(function () { $(function () {
const clusterSelect = $("#cluster"); const clusterSelect = $("#cluster");
clusterSelect.change(function () { clusterSelect.change(function () {
Cookies.set("context", clusterSelect.find("input:radio:checked").val()) window.location.href = "/#context=" + clusterSelect.find("input:radio:checked").val()
window.location.href = "/" 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) {
const context = Cookies.get("context") const context = getHashParam("context")
fillClusterList(data, context); fillClusterList(data, context);
const namespace = getHashParam("namespace") const namespace = getHashParam("namespace")
@@ -31,7 +31,6 @@ function reportError(err, xhr) {
} }
function getHashParam(name) { function getHashParam(name) {
const params = new URLSearchParams(window.location.hash.substring(1)) const params = new URLSearchParams(window.location.hash.substring(1))
return params.get(name) return params.get(name)
@@ -75,18 +74,24 @@ function fillClusterList(data, context) {
opt.find("span").text(label) opt.find("span").text(label)
if (elm.IsCurrent && !context) { if (elm.IsCurrent && !context) {
opt.find("input").prop("checked", true) opt.find("input").prop("checked", true)
setCurrentContext(elm.Name)
} else if (context && elm.Name === context) { } else if (context && elm.Name === context) {
opt.find("input").prop("checked", true) opt.find("input").prop("checked", true)
$.ajaxSetup({ setCurrentContext(elm.Name)
headers: {
'x-kubecontext': context
}
});
} }
$("#cluster").append(opt) $("#cluster").append(opt)
}) })
} }
function setCurrentContext(ctx) {
setHashParam("context", ctx)
$.ajaxSetup({
headers: {
'x-kubecontext': ctx
}
});
}
function getAge(obj1, obj2) { function getAge(obj1, obj2) {
const date = luxon.DateTime.fromISO(obj1.updated); const date = luxon.DateTime.fromISO(obj1.updated);
let dateNext = luxon.DateTime.now() let dateNext = luxon.DateTime.now()

View File

@@ -57,8 +57,6 @@
} }
body { body {
margin: 0;
padding: 0;
height: 100%; height: 100%;
min-height: 50rem; min-height: 50rem;
font-size: 14px; font-size: 14px;
@@ -73,7 +71,6 @@ body > .container-fluid {
} }
#topNav.navbar { #topNav.navbar {
box-shadow: 0 1px 4px rgba(22, 24, 31, 0.1);
} }
.navbar-brand > div { .navbar-brand > div {

View File

@@ -1,8 +1,8 @@
name: "dashboard" name: "dashboard"
version: "0.0.5" version: "0.0.6"
usage: "A simplified way of working with Helm" usage: "A simplified way of working with Helm"
description: "View HELM situation in nice web UI" description: "View HELM situation in nice web UI"
command: "$HELM_PLUGIN_DIR/bin/dashboard" command: "$HELM_PLUGIN_DIR/bin/helm-dashboard"
hooks: hooks:
install: "cd $HELM_PLUGIN_DIR; scripts/install_plugin.sh" install: "cd $HELM_PLUGIN_DIR; scripts/install_plugin.sh"
update: "cd $HELM_PLUGIN_DIR; scripts/install_plugin.sh" update: "cd $HELM_PLUGIN_DIR; scripts/install_plugin.sh"

View File

@@ -2,7 +2,7 @@
# Copied w/ love from the chartmuseum/helm-push :) # Copied w/ love from the chartmuseum/helm-push :)
name="helm-push" name="helm-dashboard"
repo="https://github.com/komodorio/${name}" repo="https://github.com/komodorio/${name}"
if [ -n "${HELM_PUSH_PLUGIN_NO_INSTALL_HOOK}" ]; then if [ -n "${HELM_PUSH_PLUGIN_NO_INSTALL_HOOK}" ]; then
@@ -41,9 +41,9 @@ esac
if [ "$(uname)" = "Darwin" ]; then if [ "$(uname)" = "Darwin" ]; then
url="${repo}/releases/download/v${version}/${name}_${version}_darwin_${arch}.tar.gz" url="${repo}/releases/download/v${version}/${name}_${version}_Darwin_${arch}.tar.gz"
elif [ "$(uname)" = "Linux" ] ; then elif [ "$(uname)" = "Linux" ] ; then
url="${repo}/releases/download/v${version}/${name}_${version}_linux_${arch}.tar.gz" url="${repo}/releases/download/v${version}/${name}_${version}_Linux_${arch}.tar.gz"
else else
url="${repo}/releases/download/v${version}/${name}_${version}_windows_${arch}.tar.gz" url="${repo}/releases/download/v${version}/${name}_${version}_windows_${arch}.tar.gz"
fi fi
@@ -55,10 +55,10 @@ mkdir -p "releases/v${version}"
# Download with curl if possible. # Download with curl if possible.
if [ -x "$(which curl 2>/dev/null)" ]; then if [ -x "$(which curl 2>/dev/null)" ]; then
curl -sSL "${url}" -o "releases/v${version}.tar.gz" curl --fail -sSL "${url}" -o "releases/v${version}.tar.gz"
else else
wget -q "${url}" -O "releases/v${version}.tar.gz" wget -q "${url}" -O "releases/v${version}.tar.gz"
fi fi
tar xzf "releases/v${version}.tar.gz" -C "releases/v${version}" tar xzf "releases/v${version}.tar.gz" -C "releases/v${version}"
mv "releases/v${version}/bin/${name}" "bin/${name}" || \ mv "releases/v${version}/${name}" "bin/${name}" || \
mv "releases/v${version}/bin/${name}.exe" "bin/${name}" mv "releases/v${version}/${name}.exe" "bin/${name}"