diff options
author | salt.jeong <salt.jeong@samsung.com> | 2020-08-11 19:26:39 +0900 |
---|---|---|
committer | salt.jeong <salt.jeong@samsung.com> | 2020-08-11 19:26:39 +0900 |
commit | 7dfb4f3f9d71c0089ec28f31bc0d7d8fe2666c7b (patch) | |
tree | 0f72da2acadc66d685eab44cd4ee9a1f114f5c2b | |
parent | a60130316ba87a0bde50d3bdd1558d86e72325e8 (diff) | |
download | smart-surveillance-camera-7dfb4f3f9d71c0089ec28f31bc0d7d8fe2666c7b.tar.gz smart-surveillance-camera-7dfb4f3f9d71c0089ec28f31bc0d7d8fe2666c7b.tar.bz2 smart-surveillance-camera-7dfb4f3f9d71c0089ec28f31bc0d7d8fe2666c7b.zip |
Add Send Message Buttontelevision_2020
Change-Id: I6cca14acbbbf3bba95a2e7b7b5c8c45247944e76
-rw-r--r-- | dashboard/res/public/css/style.css | 29 | ||||
-rw-r--r-- | dashboard/res/public/index.html | 1 | ||||
-rw-r--r-- | dashboard/res/public/js/app.js | 7 | ||||
-rw-r--r-- | dashboard/res/server.js | 4 |
4 files changed, 39 insertions, 2 deletions
diff --git a/dashboard/res/public/css/style.css b/dashboard/res/public/css/style.css index 3f47f37..e19d55c 100644 --- a/dashboard/res/public/css/style.css +++ b/dashboard/res/public/css/style.css @@ -43,8 +43,8 @@ padding: 20px; } -.myButton { - margin-right: 30px; +.myButton, .myButton3 { + margin-right: 20px; } .myButton { @@ -96,3 +96,28 @@ position:relative; top:1px; } + +.myButton3 { + box-shadow:inset 0px 1px 0px 0px #bbdaf7; + background:linear-gradient(to bottom, #79bbff 5%, #378de5 100%); + background-color:#79bbff; + border-radius:6px; + border:1px solid #84bbf3; + display:inline-block; + cursor:pointer; + color:#ffffff; + font-family:Arial; + font-size:15px; + font-weight:bold; + padding:6px 24px; + text-decoration:none; + text-shadow:0px 1px 0px #528ecc; +} +.myButton3:hover { + background:linear-gradient(to bottom, #378de5 5%, #79bbff 100%); + background-color:#378de5; +} +.myButton3:active { + position:relative; + top:1px; +} diff --git a/dashboard/res/public/index.html b/dashboard/res/public/index.html index 29406f6..d88d726 100644 --- a/dashboard/res/public/index.html +++ b/dashboard/res/public/index.html @@ -24,6 +24,7 @@ </div> <div class="switch-box"> + <a href="#" id="button-msg" class="myButton3">Send Message</a> <a href="#" id="button-on" class="myButton">ON</a> <a href="#" id="button-off" class="myButton2">OFF</a> </div> diff --git a/dashboard/res/public/js/app.js b/dashboard/res/public/js/app.js index 3048b6b..3e57a04 100644 --- a/dashboard/res/public/js/app.js +++ b/dashboard/res/public/js/app.js @@ -73,6 +73,13 @@ window.onload = function(){ console.log(res); }) }); + + var buttonMsgElement = document.getElementById('button-msg'); + buttonMsgElement.addEventListener('click', function () { + httpGetAsync("/command/send", function (res){ + console.log(res); + }) + }); }; function httpGetAsync(theUrl, callback) diff --git a/dashboard/res/server.js b/dashboard/res/server.js index dbb0f31..3f07e2f 100644 --- a/dashboard/res/server.js +++ b/dashboard/res/server.js @@ -61,6 +61,10 @@ http.createServer(function(req, res) { res.writeHead(200);
res.end();
sendCommand("off");
+ } else if (req.url == '/command/send') {
+ res.writeHead(200);
+ res.end();
+ sendCommand("send");
} else {
res.writeHead(404);
res.end();
|