From 4bd510962abd78987b5c1d401c9432ba3981b43a Mon Sep 17 00:00:00 2001 From: Andrei Pohilko Date: Thu, 8 Sep 2022 12:11:21 +0100 Subject: [PATCH] Add "close" button to shutdown the server --- README.md | 1 - pkg/dashboard/static/index.html | 1 + pkg/dashboard/static/scripts.js | 11 ++++++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a8ebc170..74d61ace 100644 --- a/README.md +++ b/README.md @@ -70,4 +70,3 @@ Adding new repository Recognise & show ArgoCD-originating charts/objects Have cleaner idea on the web API structure See if we can build in Chechov or Validkube validation -Add "close" button to shutdown the server, wherever it is \ No newline at end of file diff --git a/pkg/dashboard/static/index.html b/pkg/dashboard/static/index.html index 7e470c49..f6711747 100644 --- a/pkg/dashboard/static/index.html +++ b/pkg/dashboard/static/index.html @@ -47,6 +47,7 @@ + diff --git a/pkg/dashboard/static/scripts.js b/pkg/dashboard/static/scripts.js index 5415d6d1..85a6d1bc 100644 --- a/pkg/dashboard/static/scripts.js +++ b/pkg/dashboard/static/scripts.js @@ -346,4 +346,13 @@ function showResources(namespace, chart, revision) { } }) -} \ No newline at end of file +} + +$(".fa-power-off").click(function () { + $.ajax({ + url: "/", + type: 'DELETE', + }).done(function () { + window.close(); + }) +}) \ No newline at end of file