WebHost: fix host room not updating (ports in) slot table (#4308)

This commit is contained in:
black-sliver 2024-12-08 02:22:56 +01:00 committed by GitHub
parent c9625e1b35
commit 6c69f590cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View File

@ -178,8 +178,15 @@
}) })
.then(text => new DOMParser().parseFromString(text, 'text/html')) .then(text => new DOMParser().parseFromString(text, 'text/html'))
.then(newDocument => { .then(newDocument => {
let el = newDocument.getElementById("host-room-info"); ["host-room-info", "slots-table"].forEach(function(id) {
document.getElementById("host-room-info").innerHTML = el.innerHTML; const newEl = newDocument.getElementById(id);
const oldEl = document.getElementById(id);
if (oldEl && newEl) {
oldEl.innerHTML = newEl.innerHTML;
} else if (newEl) {
console.warn(`Did not find element to replace for ${id}`)
}
});
}); });
} }

View File

@ -8,7 +8,7 @@
{%- endmacro %} {%- endmacro %}
{% macro list_patches_room(room) %} {% macro list_patches_room(room) %}
{% if room.seed.slots %} {% if room.seed.slots %}
<table> <table id="slots-table">
<thead> <thead>
<tr> <tr>
<th>Id</th> <th>Id</th>