WebHost: fix host room not updating (ports in) slot table (#4308)
This commit is contained in:
parent
c9625e1b35
commit
6c69f590cf
|
@ -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}`)
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue