mirror of https://github.com/OpenIPC/firmware.git
[no ci] Update wifibroadcast-ng
parent
f46e846ad5
commit
18bb2419fe
|
@ -230,8 +230,8 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<label for="serial">Serial:</label>
|
<label for="serial">Serial:</label>
|
||||||
<select id="serial" name="wfb.telemetry.serial">
|
<select id="serial" name="wfb.telemetry.serial">
|
||||||
<option value="ttyS0">/dev/ttyS0</option>
|
<option value="ttyS0">ttyS0</option>
|
||||||
<option value="ttyS2">/dev/ttyS2</option>
|
<option value="ttyS2">ttyS2</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -272,10 +272,23 @@
|
||||||
Object.keys(data).forEach((section) => {
|
Object.keys(data).forEach((section) => {
|
||||||
Object.keys(data[section]).forEach((key) => {
|
Object.keys(data[section]).forEach((key) => {
|
||||||
const field = document.getElementsByName(formPrefix + '.' + section + '.' + key)[0];
|
const field = document.getElementsByName(formPrefix + '.' + section + '.' + key)[0];
|
||||||
if (field) {
|
if (!field) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const isCheckbox = field.type === "checkbox";
|
||||||
|
const value = data[section][key];
|
||||||
|
|
||||||
if (mode === "setup") {
|
if (mode === "setup") {
|
||||||
field.value = data[section][key];
|
if (isCheckbox) {
|
||||||
|
field.checked = value === true;
|
||||||
|
} else {
|
||||||
|
field.value = value;
|
||||||
|
}
|
||||||
} else if (mode === "update") {
|
} else if (mode === "update") {
|
||||||
|
if (isCheckbox) {
|
||||||
|
data[section][key] = field.checked;
|
||||||
|
} else {
|
||||||
data[section][key] = field.value;
|
data[section][key] = field.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -311,16 +324,18 @@
|
||||||
document.getElementById(buttonId).addEventListener('click', function () {
|
document.getElementById(buttonId).addEventListener('click', function () {
|
||||||
if (configKey && configData[configKey]) {
|
if (configKey && configData[configKey]) {
|
||||||
syncForm(configData[configKey], configKey, "update");
|
syncForm(configData[configKey], configKey, "update");
|
||||||
|
var yamlPath = '/etc/' + configKey + '.yaml';
|
||||||
uploadYAML(configData[configKey], yamlPath);
|
uploadYAML(configData[configKey], yamlPath);
|
||||||
}
|
}
|
||||||
executeDelay(this, command);
|
executeDelay(this, command);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
addClickListener('apply-video-button', 'killall -1 majestic', 'majestic', '/etc/majestic.yaml');
|
addClickListener('apply-video-button', 'killall -1 majestic', 'majestic');
|
||||||
addClickListener('apply-wfb-button', 'wifibroadcast start', 'wfb', '/etc/wfb.yaml');
|
addClickListener('apply-wfb-button', 'wifibroadcast start', 'wfb');
|
||||||
addClickListener('reset-wfb-button', 'wifibroadcast resetw');
|
|
||||||
addClickListener('reset-video-button', 'wifibroadcast resetv');
|
addClickListener('reset-video-button', 'wifibroadcast resetv');
|
||||||
|
addClickListener('reset-wfb-button', 'wifibroadcast resetw');
|
||||||
|
|
||||||
loadYAML('/etc/majestic.yaml', (data) => {
|
loadYAML('/etc/majestic.yaml', (data) => {
|
||||||
configData.majestic = data;
|
configData.majestic = data;
|
||||||
|
|
Loading…
Reference in New Issue