diff options
author | Jan200101 <sentrycraft123@gmail.com> | 2022-09-07 13:09:39 +0200 |
---|---|---|
committer | Jan200101 <sentrycraft123@gmail.com> | 2022-09-07 13:09:39 +0200 |
commit | 45f1185a2e219923e26bd58d06a1b5130720fa74 (patch) | |
tree | 53d2a333b2dcfc48af3ebc903b7c5be1a380d1a2 /labbot/addons/dashboard/templates/sidebar.html | |
parent | c7c3468f044acb58f8e3e3341c42135a08e0d380 (diff) | |
download | lab-bot-45f1185a2e219923e26bd58d06a1b5130720fa74.tar.gz lab-bot-45f1185a2e219923e26bd58d06a1b5130720fa74.zip |
Implement Dashboard
Diffstat (limited to 'labbot/addons/dashboard/templates/sidebar.html')
-rw-r--r-- | labbot/addons/dashboard/templates/sidebar.html | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/labbot/addons/dashboard/templates/sidebar.html b/labbot/addons/dashboard/templates/sidebar.html new file mode 100644 index 0000000..f234f54 --- /dev/null +++ b/labbot/addons/dashboard/templates/sidebar.html @@ -0,0 +1,76 @@ +<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse"> + <div class="position-sticky pt-3 sidebar-sticky"> + <ul class="nav flex-column"> + <li class="nav-item"> + <a class="nav-link" aria-current="page" href="/"> + <span data-feather="home" class="align-text-bottom"></span> + Dashboard + </a> + </li> + <li class="nav-item"> + <a class="nav-link" aria-current="page" href="/log"> + <span data-feather="file-text" class="align-text-bottom"></span> + Log + </a> + </li> + <li class="nav-item"> + <a class="nav-link" aria-current="page" href="/settings"> + <span data-feather="settings" class="align-text-bottom"></span> + Bot Settings + </a> + </li> + </ul> + + <h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted text-uppercase"> + <span>Addon Settings</span> + </h6> + <ul class="nav flex-column mb-2"> + {% for addon in bot.addons %} + <li class="nav-item"> + <a class="nav-link" href="/settings/{{ addon }}"> + <span data-feather="file-plus" class="align-text-bottom"></span> + {{ addon }} + </a> + </li> + {% endfor %} + </ul> + + <div class="sidebar-bottom"> + <h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted text-uppercase"> + <span>Health</span> + </h6> + <ul class="nav flex-column mb-2"> + <li class="nav-item"> + <a class="nav-link"> + <span data-feather="heart" class="align-text-bottom"></span> + <span id="bot-health">Unknown</span> + </a> + </li> + </ul> + </div> + </div> +</nav> + +<script> + function getHealth() + { + var href = window.location.href; + var osi = -2; + var nsi = -1; + + while (nsi > osi) + { + osi = nsi; + nsi = href.indexOf("/", nsi+1); + } + href = href.slice(0, osi+1) + "health" + + var xhttp = new XMLHttpRequest(); + xhttp.onload = function() { + document.getElementById("bot-health").innerHTML = this.responseText; + } + xhttp.open("GET", href, true); + xhttp.send() + } + getHealth() +</script>
\ No newline at end of file |