Some design changes

This commit is contained in:
Gunnar Skjold 2023-01-14 09:34:28 +01:00
parent c28752a00a
commit 1cee48eab4
8 changed files with 58 additions and 5 deletions

View File

@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="/favicon.svg">
<title>AMS reader</title>
</head>
<body class="bg-gray-100">

View File

@ -0,0 +1,19 @@
// HTTPS required for this to work
// Remember: <link rel="manifest" href="manifest.json" />
{
"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"
}

View File

@ -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));
});

View File

@ -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;

View File

@ -0,0 +1,19 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">
<title>Amsleser</title>
<g transform="translate(-29.5,-83)">
<circle r="4.8016944" cy="123.56455" cx="55.064552"
style="fill:none;stroke:#045c7c;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path d="m 41.298717,103.9049 a 24,24 0 0 1 27.531669,0"
style="fill:none;stroke:#045c7c;stroke-width:3.3;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path d="m 35.562952,95.713384 a 34,34 0 0 1 39.003199,-2e-6"
style="fill:none;stroke:#045c7c;stroke-width:3.3;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path d="m 47.034482,112.09642 a 14,14 0 0 1 16.06014,0"
style="fill:none;stroke:#045c7c;stroke-width:3.3;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<circle r="3" cy="105.99158" cx="38.181862"
style="fill:none;stroke:#045c7c;stroke-width:2.4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<circle r="3" cy="97.959579" cx="77.491386"
style="fill:none;stroke:#045c7c;stroke-width:2.4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -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';

View File

@ -82,7 +82,7 @@ private:
void indexJs();
void indexCss();
void githubSvg();
void faviconIco();
void faviconSvg();
void sysinfoJson();
void dataJson();

View File

@ -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() {