diff options
Diffstat (limited to 'src/html')
-rw-r--r-- | src/html/admin.html | 13 | ||||
-rw-r--r-- | src/html/email-confirm.html | 23 | ||||
-rw-r--r-- | src/html/email-success.html | 2 | ||||
-rw-r--r-- | src/html/email-unsubscribe.html | 23 |
4 files changed, 59 insertions, 2 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> diff --git a/src/html/email-confirm.html b/src/html/email-confirm.html new file mode 100644 index 0000000..b0ee130 --- /dev/null +++ b/src/html/email-confirm.html @@ -0,0 +1,23 @@ +<!doctype html> +<html lang="en"> + +<head> + <title>Mark's Kitchen - Email</title> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + <link rel="stylesheet" type="text/css" href="/css/styles.css"> + <meta name="description" content="Email unsubscrube"> +</head> + +<body> + <div> + <h1> + <a class="navigation" href="/" title="marks.kitchen"><</a> + Unsubcribe? + </h1> + <a href="confirm">Click to unsubscribe!</a> + </div> + </div> +</body> + +</html> diff --git a/src/html/email-success.html b/src/html/email-success.html index 65bc2e5..11350df 100644 --- a/src/html/email-success.html +++ b/src/html/email-success.html @@ -15,7 +15,7 @@ <a class="navigation" href="/" title="marks.kitchen"><</a> Email </h1> - <h2 id="status" v-if='show'>Success, thank you!</h2> + <h2 id="status">Success, thank you!</h2> </div> </div> </body> diff --git a/src/html/email-unsubscribe.html b/src/html/email-unsubscribe.html new file mode 100644 index 0000000..37acf97 --- /dev/null +++ b/src/html/email-unsubscribe.html @@ -0,0 +1,23 @@ +<!doctype html> +<html lang="en"> + +<head> + <title>Mark's Kitchen - Email</title> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + <link rel="stylesheet" type="text/css" href="/css/styles.css"> + <meta name="description" content="Email unsubscrube"> +</head> + +<body> + <div> + <h1> + <a class="navigation" href="/" title="marks.kitchen"><</a> + Email + </h1> + <h2 id="status">You are now unsubscribed!</h2> + </div> + </div> +</body> + +</html> |