diff --git a/gui/app.js b/gui/app.js index 604efe6..234146b 100644 --- a/gui/app.js +++ b/gui/app.js @@ -87,18 +87,19 @@ function ui_show_window(window_name) { } /** - * Обновляет список портов + * Обновляет список доступных портов */ function refresh_ports() { const port_selector = document.getElementById('port_selector'); webui.call('webui_refresh_ports').then((response) => { - // const ports_array = JSON.parse(response); const ports_array = response; - // Проверка длины массива + // Выводит уведомление о доступных устройствах if (ports_array.ports.length > 0) { port_selector.innerHTML = ''; + // BUG: Нет пробела между двоеточием и количеством устройств + alert(`Доступных портов: ${ports_array.ports.length}`); } else { alert('Отсутсвуют подключённые устройства!'); return 1; diff --git a/src/main.c b/src/main.c index 703c916..9978039 100644 --- a/src/main.c +++ b/src/main.c @@ -15,7 +15,7 @@ int main(int argc, char const *argv[]) { html_document[html_document_len] = '\0'; -#ifdef DEBUG +#ifndef DEBUG webui_set_kiosk(app_window, true); #endif @@ -23,6 +23,8 @@ int main(int argc, char const *argv[]) { webui_bind(app_window, "webui_refresh_ports", refresh_devices); webui_bind(app_window, "webui_connect_device", connect_device); + printf("Enjoy :)\n"); + webui_show(app_window, html_document); webui_wait();