close button for debug info

This commit is contained in:
Steven Hugg 2024-01-01 15:27:42 -05:00
parent 47a7aa5a83
commit 579e58e966
3 changed files with 15 additions and 6 deletions

View File

@ -127,13 +127,15 @@ div.mem_info {
bottom: 10px; bottom: 10px;
background-color: #333; background-color: #333;
color: #66ff66; color: #66ff66;
white-space: pre;
padding: 20px;
z-index: 12; z-index: 12;
font-family: "Andale Mono", "Menlo", "Lucida Console", monospace; font-family: "Andale Mono", "Menlo", "Lucida Console", monospace;
font-size: 12pt; font-size: 12pt;
box-shadow: 0px 0px 8px rgba(0,0,0,.5); box-shadow: 0px 0px 8px rgba(0,0,0,.5);
max-height: 90vh; }
div.mem_info_msg {
white-space: pre;
padding: 20px;
max-height: 80vh;
overflow-y: auto; overflow-y: auto;
} }
div.mem_info a { div.mem_info a {
@ -148,6 +150,9 @@ div.mem_info a:hover {
div.mem_info a.selected { div.mem_info a.selected {
color: #ffffff; color: #ffffff;
} }
div.mem_info button {
color: #fff;
}
.mem_info_links { .mem_info_links {
text-align:right; text-align:right;
} }

View File

@ -378,6 +378,8 @@ body {
</div> </div>
</div> </div>
<div id="mem_info" class="mem_info" style="display:none"> <div id="mem_info" class="mem_info" style="display:none">
<div><button type="button" class="close" onclick="$('.mem_info').hide()" aria-hidden="true">&times;</button></div>
<div id="mem_info_msg" class="mem_info_msg"></div>
</div> </div>
<div id="error_alert" class="alert alert-danger alert-dismissable" style="position:absolute;right:0;top:0;display:none"> <div id="error_alert" class="alert alert-danger alert-dismissable" style="position:absolute;right:0;top:0;display:none">
<button type="button" class="close" onclick="$('.alert').hide()" aria-hidden="true">&times;</button> <button type="button" class="close" onclick="$('.alert').hide()" aria-hidden="true">&times;</button>

View File

@ -909,13 +909,15 @@ function hideDebugInfo() {
function showDebugInfo(state?) { function showDebugInfo(state?) {
if (!isDebuggable(platform)) return; if (!isDebuggable(platform)) return;
var meminfo = $("#mem_info"); var meminfo = $("#mem_info");
var meminfomsg = $("#mem_info_msg");
var allcats = platform.getDebugCategories(); var allcats = platform.getDebugCategories();
if (allcats && !debugCategory) if (allcats && !debugCategory)
debugCategory = allcats[0]; debugCategory = allcats[0];
var s = state && platform.getDebugInfo(debugCategory, state); var s = state && platform.getDebugInfo(debugCategory, state);
if (s) { if (s) {
var hs = lastDebugInfo ? highlightDifferences(lastDebugInfo, s) : s; var hs = lastDebugInfo ? highlightDifferences(lastDebugInfo, s) : s;
meminfo.show().html(hs); meminfo.show();
meminfomsg.html(hs);
var catspan = $('<div class="mem_info_links">'); var catspan = $('<div class="mem_info_links">');
var addCategoryLink = (cat:string) => { var addCategoryLink = (cat:string) => {
var catlink = $('<a>'+cat+'</a>'); var catlink = $('<a>'+cat+'</a>');
@ -932,8 +934,8 @@ function showDebugInfo(state?) {
for (var cat of allcats) { for (var cat of allcats) {
addCategoryLink(cat); addCategoryLink(cat);
} }
meminfo.append('<br>'); meminfomsg.append('<br>');
meminfo.append(catspan); meminfomsg.append(catspan);
lastDebugInfo = s; lastDebugInfo = s;
} else { } else {
hideDebugInfo(); hideDebugInfo();