diff options
Diffstat (limited to 'src/html/admin.html')
-rw-r--r-- | src/html/admin.html | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/html/admin.html b/src/html/admin.html index 29e4b87..d15598a 100644 --- a/src/html/admin.html +++ b/src/html/admin.html @@ -18,7 +18,7 @@ showSessionTable: false, showUrlTable: false, showLogData: false, - showEmailData: false, + showEmailData: true, }, created() { fetch(new Request('/admin/stats')).then(response => response.json()) @@ -28,6 +28,15 @@ } }); } + function delete_email(id, name){ + if (confirm(`Delete ${name}?`)) { + let path = `/admin/email/${id}` + fetch(new Request(path, { + method: 'delete', + })).then(response => response.json()) + .then(response => this.emails = response); + } + } </script> </head> @@ -130,10 +139,12 @@ <tr> <th>Name</th> <th>Address</th> + <th></th> </tr> <tr v-for="item in emails"> <td>{{item.name}}</td> <td>{{item.address}}</td> + <td><button v-on:click="delete_email(item.id, item.name)">X</button></td> </tr> </table> </div> |