-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* pwa support * Create go.yml * Delete .github/workflows/go.yml
- Loading branch information
1 parent
2b7ad7c
commit 3a503f1
Showing
3 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
var self = this; | ||
|
||
var filesToCache = [ | ||
'/' | ||
]; | ||
|
||
self.addEventListener('install', function (e) { | ||
e.waitUntil( | ||
caches.open('3xPanel').then(function (cache) { | ||
return cache.addAll(filesToCache); | ||
}) | ||
); | ||
}); | ||
self.addEventListener('activate', function (event) { | ||
event.waitUntil( | ||
caches.keys().then(function (cacheNames) { | ||
return Promise.all( | ||
cacheNames.filter(function (cacheName) { | ||
}).map(function (cacheName) { | ||
return caches.delete(cacheName); | ||
}) | ||
); | ||
}) | ||
); | ||
}); | ||
self.addEventListener('fetch', function (event) { | ||
event.respondWith( | ||
caches.open('mysite-dynamic').then(function (cache) { | ||
return cache.match(event.request).then(function (response) { | ||
return response || fetch(event.request).then(function (response) { | ||
cache.put(event.request, response.clone()); | ||
return response; | ||
}); | ||
}); | ||
}) | ||
); | ||
}); | ||
|
||
console.clear(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"name": "3x-UI Panel", | ||
"short_name": "3xPanel", | ||
"description": "3x-ui panel converted to PWA", | ||
"start_url": "/", | ||
"background_color": "#F4F4F4", | ||
"display": "fullscreen", | ||
"theme_color": "#293343", | ||
"icons": [ | ||
{ | ||
"src": "./assets/icons/16.png", | ||
"sizes": "16x16", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "./assets/icons/24.png", | ||
"sizes": "24x24", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "./assets/icons/32.png", | ||
"sizes": "32x32", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "./assets/icons/64.png", | ||
"sizes": "64x64", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "./assets/icons/192.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "./assets/icons/512.png", | ||
"sizes": "512x512", | ||
"type": "image/png" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters