mirror of
https://github.com/IoTManagerProject/IoTManagerWeb.git
synced 2026-03-31 20:39:22 +03:00
убрал баг двойного лога
This commit is contained in:
@@ -289,6 +289,7 @@
|
||||
<button class="btn-lg" on:click={() => saveConfig()}>{"Сохранить на устройстве"}</button>
|
||||
<button class="btn-lg" on:click={() => rebootEsp()}>{"Перезагрузить устройство"}</button>
|
||||
<button class="btn-lg" on:click={() => createExportFile()}>{"Экспорт конфигурации"}</button>
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<label on:click={() => reset()} class="btn-lg cursor-pointer select-none">
|
||||
<input bind:files={files} accept="application/JSON" type="file" id="formFile" />
|
||||
{"Импорт конфигурации"}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
export let saveList = () => {};
|
||||
export let saveSett = () => {};
|
||||
export let sendToAllDevices = (msg) => {};
|
||||
export let applicationReboot = () => {};
|
||||
|
||||
let debug = true;
|
||||
|
||||
@@ -34,7 +35,8 @@
|
||||
function onModeChange() {
|
||||
show = false;
|
||||
saveSett();
|
||||
location.reload();
|
||||
applicationReboot();
|
||||
//location.reload();
|
||||
}
|
||||
|
||||
function onSaveList() {
|
||||
@@ -44,33 +46,22 @@
|
||||
if (showInput) {
|
||||
//если поля были заполнены
|
||||
if (addDevInList()) {
|
||||
show = false;
|
||||
saveList();
|
||||
showInput = false;
|
||||
//window.alert("Устройство было добавленно");
|
||||
setTimeout(() => {
|
||||
location.reload();
|
||||
}, 1000);
|
||||
applicationReboot();
|
||||
} else {
|
||||
showInput = false;
|
||||
}
|
||||
//если не открыли поля для заполнения
|
||||
} else {
|
||||
show = false;
|
||||
saveList();
|
||||
//window.alert("Список устройств сохранен на ESP");
|
||||
setTimeout(() => {
|
||||
location.reload();
|
||||
}, 1000);
|
||||
applicationReboot();
|
||||
}
|
||||
//если авторежим
|
||||
} else {
|
||||
saveList();
|
||||
window.alert("Список устройств сохранен в память ESP. Перейдите в ручной режим для использования сохраненного списка");
|
||||
show = false;
|
||||
setTimeout(() => {
|
||||
location.reload();
|
||||
}, 1000);
|
||||
applicationReboot();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -86,6 +77,7 @@
|
||||
<th class="tbl-hd">Название устройства</th>
|
||||
<th class="tbl-hd">IP адрес</th>
|
||||
<th class="tbl-hd">Идентификатор</th>
|
||||
<th class="tbl-hd">Версия</th>
|
||||
<th class="tbl-hd">Состояние</th>
|
||||
<th class="tbl-hd">Пинг</th>
|
||||
<th class="tbl-hd w-7" />
|
||||
@@ -98,6 +90,7 @@
|
||||
<td class="tbl-bdy-lg ipt-lg w-full">{device.name}</td>
|
||||
<td class="tbl-bdy-lg ipt-lg w-full"><a href={"http://" + device.ip}>{device.ip}</a></td>
|
||||
<td class="tbl-bdy-lg ipt-lg w-full">{device.id}</td>
|
||||
<td class="tbl-bdy-lg ipt-lg w-full">{device.fv ? device.fv : "-"}</td>
|
||||
<td class="tbl-bdy-lg ipt-lg w-full {device.status ? 'bg-green-50' : 'bg-red-50'}">{device.status ? "online" : "offline"}</td>
|
||||
<td class="tbl-bdy-lg ipt-lg w-full">{device.ping ? device.ping : "-"}</td>
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
export let coreMessages;
|
||||
export let settingsJson;
|
||||
|
||||
export let startUpdate = () => {};
|
||||
export let startUpdate = (all) => {};
|
||||
export let saveSett = () => {};
|
||||
export let cleanLogs = () => {};
|
||||
export let rebootEsp = () => {};
|
||||
@@ -163,6 +163,14 @@
|
||||
<p class="text-gray-500 font-bold text-sm text-center truncate">{errorsJson.bn}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mb-2 h-6 items-center">
|
||||
<div class="w-2/3">
|
||||
<p class="pr-4 text-gray-500 font-bold text-sm truncate">Время компиляции</p>
|
||||
</div>
|
||||
<div class="flex justify-center w-1/3">
|
||||
<p class="text-gray-500 font-bold text-sm text-center truncate">{errorsJson.bt ? errorsJson.bt : "-"}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mb-2 h-6 items-center">
|
||||
<div class="w-2/3">
|
||||
<p class="pr-4 text-gray-500 font-bold text-sm truncate">Доступные версии</p>
|
||||
@@ -291,7 +299,42 @@
|
||||
<p class="{errorsJson.rst.toString().includes('Watchdog') || errorsJson.rst.toString().includes('Exception') ? 'text-red-500' : 'text-green-500'} font-bold text-center truncate">{errorsJson.rst}</p>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn-lg" on:click={() => startUpdate()}>{"Обновить прошивку"}</button>
|
||||
<!--
|
||||
NOT_STARTED
|
||||
UPDATE_FS_IN_PROGRESS
|
||||
UPDATE_FS_COMPLETED
|
||||
UPDATE_FS_FAILED
|
||||
UPDATE_BUILD_IN_PROGRESS
|
||||
UPDATE_BUILD_COMPLETED
|
||||
UPDATE_BUILD_FAILED
|
||||
PATH_ERROR
|
||||
-->
|
||||
<div class="flex justify-center text-xs sm:text-sm md:text-base lg:text-base xl:text-base 2xl:text-base break-words">
|
||||
{#if errorsJson.upd === 1}
|
||||
<p class="text-green-500 mb-2 font-bold text-sm text-center truncate">Обновление FS в процессе...</p>
|
||||
{/if}
|
||||
{#if errorsJson.upd === 2}
|
||||
<p class="text-green-500 mb-2 font-bold text-sm text-center truncate">FS обновлено!</p>
|
||||
{/if}
|
||||
{#if errorsJson.upd === 3}
|
||||
<p class="text-red-500 mb-2 font-bold text-sm text-center truncate">Ошибка обновления FS</p>
|
||||
{/if}
|
||||
{#if errorsJson.upd === 4}
|
||||
<p class="text-green-500 mb-2 font-bold text-sm text-center truncate">Обновление Build в процессе...</p>
|
||||
{/if}
|
||||
{#if errorsJson.upd === 5}
|
||||
<p class="text-green-500 mb-2 font-bold text-sm text-center truncate">Build обновлено!</p>
|
||||
{/if}
|
||||
{#if errorsJson.upd === 6}
|
||||
<p class="text-red-500 mb-2 font-bold text-sm text-center truncate">Ошибка обновления Build</p>
|
||||
{/if}
|
||||
{#if errorsJson.upd === 7}
|
||||
<p class="text-red-500 mb-2 font-bold text-sm text-center truncate">Ошибка пути обновления</p>
|
||||
{/if}
|
||||
</div>
|
||||
<button class="btn-lg mb-2" on:click={() => startUpdate(false)}>{"Обновить прошивку"}</button>
|
||||
<button class="btn-lg mb-2" on:click={() => startUpdate(true)}>{"Обновить прошивку на всех устройствах"}</button>
|
||||
<button class="btn-lg" on:click={() => rebootEsp()}>{"Перезагрузить устройство"}</button>
|
||||
</Card>
|
||||
<!--SETTINGS-->
|
||||
<Card title="Системные настройки">
|
||||
@@ -414,7 +457,7 @@
|
||||
|
||||
<!--LOG-->
|
||||
<Card title="Лог" class="z-50">
|
||||
<div class="h-80 overflow-y-auto">
|
||||
<div class="h-96 overflow-y-auto">
|
||||
{#each coreMessages as message, i}
|
||||
<div class={message.msg.toString().includes("[E]") || message.msg.toString().includes("[!]") ? "text-xs text-red-500" : "text-xs text-black"}>{message.msg}</div>
|
||||
{/each}
|
||||
|
||||
Reference in New Issue
Block a user