diff options
Diffstat (limited to 'src/html')
-rw-r--r-- | src/html/admin.html | 19 |
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> |