mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-26 14:28:04 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b6dc4159a | ||
|
|
69609b1ee2 | ||
|
|
bdd5b9b32e | ||
|
|
870a1196f0 | ||
|
|
c1732c86a5 | ||
|
|
388c330390 | ||
|
|
cb7c29de90 | ||
|
|
fa6a38c50f |
@@ -18,6 +18,11 @@ To install it, simply run Helm command:
|
||||
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:
|
||||
|
||||
```shell
|
||||
@@ -108,7 +113,7 @@ To install, checkout the source code and run from source dir:
|
||||
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.
|
||||
|
||||
To use the plugin, run in your terminal:
|
||||
|
||||
@@ -4,7 +4,6 @@ function revisionClicked(namespace, name, self) {
|
||||
revRow.find(".active").removeClass(active).addClass(inactive)
|
||||
self.removeClass(inactive).addClass(active)
|
||||
const elm = self.data("elm")
|
||||
console.log(elm)
|
||||
setHashParam("revision", elm.revision)
|
||||
$("#sectionDetails span.rev").text("#"+elm.revision)
|
||||
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-app").text(elm.app_version)
|
||||
$("#sectionDetails .rev-tags .rev-ns").text(getHashParam("namespace"))
|
||||
$("#sectionDetails .rev-tags .rev-cluster").text(getHashParam("context"))
|
||||
|
||||
$("#revDescr").text(elm.description).removeClass("text-danger")
|
||||
if (elm.status === "failed") {
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container-fluid gx-0">
|
||||
<div class="container-fluid px-0">
|
||||
<!-- 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="navbar-brand">
|
||||
<a href="/"><img src="static/logo.png" alt="Logo"></a>
|
||||
@@ -53,7 +53,7 @@
|
||||
</nav>
|
||||
<!-- /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">
|
||||
<!-- FILTER BLOCK -->
|
||||
<div class="p-2 ps-2 bg-white rounded-1 b-shadow" id="filters">
|
||||
@@ -95,14 +95,14 @@
|
||||
<!-- /INSTALLED LIST -->
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row pt-0 mx-0 me-0" id="sectionDetails" style="display: none">
|
||||
<div class="col-2 ms-3 ps-1 pt-4 rev-list">
|
||||
<div class="row flex-nowrap pt-0 mx-0" id="sectionDetails" style="display: none">
|
||||
<div class="col-2 px-4 py-4 pe-3 rev-list">
|
||||
<h3 class="fw-bold small">Revisions</h3>
|
||||
<ul class="list-unstyled">
|
||||
</ul>
|
||||
</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>
|
||||
<h1 class="name float-start">Name</h1>
|
||||
@@ -129,10 +129,12 @@
|
||||
|
||||
<div>
|
||||
Revision <span class="rev fw-bold me-4"></span>
|
||||
Upgraded on <span class="rev-date"></span>
|
||||
<span class="rev-date"></span>
|
||||
</div>
|
||||
|
||||
<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
|
||||
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
|
||||
@@ -258,7 +260,7 @@
|
||||
</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="col-3"></div>
|
||||
<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"
|
||||
integrity="sha512-gU7kztaQEl7SHJyraPfZLQCNnrKdaQi5ndOyt4L4UPL/FHDd/uB9Je6KDARIqwnNNE27hnqoWLBq+Kpe4iHfeQ=="
|
||||
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"
|
||||
integrity="sha256-RH4TKnKcKyde0s2jc5BW3pXZl/5annY3fcZI9VrV5WQ=" crossorigin="anonymous"></script>
|
||||
<script src="static/list-view.js"></script>
|
||||
|
||||
@@ -33,7 +33,7 @@ function buildChartCard(elm) {
|
||||
|
||||
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 () {
|
||||
const self = $(this)
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
$(function () {
|
||||
const clusterSelect = $("#cluster");
|
||||
clusterSelect.change(function () {
|
||||
Cookies.set("context", clusterSelect.find("input:radio:checked").val())
|
||||
window.location.href = "/"
|
||||
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 = Cookies.get("context")
|
||||
const context = getHashParam("context")
|
||||
fillClusterList(data, context);
|
||||
|
||||
const namespace = getHashParam("namespace")
|
||||
@@ -31,7 +31,6 @@ function reportError(err, xhr) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getHashParam(name) {
|
||||
const params = new URLSearchParams(window.location.hash.substring(1))
|
||||
return params.get(name)
|
||||
@@ -75,18 +74,24 @@ function fillClusterList(data, context) {
|
||||
opt.find("span").text(label)
|
||||
if (elm.IsCurrent && !context) {
|
||||
opt.find("input").prop("checked", true)
|
||||
setCurrentContext(elm.Name)
|
||||
} else if (context && elm.Name === context) {
|
||||
opt.find("input").prop("checked", true)
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'x-kubecontext': context
|
||||
}
|
||||
});
|
||||
setCurrentContext(elm.Name)
|
||||
}
|
||||
$("#cluster").append(opt)
|
||||
})
|
||||
}
|
||||
|
||||
function setCurrentContext(ctx) {
|
||||
setHashParam("context", ctx)
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'x-kubecontext': ctx
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getAge(obj1, obj2) {
|
||||
const date = luxon.DateTime.fromISO(obj1.updated);
|
||||
let dateNext = luxon.DateTime.now()
|
||||
|
||||
@@ -57,8 +57,6 @@
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
min-height: 50rem;
|
||||
font-size: 14px;
|
||||
@@ -73,7 +71,6 @@ body > .container-fluid {
|
||||
}
|
||||
|
||||
#topNav.navbar {
|
||||
box-shadow: 0 1px 4px rgba(22, 24, 31, 0.1);
|
||||
}
|
||||
|
||||
.navbar-brand > div {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
name: "dashboard"
|
||||
version: "0.0.5"
|
||||
version: "0.0.6"
|
||||
usage: "A simplified way of working with Helm"
|
||||
description: "View HELM situation in nice web UI"
|
||||
command: "$HELM_PLUGIN_DIR/bin/dashboard"
|
||||
command: "$HELM_PLUGIN_DIR/bin/helm-dashboard"
|
||||
hooks:
|
||||
install: "cd $HELM_PLUGIN_DIR; scripts/install_plugin.sh"
|
||||
update: "cd $HELM_PLUGIN_DIR; scripts/install_plugin.sh"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# Copied w/ love from the chartmuseum/helm-push :)
|
||||
|
||||
name="helm-push"
|
||||
name="helm-dashboard"
|
||||
repo="https://github.com/komodorio/${name}"
|
||||
|
||||
if [ -n "${HELM_PUSH_PLUGIN_NO_INSTALL_HOOK}" ]; then
|
||||
@@ -41,9 +41,9 @@ esac
|
||||
|
||||
|
||||
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
|
||||
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
|
||||
url="${repo}/releases/download/v${version}/${name}_${version}_windows_${arch}.tar.gz"
|
||||
fi
|
||||
@@ -55,10 +55,10 @@ mkdir -p "releases/v${version}"
|
||||
|
||||
# Download with curl if possible.
|
||||
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
|
||||
wget -q "${url}" -O "releases/v${version}.tar.gz"
|
||||
fi
|
||||
tar xzf "releases/v${version}.tar.gz" -C "releases/v${version}"
|
||||
mv "releases/v${version}/bin/${name}" "bin/${name}" || \
|
||||
mv "releases/v${version}/bin/${name}.exe" "bin/${name}"
|
||||
mv "releases/v${version}/${name}" "bin/${name}" || \
|
||||
mv "releases/v${version}/${name}.exe" "bin/${name}"
|
||||
|
||||
Reference in New Issue
Block a user