13
0

WebSockets: update index page JS to reflect latest two commits changes

This commit is contained in:
Luciano Iam 2020-04-12 10:44:14 +02:00 committed by Robin Gareus
parent 30c8563a6d
commit 198590bc94
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -22,17 +22,17 @@ import { Ardour } from '/shared/ardour.js';
async function main () {
try {
const index = await new Ardour().getAvailableSurfaces();
printIndex(index);
const surfaces = await new Ardour().getAvailableSurfaces();
printSurfaces(surfaces);
} catch (err) {
printError(`Error loading index: ${err.message}`);
printError(`Error loading surfaces list: ${err.message}`);
}
document.getElementById('loading').style.display = 'none';
}
function printIndex (index) {
for (const group of index) {
function printSurfaces (surfaces) {
for (const group of surfaces) {
const ul = document.querySelector(`#${group.path} > ul`);
const li = document.createElement('li');