Page MenuHomeSealhub

template.html
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

template.html

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="https://unpkg.com/tabulator-tables@6.3.1/dist/css/tabulator.min.css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/tabulator-tables@6.3.1/dist/js/tabulator.min.js"></script>
<script type="module">
<!-- REPLACE ME -->
window.HARParser = HARParser;
</script>
</head>
<body>
<div id="example-table"></div>
<div id="root"></div>
<form>
<input type="file" id="file"></input>
</form>
</body>
</html>
<script>
document.getElementById('file').addEventListener('change', readFile, false);
async function readFile(evt) {
var files = evt.target.files;
var file = files[0];
const parser = new window.HARParser(file);
let a = await parser.try_parse();
console.log(a);
var tabledata = [];
var curr_id = 0;
for (const [domain, records] of parser.kv.entries()) {
for (const rec of records) {
let path = "";
for (const path_part of rec.path) {
path += path_part;
path += " -> ";
}
path += rec.value;
tabledata.push({
id: curr_id,
domain: domain,
path: path,
})
curr_id++;
}
}
//create Tabulator on DOM element with id "example-table"
var table = new Tabulator("#example-table", {
height:'100vh', // set height of table (in CSS or here), this enables the Virtual DOM and improves render speed dramatically (can be any valid css height value)
data:tabledata, //assign data to table
layout:"fitColumns", //fit columns to width of table (optional)
columns:[ //Define Table Columns
{title:"Domain", field:"domain", width:150},
{title:"Path", field:"path"},
],
});
}
</script>

File Metadata

Mime Type
text/html
Expires
Fri, Nov 27, 20:25 (3 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1229571
Default Alt Text
template.html (1 KB)

Event Timeline