]> git.openstreetmap.org Git - nominatim-ui.git/commitdiff
new /status.html page (#104)
authormtmail <mtmail@gmx.net>
Fri, 12 Mar 2021 15:52:04 +0000 (16:52 +0100)
committerGitHub <noreply@github.com>
Fri, 12 Mar 2021 15:52:04 +0000 (16:52 +0100)
dist/status.html [new file with mode: 0644]
src/App.svelte
src/components/LastUpdated.svelte
src/lib/stores.js
src/pages/StatusPage.svelte [new file with mode: 0644]

diff --git a/dist/status.html b/dist/status.html
new file mode 100644 (file)
index 0000000..99aa904
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset='utf-8'>
+  <meta name='viewport' content='width=device-width,initial-scale=1'>
+
+  <title>Nominatim Demo</title>
+
+  <link rel="icon" type="image/png" href="theme/favicon-194x194.png" sizes="194x194">
+  <link rel="icon" type="image/png" href="theme/favicon-32x32.png" sizes="32x32">
+
+  <link rel='stylesheet' href='build/bundle.css'>
+  <link rel='stylesheet' href='theme/style.css'>
+
+  <script src='config.defaults.js'></script>
+  <script src='theme/config.theme.js'></script>
+  <script defer src='build/bundle.js'></script>
+</head>
+
+<body>
+</body>
+</html>
index 05533e902c8dce04bfea21d30b80b02d8f85dc2d..98ba0292bd87f4458f636b0031a44a8713dbdfab 100644 (file)
@@ -10,6 +10,7 @@
   import DetailsPage from './pages/DetailsPage.svelte';
   import PolygonsPage from './pages/PolygonsPage.svelte';
   import DeletablePage from './pages/DeletablePage.svelte';
+  import StatusPage from './pages/StatusPage.svelte';
   import AboutPage from './pages/AboutPage.svelte';
 
   $: view = $page.tab;
@@ -30,6 +31,8 @@
 <DeletablePage />
 {:else if view === 'polygons'}
 <PolygonsPage />
+{:else if view === 'status'}
+<StatusPage />
 {:else if view === 'about'}
 <AboutPage />
 {/if}
index 3f914cebffe9faa546097f8dbb643f5f50ebcb0d..a51b4b6a42e982b6e47235beea48305910b34e87 100644 (file)
@@ -1,4 +1,5 @@
 <script>
+  import PageLink from './PageLink.svelte';
   import * as timeago from 'timeago.js';
   import { last_api_request_url_store } from '../lib/stores.js';
   import { fetch_from_api } from '../lib/api_utils.js';
@@ -53,6 +54,7 @@
         Data last updated:
         <abbr id="data-date" title="{last_updated_date} (UTC timezone)">{timeago.format(new Date(last_updated_date))}</abbr>
       {/if}
+      (<PageLink page="status">Details</PageLink>)
     </div>
   </div>
 </div>
index 00b41959379e6b606c4b0a40040fb8bfb74f9d0d..03f32cc9a03ef1791b1aa164c1172e64ed1eb2ea 100644 (file)
@@ -16,7 +16,7 @@ export const page = writable();
  * the requested query parameters. It may also be omitted completely for a
  * link without query parameters.
  */
-const pagenames = ['search', 'reverse', 'details', 'deletable', 'polygons', 'about'];
+const pagenames = ['search', 'reverse', 'details', 'deletable', 'polygons', 'status', 'about'];
 
 export function refresh_page(pagename, params) {
   if (typeof pagename === 'undefined') {
diff --git a/src/pages/StatusPage.svelte b/src/pages/StatusPage.svelte
new file mode 100644 (file)
index 0000000..242d54d
--- /dev/null
@@ -0,0 +1,39 @@
+<script>
+  import { onMount } from 'svelte';
+  import { fetch_from_api, update_html_title } from '../lib/api_utils.js';
+
+  import Header from '../components/Header.svelte';
+
+  let aStatusData = {};
+
+  function loaddata() {
+    fetch_from_api('status', { format: 'json' }, function (data) {
+      aStatusData = data;
+    });
+    update_html_title('Server status');
+  }
+  onMount(loaddata);
+</script>
+
+<Header/>
+<div class="container">
+  <div class="row">
+    <div class="col-sm-12">
+      <h1>Server status</h1>
+
+      <dl>
+        <dt>API Endpoint</dt>
+        <dd><a href={Nominatim_Config.Nominatim_API_Endpoint}>{Nominatim_Config.Nominatim_API_Endpoint}</a></dd>
+
+        <dt>Software version</dt>
+        <dd>{aStatusData.software_version}</dd>
+
+        <dt>Database version</dt>
+        <dd>{aStatusData.database_version}</dd>
+
+        <dt>Data last updated</dt>
+        <dd>{aStatusData.data_updated}</dd>
+      </dl>
+    </div>
+  </div>
+</div>