Skip to content

Commit b3b1165

Browse files
committed
[Add] Added "Reboot Camera" to the web interface
1 parent b60bdd9 commit b3b1165

File tree

6 files changed

+53
-1
lines changed

6 files changed

+53
-1
lines changed

src/www/httpd/cgi-bin/reboot.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
printf "Content-type: application/json\r\n\r\n"
4+
5+
# Yeah, it's pretty ugly.. but hey, it works.
6+
7+
sync
8+
reboot
9+
10+
printf "{\n"
11+
printf "}"
12+

src/www/httpd/htdocs/css/custom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ table.padded-table td:last-child {
139139
/*text-shadow: 0.01px 0 0 currentColor;*/
140140
}
141141

142+
li.nav-elem-right {
143+
float: right;
144+
}
145+
142146
/* The switch - the box around the slider */
143147
.switch {
144148
position: relative;

src/www/httpd/htdocs/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
<li>
4848
<a href="/?page=about">About</a>
4949
</li>
50+
<li class="nav-elem-right">
51+
<a href="/?page=reboot">Reboot Camera</a>
52+
</li>
5053
<li class="icon">
5154
<a class="nav-toggler">&#9776;</a>
5255
</li>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
var APP = APP || {};
2+
3+
APP.reboot = (function ($) {
4+
5+
var timeoutVar;
6+
7+
function init() {
8+
rebootCamera();
9+
}
10+
11+
function rebootCamera() {
12+
$.ajax({
13+
type: "GET",
14+
url: 'cgi-bin/reboot.sh',
15+
dataType: "json",
16+
error: function(response) {
17+
console.log('error', response);
18+
}
19+
});
20+
}
21+
22+
return {
23+
init: init
24+
};
25+
26+
})(jQuery);

src/www/httpd/htdocs/pages/configurations.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ <h3 class="no-margin" id="header">Configurations</h3>
66
<div class="row">
77
<p>Here you can enable/disable services.</p>
88
<p>
9-
<strong>Any changes will take effect at reboot of the camera.</strong>
9+
<strong>Any change will take effect after the reboot of the camera.</strong>
1010
</p>
1111
</div>
1212

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<div class="row">
2+
<div class="twelf columns">
3+
<h3 class="no-margin" id="header">Reboot</h3>
4+
<hr class="tiny-margin" />
5+
Rebooting the camera.
6+
</div>
7+
</div>

0 commit comments

Comments
 (0)