Changeset - 22d02efb8aa2
[Not reviewed]
0 2 0
x - 15 months ago 2024-01-05 02:42:39
xbr@c3l.lu
feat: replace appending with replacing of the table
2 files changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
frontend/index.html
Show inline comments
 
@@ -12,9 +12,10 @@
 
			<p class="countup__item countup__tls"><span id="time__tls">?</span> days</p>
 
			<p class="countup__item countup__text">since last outage caused by TLS expiry</p>
 
    </div>
 

	
 
    <div class="logs" id="logs">
 
        <p class="logs__title">Last incidents</p>
 
        <table id="logs__table"></table>
 
    </div>
 
	</body>
 
</html>
frontend/script.js
Show inline comments
 
@@ -28,14 +28,15 @@ function generateTable(data) {
 

	
 
        tableBody.appendChild(row);
 
    }
 

	
 
    const table = document.createElement("table");
 
    table.classList.add("logs__table");
 
    table.id = "logs__table";
 
    table.appendChild(tableBody);
 
    document.getElementById("logs").appendChild(table);
 
    document.getElementById("logs__table").replaceWith(table);
 
    } catch (e) {}
 
}
 

	
 
function setRecentDate(data) {
 
    console.log(data);
 
    let mostRecentDate = 0;
0 comments (0 inline, 0 general)