Skip to content

Commit

Permalink
correct table data.
Browse files Browse the repository at this point in the history
  • Loading branch information
b4den committed Jul 11, 2024
1 parent aa4d241 commit 052dca0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
2 changes: 2 additions & 0 deletions wasm/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ <h1 class="uk-heading-divider">Offline HSM Attestation</h1>
<a href="#">Verify Bundle</a>
</li>
</ul>

<div id="table_container" class="attestation_table uk-section-small"></div>
</div>


Expand Down
24 changes: 9 additions & 15 deletions wasm/scriptmod.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,14 @@ var Singleton = (async () => {


function clearTable() {
let table = document.getElementsByClassName("attestation_table");
if (table && table.length > 0) table.remove();
//for (const element of document.getElementsByClassName("attestation_table")) {
// try {
// element.remove();
// //element.parentELement.remove();
// } catch (e) {}
//}
//document.getElementById("attestation_table").remove();

let table = document.getElementById("table_container");
while (table.firstChild) {
table.firstChild.remove();
}
}

function toTable(parsed_attestation) {
let table = '<div id="table_container" class="attestation_table uk-section-small uk-overflow-auto"><table id="attestation_table" class="uk-table uk-table-striped" style="table-layout: fixed; width: 100%">';
let table = '<table class="uk-table uk-table-striped attr_table" style="table-layout: fixed; width: 100%">';
table += "<tr><th>Attribute Name</th><th>Value</th></tr>";

for (i = 0; i < parsed_attestation.length; i++) {
Expand All @@ -66,10 +60,10 @@ var Singleton = (async () => {
});
}

table += '</table></div>';
//document.body.insertAdjacentHTML('beforeend', table);
document.getElementById("main_container").insertAdjacentHTML('beforeend', table);
//document.body.innerHTML += table;
table += '</table>';

let fragment = document.createRange().createContextualFragment(table);
document.getElementById("table_container").appendChild(fragment);
}

function toTableSplit(parsed_attestation) {
Expand Down

0 comments on commit 052dca0

Please sign in to comment.