Minore Tweeks and FIxes

This commit is contained in:
2020-07-29 08:35:00 +02:00
parent ceca8fc057
commit d404afe501
8 changed files with 8 additions and 6 deletions

22
public/manifest.json Normal file
View File

@@ -0,0 +1,22 @@
{
"name": "Home",
"short_name": "Home",
"description": "Smart Home interface in PWA",
"lang": "cs-CZ",
"start_url": "/vasek/home/",
"scope": "/vasek/home/",
"display": "fullscreen",
"orientation": "portrait",
"theme_color": "#182239",
"icons": [
{
"src": "/vasek/home/app/templates/images/icon-192x192.png",
"sizes": "192x192"
},
{
"src": "/vasek/home/app/templates/images/icon-512x512.png",
"sizes": "512x512"
}
],
"background_color": "#182239"
}

64
public/serviceWorker.js Normal file
View File

@@ -0,0 +1,64 @@
importScripts('https://www.gstatic.com/firebasejs/7.1.0/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/7.1.0/firebase-messaging.js');
/**
* Cache version, change name to force reload
*/
var CACHE_VERSION = 'v1';
/**
* Stuff to put in the cache at install
*/
var CACHE_FILES = [
'templates/automatio.phtml',
'templates/dashboard.phtml',
'templates/home.phtml',
'templates/login.phtml',
'templates/scene.phtml',
'templates/setting.phtml',
'views/Automation.phtml',
'views/Dashboard.phtml',
'views/Home.phtml',
'views/Login.phtml',
'views/Scene.phtml',
'views/Setting.phtml',
'assets/logo.svg'
];
self.addEventListener('install', function(event) {
console.info('Installed');
});
self.addEventListener('push', function(event) {
console.log('Received a push message', event);
if (event && event.data) {
var data = event.data.json();
data = JSON.parse(data.data.notification);
console.log(data);
event.waitUntil(self.registration.showNotification(data.title, {
body: data.body,
icon: data.icon || null
}));
}
});
self.addEventListener('sync', function(event) {
console.info('Event: Sync');
});
self.addEventListener('fetch', function (event) {
});
self.addEventListener("online", function (event) {
});
self.addEventListener("offline", function (event) {
});
self.addEventListener('notificationclick', function(e) {
});