aboutsummaryrefslogtreecommitdiff
path: root/src/html/admin.html
diff options
context:
space:
mode:
authorMark Powers <markppowers0@gmail.com>2019-03-17 12:46:36 -0400
committerMark Powers <markppowers0@gmail.com>2019-03-17 12:46:36 -0400
commiteab2c0e7e62c8aef94686b543578049f664fcd3a (patch)
tree251c6a77d29cbc3311cc937a330416e0e0553339 /src/html/admin.html
parentc30218c68330f1dbcca99983f2f7f7d5274b1832 (diff)
Update stats
Diffstat (limited to 'src/html/admin.html')
-rw-r--r--src/html/admin.html19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/html/admin.html b/src/html/admin.html
index c42ee95..b2b1f64 100644
--- a/src/html/admin.html
+++ b/src/html/admin.html
@@ -14,8 +14,9 @@
el: '#stats',
data: {
stats: {session: [], url: []},
- showSessionTable: true,
- showUrlTable: true,
+ showSessionTable: false,
+ showUrlTable: false,
+ showLogData: false,
},
created() {
fetch(new Request('/admin/stats')).then(response => response.json())
@@ -76,6 +77,20 @@
<td>{{item.c}}</td>
</tr>
</table>
+ <div>
+ <input type="checkbox" id="showLog" v-model="showLogData">
+ <label for="showLog">Show Log</label>
+ </div>
+ <table class="table log-table" v-if="showLogData">
+ <tr><th>Date</th><th>Session</th><th>Method</th><th>Path</th></tr>
+ <tr v-for="item in stats.log">
+ <td>{{item.createdAt}}</td>
+ <td>{{item.session.substring(0,10)}}...</td>
+ <td>{{item.method}}</td>
+ <td>{{item.url.substring(0, Math.min(30, item.url.length))}}</td>
+ <td>{{item.c}}</td>
+ </tr>
+ </table>
</div>
</body>