added translation option to UI and serve

This commit is contained in:
Dobromir Popov
2024-06-10 00:35:45 +03:00
parent 71f075dd63
commit a5f1040cef
2 changed files with 21 additions and 1 deletions

View File

@ -129,6 +129,15 @@ disabled
credentials: 'same-origin'
});
});
document.getElementById('task-select').addEventListener('change', (event) => {
const task = event.target.value;
fetch('/settings', {
method: 'POST',
body: JSON.stringify({ task, sessionId }),
headers: { 'Content-Type': 'application/json' },
credentials: 'same-origin'
});
});
// Draw sliding bar graph
function drawSlidingBarGraph(lastVolumes) {
@ -265,6 +274,11 @@ disabled
if (json.hasOwnProperty("language")) {
languageSelect.value = json.language;
}
if (json.hasOwnProperty("taskSelect")) {
taskSelect.value = json.taskSelect;
}
//storerecordings checkbox
if (json.hasOwnProperty("storeRecordings")) {
storeRecordings.checked = json.storeRecordings;
@ -488,6 +502,7 @@ disabled
languageSelect = document.getElementById("language-select");
inputDevices = document.getElementById("input-devices");
storeRecordings = document.getElementById("store-recordings");
taskSelect = document.getElementById("task-select");
enumerateDevices();
connect(socket);