Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/views/device-manage.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
<th>{{Reboot Device}}</th>
<th><button type='button' class='btn btn-success' onclick='reboot("{{{listeners}}}", "{{name}}", "{{exclude_reboots}}")'>{{REBOOT}}</button></th>
<th><div id='reboot'></div></th>
</tr>
<th>{{Brightness}}</th>
<!--<form action="http://{{clientip}}:{{webserver_port}}/brightness?value=100" method="post">-->
<th>
<input type="range" min="0" max="100" value="50" class="slider" onchange="sendBrightness(this);" id="brightness">
</th>
<th></th>
</tr>
<tr>
<th>{{Device Logs}}</th>
Expand Down Expand Up @@ -185,6 +192,26 @@
});
}

function sendBrightness(brightnessElement) {
const clientip = $('#client_ip').val();
const brightness = $('#brightness').val();
const url = `http://${clientip}:{{webserver_port}}/brightness?value=${brightness}`;
console.log('brightness:', url);
$.ajax({
url: url,
type: 'POST',
async: true,
success: function (result, textStatus, jqXHR) {
//$('#' + id).text(text);
},
error: function(xhr, textStatus, errorThrown) {
//$('#' + id).text('Error');
console.error('Error:', textStatus);
console.error('Error Thrown:', errorThrown);
}
});
}

function sendImageData(id, imageData) {
$.ajax({
url: '/api/device/screen/{{name}}',
Expand Down
3 changes: 2 additions & 1 deletion static/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,6 @@
"Timezone": "Timezone",
"Clear Device IP Addresses": "Clear Device IP Addresses",
"Model": "Model",
"Exclude From Reboots": "Exclude From Reboots"
"Exclude From Reboots": "Exclude From Reboots",
"Brightness": "Helligkeit"
}
3 changes: 2 additions & 1 deletion static/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,6 @@
"Timezone": "Timezone",
"Clear Device IP Addresses": "Clear Device IP Addresses",
"Model": "Model",
"Exclude From Reboots": "Exclude From Reboots"
"Exclude From Reboots": "Exclude From Reboots",
"Brightness": "Brightness"
}
3 changes: 2 additions & 1 deletion static/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,6 @@
"Timezone": "Timezone",
"Clear Device IP Addresses": "Clear Device IP Addresses",
"Model": "Model",
"Exclude From Reboots": "Exclude From Reboots"
"Exclude From Reboots": "Exclude From Reboots",
"Brightness": "Brightness"
}