Added logging number of hits

This commit is contained in:
SinTan1729
2022-11-03 16:53:04 -05:00
parent 0c101a55bf
commit b0e7f1ee57
4 changed files with 23 additions and 6 deletions

View File

@@ -58,8 +58,9 @@
<table class="pure-table">
<thead>
<tr>
<td>Short url</td>
<td>Short URL</td>
<td>Long URL</td>
<td>Hits</td>
<td></td>
</tr>
</thead>

View File

@@ -5,8 +5,9 @@ const refreshData = async () => {
.filter(line => line !== "")
.map(line => line.split(","))
.map(arr => ({
short: arr[0],
long: arr[1],
short: arr[0]
hits: arr[2]
}));
displayData(data);
@@ -23,10 +24,12 @@ const TR = (row) => {
const tr = document.createElement("tr");
const longTD = TD(A(row.long));
const shortTD = TD(A_INT(row.short));
const hitsTD = TD(row.hits);
const btn = deleteButton(row.short);
tr.appendChild(shortTD);
tr.appendChild(longTD);
tr.appendChild(hitsTD);
tr.appendChild(btn);
return tr;