diff --git a/code/html/custom.css b/code/html/custom.css index a83594ce..07f2c8e2 100644 --- a/code/html/custom.css +++ b/code/html/custom.css @@ -14,20 +14,29 @@ .page { margin-top: 40px; } -.center { - text-align: center; -} .pure-button { color: white; - padding: 8px 16px; + padding: 8px 12px; border-radius: 4px; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); } -.button-update { - width: 100px; +.main-buttons { margin: 50px auto; + text-align: center; +} +.main-buttons button { + width: 100px; + margin: 5px auto; +} +.button-update { background: #1f8dd6; } +.button-reset { + background: rgb(202, 60, 60); +} +.button-reconnect { + background: rgb(202, 60, 60); +} .pure-g { margin-bottom: 20px; } diff --git a/code/html/custom.js b/code/html/custom.js index 9e69cb8a..bdd44729 100644 --- a/code/html/custom.js +++ b/code/html/custom.js @@ -15,6 +15,28 @@ function doUpdate() { }); } +function doReset() { + var response = window.confirm("Are you sure you want to reset the device?"); + if (response == false) return; + var self = $(this); + self.addClass("loading"); + $.ajax({ + 'method': 'GET', + 'url': '/reset' + }); +} + +function doReconnect() { + var response = window.confirm("Are you sure you want to disconnect from the current WIFI network?"); + if (response == false) return; + var self = $(this); + self.addClass("loading"); + $.ajax({ + 'method': 'GET', + 'url': '/reconnect' + }); +} + function showPanel() { $(".panel").hide(); $("#" + $(this).attr("data")).show(); @@ -113,6 +135,8 @@ function init() { $("#menuLink").on('click', toggleMenu); $(".button-update").on('click', doUpdate); + $(".button-reset").on('click', doReset); + $(".button-reconnect").on('click', doReconnect); $(".pure-menu-link").on('click', showPanel); var host = window.location.hostname; diff --git a/code/html/index.html b/code/html/index.html index 8892db9a..023021ad 100644 --- a/code/html/index.html +++ b/code/html/index.html @@ -36,6 +36,10 @@ STATUS +