2 import { last_api_request_url_store } from '../lib/stores.js';
3 import { fetch_from_api } from '../lib/api_utils.js';
6 let last_api_request_url;
8 last_api_request_url_store.subscribe(url => {
9 last_api_request_url = url;
10 fetch_from_api('status', { format: 'json' }, function (data) {
11 last_updated_date = data.data_updated;
27 background-color: #eee;
34 <div id="last-updated">
35 <div id="loading">loading...</div>
36 {#if last_updated_date}
37 {#if last_api_request_url}
38 <div id="api-request">
39 Data from <a href="{last_api_request_url}">API request</a>
40 <span id="api-request-debug">
41 (<a href="{last_api_request_url}&debug=1">debug output</a>)
45 Data last updated: <span id="data-date">{last_updated_date}</span>