Skip to content

Commit

Permalink
Web-ui: Fix overlapping info/log after pressing refresh button
Browse files Browse the repository at this point in the history
  • Loading branch information
tueddy committed Nov 4, 2023
1 parent 49e2fdc commit 2070f00
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## DEV-branch

* 31.10.2023: Code Formatting via clang-format #264, thank's to @laszloh & @fschrempf !!
* 03.11.2023: Web-ui: Fix overlapping info/log after pressing refresh button
* 01.11.2023: Fix folder upload with special chars & playtime formatting
* 31.10.2023: Code Formatting via clang-format #264, thank's to @laszloh & @fschrempf !!


## Version 2 (29.10.2023)
Expand Down
30 changes: 24 additions & 6 deletions html/management.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
</select>
</div>
</nav>
<!-- Modal dialog for info / log / restart-->
<!-- Modal dialog for info / shutdown / restart-->
<div class="modal fade bd-info-modal-xl" id="modalInfo" role="dialog">
<div class="modal-dialog modal-xl modal-dialog-scrollable" role="document">
<div class="modal-content">
Expand All @@ -179,6 +179,23 @@ <h5 class="modal-title">Infos</h5>
</div>
</div>
</div>
<!-- Modal dialog for log-->
<div class="modal fade bd-info-modal-xl" id="modalLog" role="dialog">
<div class="modal-dialog modal-xl modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Infos</h5>
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<div class="modal-body" style="white-space: pre" id="modalLogContent">
</div>
<div class="modal-footer">
<button type="button" id="modalLogRefresh" class="btn mr-auto"><i class="fas fa-sync"></i><span data-i18n="refresh">Refresh</span></button>
<button type="button" class="btn btn-default" data-dismiss="modal">OK</button>
</div>
</div>
</div>
</div>
<!-- Modal dialog for delete SSID-->
<div class="modal fade" id="deleteSSIDModal" role="dialog">
<div class="modal-dialog" role="document">
Expand Down Expand Up @@ -2059,13 +2076,11 @@ <h5 class="modal-title" data-i18n="tools.nvserase.title"></h5>
hslastwaitforstate: info.hallsensor.lastWaitState, hswaited: info.hallsensor.lastWaitMS}) + "\n";
}
$('#modalInfoContent').text(content);
$("#modalInfoContent").css("font-family","inherit");
}

async function fetchLog() {
let logtext = await (await fetch("/log")).text();
$('#modalInfoContent').text(logtext);
$("#modalInfoContent").css("font-family","monospace");
$('#modalLogContent').text(logtext);
}

$(document).ready(function () {
Expand Down Expand Up @@ -2095,13 +2110,16 @@ <h5 class="modal-title" data-i18n="tools.nvserase.title"></h5>
$('.openPopupLog').on('click', function () {
fetchLog();
$('.modal-title').text(i18next.t("log"));
$('#modalInfoRefresh').on('click', fetchLog);
$('#modalInfo').modal({show: true});
$("#modalLogContent").css("font-family", "monospace");
$('#modalLogRefresh').on('click', fetchLog);
$('#modalLog').modal({show: true});
})
$('.openPopupRestart').on('click', function(){
$('#modalInfoRefresh').hide();
restartDevice();
});
$('.openPopupShutdown').on('click', function(){
$('#modalInfoRefresh').hide();
shutdownDevice();
});

Expand Down
2 changes: 1 addition & 1 deletion src/revision.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma once

#include "gitrevision.h"
constexpr const char softwareRevision[] = "Software-revision: 20231101-1";
constexpr const char softwareRevision[] = "Software-revision: 20231103-1";

0 comments on commit 2070f00

Please sign in to comment.