Add error handling on admin page (fixes #274)

This commit is contained in:
Alex Ling 2022-02-21 13:25:55 +00:00
parent ab3386546d
commit 3c399fac4e
2 changed files with 4 additions and 0 deletions

View File

@ -31,6 +31,9 @@ const component = () => {
this.scanMs = data.milliseconds;
this.scanTitles = data.titles;
})
.catch(e => {
alert('danger', `Failed to trigger a scan. Error: ${e}`);
})
.always(() => {
this.scanning = false;
});

View File

@ -40,5 +40,6 @@
<a class="uk-button uk-button-danger" href="<%= base_url %>logout">Log Out</a>
<% content_for "script" do %>
<script src="<%= base_url %>js/alert.js"></script>
<script src="<%= base_url %>js/admin.js"></script>
<% end %>