From 30b33150844df532c381bcaf17d38d68dac2ca87 Mon Sep 17 00:00:00 2001 From: UpstreamData Date: Thu, 24 Feb 2022 15:25:49 -0700 Subject: [PATCH] added the required directories for settings and scanning --- settings/settings.toml | 2 +- tools/web_monitor/app.py | 2 + tools/web_monitor/public/index.html | 123 +++++++++++++++++-------- tools/web_monitor/public/scan.html | 115 +++++++++++++++++++++++ tools/web_monitor/public/settings.html | 115 +++++++++++++++++++++++ tools/web_monitor/static/index.css | 83 +++++++++++++++++ tools/web_monitor/static/index.js | 53 +++++++++++ 7 files changed, 452 insertions(+), 41 deletions(-) create mode 100644 tools/web_monitor/public/scan.html create mode 100644 tools/web_monitor/public/settings.html create mode 100644 tools/web_monitor/static/index.js diff --git a/settings/settings.toml b/settings/settings.toml index aa987959..d67ab1a4 100644 --- a/settings/settings.toml +++ b/settings/settings.toml @@ -11,4 +11,4 @@ reboot_threads = 300 # tool or the privileged API will not work using admin as the password. # If you change the password, you can pass that password here. -whatsminer_pwd = "admin" \ No newline at end of file +whatsminer_pwd = "admin" diff --git a/tools/web_monitor/app.py b/tools/web_monitor/app.py index 650704b0..401835ad 100644 --- a/tools/web_monitor/app.py +++ b/tools/web_monitor/app.py @@ -9,5 +9,7 @@ sio.attach(app) app.static('/', "./public/index.html") app.static('/index.css', "./static/index.css") +app.static('/index.js', "./static/index.js") app.static('/scan', "./public/scan.html") +app.static('/settings', "./public/settings.html") diff --git a/tools/web_monitor/public/index.html b/tools/web_monitor/public/index.html index 81b5f2f6..0298cca6 100644 --- a/tools/web_monitor/public/index.html +++ b/tools/web_monitor/public/index.html @@ -20,53 +20,96 @@ + + + + + + + + -
-
- - - Home - + - -
  • - - -
    -
    -

    hi

    -
    +
    + - - +
    diff --git a/tools/web_monitor/public/scan.html b/tools/web_monitor/public/scan.html new file mode 100644 index 00000000..04335d02 --- /dev/null +++ b/tools/web_monitor/public/scan.html @@ -0,0 +1,115 @@ + + + + + + + + Title + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/web_monitor/public/settings.html b/tools/web_monitor/public/settings.html new file mode 100644 index 00000000..3bd096cf --- /dev/null +++ b/tools/web_monitor/public/settings.html @@ -0,0 +1,115 @@ + + + + + + + + Title + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/web_monitor/static/index.css b/tools/web_monitor/static/index.css index 42b64d41..388b1403 100644 --- a/tools/web_monitor/static/index.css +++ b/tools/web_monitor/static/index.css @@ -47,3 +47,86 @@ main { } .fw-semibold { font-weight: 600; } + +.sidebar { + position: fixed; + top: 0; + /* rtl:raw: + right: 0; + */ + bottom: 0; + /* rtl:remove */ + left: 0; + z-index: 100; /* Behind the navbar */ + padding: 0px 0 0; /* Height of navbar */ + box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1); +} + +@media (max-width: 767.98px) { + .sidebar { + top: 48px; + } +} + +.sidebar-sticky { + position: relative; + top: 0; + height: calc(100vh - 48px); + padding-top: .5rem; + overflow-x: hidden; + overflow-y: auto; +} + +.sidebar .nav-link { + font-weight: 500; + color: #333; +} + +.sidebar .nav-link .feather { + margin-right: 4px; + color: #727272; +} + +.sidebar .nav-link.active { + color: #2470dc; +} + +.sidebar .nav-link:hover .feather, +.sidebar .nav-link.active .feather { + color: inherit; +} + +.sidebar-heading { + font-size: .75rem; + text-transform: uppercase; +} + +.navbar-brand { + padding-top: .75rem; + padding-bottom: .75rem; + font-size: 1rem; + background-color: rgba(0, 0, 0, .25); + box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25); +} + +.navbar .navbar-toggler { + top: .25rem; + right: 1rem; +} + +.navbar .form-control { + padding: .75rem 1rem; + border-width: 0; + border-radius: 0; +} + +.form-control-dark { + color: #fff; + background-color: rgba(255, 255, 255, .1); + border-color: rgba(255, 255, 255, .1); +} + +.form-control-dark:focus { + border-color: transparent; + box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); +} diff --git a/tools/web_monitor/static/index.js b/tools/web_monitor/static/index.js new file mode 100644 index 00000000..7c2402ae --- /dev/null +++ b/tools/web_monitor/static/index.js @@ -0,0 +1,53 @@ +/* globals Chart:false, feather:false */ + +(function () { + 'use strict' + + feather.replace({ 'aria-hidden': 'true' }) + + // Graphs + var ctx = document.getElementById('myChart') + // eslint-disable-next-line no-unused-vars + var myChart = new Chart(ctx, { + type: 'line', + data: { + labels: [ + 'Sunday', + 'Monday', + 'Tuesday', + 'Wednesday', + 'Thursday', + 'Friday', + 'Saturday' + ], + datasets: [{ + data: [ + 15339, + 21345, + 18483, + 24003, + 23489, + 24092, + 12034 + ], + lineTension: 0, + backgroundColor: 'transparent', + borderColor: '#007bff', + borderWidth: 4, + pointBackgroundColor: '#007bff' + }] + }, + options: { + scales: { + yAxes: [{ + ticks: { + beginAtZero: false + } + }] + }, + legend: { + display: false + } + } + }) +})()