diff --git a/lib/SvelteUi/app/index.html b/lib/SvelteUi/app/index.html
index 4a138bae..3e5d5417 100644
--- a/lib/SvelteUi/app/index.html
+++ b/lib/SvelteUi/app/index.html
@@ -3,6 +3,7 @@
+
AMS reader
diff --git a/lib/SvelteUi/app/manifest.json b/lib/SvelteUi/app/manifest.json
new file mode 100644
index 00000000..9f8e30eb
--- /dev/null
+++ b/lib/SvelteUi/app/manifest.json
@@ -0,0 +1,19 @@
+// HTTPS required for this to work
+// Remember:
+{
+ "short_name": "amsreader",
+ "name": "AMS reader",
+ "icons": [
+ {
+ "src": "/favicon.svg",
+ "sizes": "any",
+ "type": "image/svg+xml",
+ "purpose": "any"
+ }
+ ],
+ "start_url": "/",
+ "background_color": "#f3f4f6",
+ "display": "standalone",
+ "scope": "/",
+ "theme_color": "#7c3aed"
+}
diff --git a/lib/SvelteUi/app/service-worker.js b/lib/SvelteUi/app/service-worker.js
new file mode 100644
index 00000000..55683df7
--- /dev/null
+++ b/lib/SvelteUi/app/service-worker.js
@@ -0,0 +1,11 @@
+self.addEventListener('install', (event) => {
+ self.skipWaiting();
+});
+
+self.addEventListener('activate', (event) => {
+ return self.clients.claim();
+});
+
+self.addEventListener('fetch', function(event) {
+ event.respondWith(fetch(event.request));
+});
\ No newline at end of file
diff --git a/lib/SvelteUi/app/src/App.svelte b/lib/SvelteUi/app/src/App.svelte
index 9433ffa5..dae7d266 100644
--- a/lib/SvelteUi/app/src/App.svelte
+++ b/lib/SvelteUi/app/src/App.svelte
@@ -10,7 +10,7 @@
import Mask from './lib/Mask.svelte';
import FileUploadComponent from "./lib/FileUploadComponent.svelte";
import ConsentComponent from "./lib/ConsentComponent.svelte";
-
+
let sysinfo = {};
sysinfoStore.subscribe(update => {
sysinfo = update;
diff --git a/lib/SvelteUi/app/src/assets/favicon.svg b/lib/SvelteUi/app/src/assets/favicon.svg
new file mode 100644
index 00000000..b00c064f
--- /dev/null
+++ b/lib/SvelteUi/app/src/assets/favicon.svg
@@ -0,0 +1,19 @@
+
+
+
diff --git a/lib/SvelteUi/app/src/lib/Header.svelte b/lib/SvelteUi/app/src/lib/Header.svelte
index 95910656..3d30cafb 100644
--- a/lib/SvelteUi/app/src/lib/Header.svelte
+++ b/lib/SvelteUi/app/src/lib/Header.svelte
@@ -3,6 +3,7 @@
import { sysinfoStore, getGitHubReleases, gitHubReleaseStore } from './DataStores.js';
import { upgrade, getNextVersion } from './UpgradeHelper';
import { boardtype, hanError, mqttError, priceError, isBusPowered } from './Helpers.js';
+ import AmsleserSvg from "./../assets/favicon.svg";
import GitHubLogo from './../assets/github.svg';
import Uptime from "./Uptime.svelte";
import Badge from './Badge.svelte';
diff --git a/lib/SvelteUi/include/AmsWebServer.h b/lib/SvelteUi/include/AmsWebServer.h
index 9955baab..bc576203 100644
--- a/lib/SvelteUi/include/AmsWebServer.h
+++ b/lib/SvelteUi/include/AmsWebServer.h
@@ -82,7 +82,7 @@ private:
void indexJs();
void indexCss();
void githubSvg();
- void faviconIco();
+ void faviconSvg();
void sysinfoJson();
void dataJson();
diff --git a/lib/SvelteUi/src/AmsWebServer.cpp b/lib/SvelteUi/src/AmsWebServer.cpp
index 1f7c800d..d52d6641 100644
--- a/lib/SvelteUi/src/AmsWebServer.cpp
+++ b/lib/SvelteUi/src/AmsWebServer.cpp
@@ -7,6 +7,7 @@
#include "html/index_css.h"
#include "html/index_js.h"
#include "html/github_svg.h"
+#include "html/favicon_svg.h"
#include "html/data_json.h"
#include "html/dayplot_json.h"
#include "html/monthplot_json.h"
@@ -67,7 +68,7 @@ void AmsWebServer::setup(AmsConfiguration* config, GpioConfig* gpioConfig, Meter
server.on(F("/mqtt-key"), HTTP_GET, std::bind(&AmsWebServer::indexHtml, this));
server.on(F("/github.svg"), HTTP_GET, std::bind(&AmsWebServer::githubSvg, this));
- server.on(F("/favicon.ico"), HTTP_GET, std::bind(&AmsWebServer::faviconIco, this));
+ server.on(F("/favicon.svg"), HTTP_GET, std::bind(&AmsWebServer::faviconSvg, this));
server.on(F("/sysinfo.json"), HTTP_GET, std::bind(&AmsWebServer::sysinfoJson, this));
server.on(F("/data.json"), HTTP_GET, std::bind(&AmsWebServer::dataJson, this));
server.on(F("/dayplot.json"), HTTP_GET, std::bind(&AmsWebServer::dayplotJson, this));
@@ -186,10 +187,11 @@ void AmsWebServer::githubSvg() {
server.send_P(200, "image/svg+xml", GITHUB_SVG);
}
-void AmsWebServer::faviconIco() {
+void AmsWebServer::faviconSvg() {
if(debugger->isActive(RemoteDebug::DEBUG)) debugger->printf("Serving /favicon.ico over http...\n");
- notFound(); //TODO
+ server.sendHeader(HEADER_CACHE_CONTROL, CACHE_1HR);
+ server.send_P(200, "image/svg+xml", FAVICON_SVG);
}
void AmsWebServer::sysinfoJson() {