diff --git a/lib/frontend/actions/events.js b/lib/frontend/actions/events.js index 554deb0..e94f45b 100644 --- a/lib/frontend/actions/events.js +++ b/lib/frontend/actions/events.js @@ -10,10 +10,15 @@ const getEventHTML = async (url) => { formData.set('url', url) try { - const request = new Request({ id: uuidv4() }) + const request = new Request({ + id: uuidv4(), + url, + }) requestStore.set(request) const response = await postURL(formData) const text = await response.text() + + requestStore.set(null) return text } catch (error) { requestStore.update((prevRequest) => { diff --git a/lib/frontend/components/AppContainer.svelte b/lib/frontend/components/AppContainer.svelte index 7cee4e5..a7c741a 100644 --- a/lib/frontend/components/AppContainer.svelte +++ b/lib/frontend/components/AppContainer.svelte @@ -1,7 +1,8 @@ + +
+ {#if error} +
+ {error.toString()} +
+ {/if} + {#if pendingRequest} +
+ Fetching event {$requestStore.url} +
+ {/if} +
diff --git a/lib/frontend/records/request.js b/lib/frontend/records/request.js index 92f38a0..320411d 100644 --- a/lib/frontend/records/request.js +++ b/lib/frontend/records/request.js @@ -1,9 +1,11 @@ export default class Request { constructor({ id, + url, error, }) { this.id = id + this.url = url this.error = error } } diff --git a/lib/static/index.html b/lib/static/index.html index 1a7cd76..6b3ef82 100644 --- a/lib/static/index.html +++ b/lib/static/index.html @@ -42,12 +42,6 @@
-
- Fetching file... -
-
- Parsing data... -
diff --git a/lib/static/style.css b/lib/static/style.css index 336dcc3..c85f220 100644 --- a/lib/static/style.css +++ b/lib/static/style.css @@ -91,20 +91,6 @@ input#url { flex: 1; } -#status { - flex: 1; - height: 1rem; - margin: 5px; -} - -.status-item { - display: none; - min-width: 200px; - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; -} - .show { display: block; }