Skip to content

Commit

Permalink
Merge branch 'master' into globalbrightness
Browse files Browse the repository at this point in the history
  • Loading branch information
versx authored Jul 15, 2021
2 parents 490cc99 + 04a472f commit 3d4077c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
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 @@ -145,5 +145,6 @@
"Clear Device IP Addresses": "Clear Device IP Addresses",
"Model": "Model",
"Exclude From Reboots": "Exclude From Reboots",
"Dimm All Devices": "Dimm All Devices"
"Dimm All Devices": "Dimm All Devices",
"Brightness": "Helligkeit"
}
3 changes: 2 additions & 1 deletion static/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,6 @@
"Clear Device IP Addresses": "Clear Device IP Addresses",
"Model": "Model",
"Exclude From Reboots": "Exclude From Reboots",
"Dimm All Devices": "Dimm All Devices"
"Dimm All Devices": "Dimm All Devices",
"Brightness": "Brightness"
}
3 changes: 2 additions & 1 deletion static/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,6 @@
"Clear Device IP Addresses": "Clear Device IP Addresses",
"Model": "Model",
"Exclude From Reboots": "Exclude From Reboots",
"Dimm All Devices": "Dimm All Devices"
"Dimm All Devices": "Dimm All Devices",
"Brightness": "Brightness"
}

0 comments on commit 3d4077c

Please sign in to comment.