mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-06 11:36:59 +03:00
UI for GPIO pins
This commit is contained in:
@@ -206,6 +206,26 @@ $(document).ready(function(){
|
||||
console.log('sent config JSON with headers:', autoexec1);
|
||||
});
|
||||
|
||||
$("#save-gpio").on("click", function() {
|
||||
var headers = {};
|
||||
$("input.gpio").each(function() {
|
||||
var id = $(this)[0].id;
|
||||
var pin = $(this).val();
|
||||
if (pin != '') {
|
||||
headers[id] = pin;
|
||||
}
|
||||
});
|
||||
$.ajax({
|
||||
url: '/config.json',
|
||||
dataType: 'json',
|
||||
method: 'POST',
|
||||
cache: false,
|
||||
headers: JSON.stringify(headers),
|
||||
data: { 'timestamp': Date.now() }
|
||||
});
|
||||
console.log('sent config JSON with headers:', JSON.stringify(headers));
|
||||
});
|
||||
|
||||
$("#flash").on("click", function() {
|
||||
var url = $("#fwurl").val();
|
||||
$.ajax({
|
||||
@@ -260,7 +280,7 @@ $(document).ready(function(){
|
||||
var [ver, idf, cfg, branch] = release.name.split('#');
|
||||
var body = release.body.replace(/\\n/ig, "<br />").replace(/\'/ig, "\"");
|
||||
var [date, time] = release.created_at.split('T');
|
||||
if (ver.match(/esp-idf/)) next; //TODO delete
|
||||
if (ver.match(/esp-idf/)) return; //TODO delete
|
||||
$("#releaseTable").append(
|
||||
"<tr>"+
|
||||
"<td data-toggle='tooltip' title='"+body+"'>"+ver+"</td>"+
|
||||
|
||||
@@ -197,6 +197,61 @@
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="tab-gpio">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Signal</th>
|
||||
<th scope="col">GPIO pin</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="releaseTable">
|
||||
<tr>
|
||||
<td><strong>I2S</strong></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>I2S Bit clock</td>
|
||||
<td>
|
||||
<input type="text" class="form-control gpio" id="gpio-i2s-bc" maxlength="2" size="2">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>I2S Word select</td>
|
||||
<td>
|
||||
<input type="text" class="form-control gpio" id="gpio-i2s-ws" maxlength="2" size="2">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>I2S Data</td>
|
||||
<td>
|
||||
<input type="text" class="form-control gpio" id="gpio-i2s-data" maxlength="2" size="2">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>SPDIF</strong></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SPDIF Bit clock</td>
|
||||
<td>
|
||||
<input type="text" class="form-control gpio" id="spdif-i2s-bc" maxlength="2" size="2">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SPDIF Word select</td>
|
||||
<td>
|
||||
<input type="text" class="form-control gpio" id="spdif-i2s-ws" maxlength="2" size="2">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SPDIF Data</td>
|
||||
<td>
|
||||
<input type="text" class="form-control gpio" id="spdif-i2s-data" maxlength="2" size="2">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="buttons">
|
||||
<input id="save-gpio" type="button" class="btn btn-success" value="Save" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="tab-system">
|
||||
|
||||
@@ -213,6 +213,12 @@ input[type='text'], input[type='password'], textarea {
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
input.gpio {
|
||||
width: 2em;
|
||||
color: #000;
|
||||
height: 1.8em;
|
||||
}
|
||||
|
||||
.custom-switch, .custom-radio {
|
||||
padding-left: 2.25rem;
|
||||
margin-left: 12px;
|
||||
|
||||
Reference in New Issue
Block a user