Separating runtime from application code to improve building. Upgraded mooncore packages. Started switching to flyonui. Added PluginFramework plugin loading via mooncore
This commit is contained in:
16
Moonlight.Client.Runtime/wwwroot/frontend.example.json
Normal file
16
Moonlight.Client.Runtime/wwwroot/frontend.example.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"apiUrl": "http://localhost:5165",
|
||||
"hostEnvironment": "Static",
|
||||
"theme": {
|
||||
"variables": {
|
||||
}
|
||||
},
|
||||
"scripts": [
|
||||
],
|
||||
"plugins": {
|
||||
"assemblies": [
|
||||
],
|
||||
"entrypoints": [
|
||||
]
|
||||
}
|
||||
}
|
||||
BIN
Moonlight.Client.Runtime/wwwroot/img/icon-192.png
Normal file
BIN
Moonlight.Client.Runtime/wwwroot/img/icon-192.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.4 KiB |
BIN
Moonlight.Client.Runtime/wwwroot/img/icon-512.png
Normal file
BIN
Moonlight.Client.Runtime/wwwroot/img/icon-512.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
BIN
Moonlight.Client.Runtime/wwwroot/img/pfp_placeholder.png
Normal file
BIN
Moonlight.Client.Runtime/wwwroot/img/pfp_placeholder.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 163 KiB |
22
Moonlight.Client.Runtime/wwwroot/manifest.webmanifest
Normal file
22
Moonlight.Client.Runtime/wwwroot/manifest.webmanifest
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "Moonlight Client",
|
||||
"short_name": "Moonlight.Client",
|
||||
"id": "./",
|
||||
"start_url": "./",
|
||||
"display": "standalone",
|
||||
"background_color": "#ffffff",
|
||||
"theme_color": "#030b1f",
|
||||
"prefer_related_applications": false,
|
||||
"icons": [
|
||||
{
|
||||
"src": "img/icon-512.png",
|
||||
"type": "image/png",
|
||||
"sizes": "512x512"
|
||||
},
|
||||
{
|
||||
"src": "img/icon-192.png",
|
||||
"type": "image/png",
|
||||
"sizes": "192x192"
|
||||
}
|
||||
]
|
||||
}
|
||||
4
Moonlight.Client.Runtime/wwwroot/service-worker.js
Normal file
4
Moonlight.Client.Runtime/wwwroot/service-worker.js
Normal file
@@ -0,0 +1,4 @@
|
||||
// In development, always fetch from the network and do not enable offline support.
|
||||
// This is because caching would make development more difficult (changes would not
|
||||
// be reflected on the first load after each change).
|
||||
self.addEventListener('fetch', () => { });
|
||||
66
Moonlight.Client.Runtime/wwwroot/service-worker.published.js
Normal file
66
Moonlight.Client.Runtime/wwwroot/service-worker.published.js
Normal file
@@ -0,0 +1,66 @@
|
||||
// Caution! Be sure you understand the caveats before publishing an application with
|
||||
// offline support. See https://aka.ms/blazor-offline-considerations
|
||||
|
||||
self.importScripts('./service-worker-assets.js');
|
||||
self.addEventListener('install', event => event.waitUntil(onInstall(event)));
|
||||
self.addEventListener('activate', event => event.waitUntil(onActivate(event)));
|
||||
self.addEventListener('fetch', event => event.respondWith(onFetch(event)));
|
||||
|
||||
const cacheNamePrefix = 'offline-cache-';
|
||||
const cacheName = `${cacheNamePrefix}${self.assetsManifest.version}`;
|
||||
const offlineAssetsInclude = [/\.dll$/, /\.pdb$/, /\.wasm/, /\.html/, /\.js$/, /\.json$/, /\.css$/, /\.woff$/, /\.png$/, /\.jpe?g$/, /\.gif$/, /\.ico$/, /\.blat$/, /\.dat$/];
|
||||
const offlineAssetsExclude = [/^service-worker\.js$/];
|
||||
|
||||
// Replace with your base path if you are hosting on a subfolder. Ensure there is a trailing '/'.
|
||||
const base = "/";
|
||||
const baseUrl = new URL(base, self.origin);
|
||||
const manifestUrlList = self.assetsManifest.assets.map(asset => new URL(asset.url, baseUrl).href);
|
||||
|
||||
// Add assets which are only available on the server and should not be cached here
|
||||
const serverOnlyResources = [
|
||||
"/api",
|
||||
"/oauth2"
|
||||
];
|
||||
|
||||
async function onInstall(event) {
|
||||
console.info('Service worker: Install');
|
||||
|
||||
// Fetch and cache all matching items from the assets manifest
|
||||
const assetsRequests = self.assetsManifest.assets
|
||||
.filter(asset => offlineAssetsInclude.some(pattern => pattern.test(asset.url)))
|
||||
.filter(asset => !offlineAssetsExclude.some(pattern => pattern.test(asset.url)))
|
||||
.map(asset => new Request(asset.url, {integrity: asset.hash, cache: 'no-cache'}));
|
||||
await caches.open(cacheName).then(cache => cache.addAll(assetsRequests));
|
||||
}
|
||||
|
||||
async function onActivate(event) {
|
||||
console.info('Service worker: Activate');
|
||||
|
||||
// Delete unused caches
|
||||
const cacheKeys = await caches.keys();
|
||||
await Promise.all(cacheKeys
|
||||
.filter(key => key.startsWith(cacheNamePrefix) && key !== cacheName)
|
||||
.map(key => caches.delete(key)));
|
||||
}
|
||||
|
||||
async function onFetch(event) {
|
||||
let cachedResponse = null;
|
||||
|
||||
if (event.request.method === 'GET') {
|
||||
// For all navigation requests, try to serve index.html from cache,
|
||||
// unless that request is for an offline resource.
|
||||
|
||||
const path = new URL(event.request.url).pathname;
|
||||
|
||||
const shouldServeIndexHtml =
|
||||
event.request.mode === 'navigate' &&
|
||||
!manifestUrlList.some(url => url === event.request.url) &&
|
||||
!serverOnlyResources.some(url => path.startsWith(url)); // Check for server side assets
|
||||
|
||||
const request = shouldServeIndexHtml ? 'index.html' : event.request;
|
||||
const cache = await caches.open(cacheName);
|
||||
cachedResponse = await cache.match(request);
|
||||
}
|
||||
|
||||
return cachedResponse || fetch(event.request);
|
||||
}
|
||||
14
Moonlight.Client.Runtime/wwwroot/svg/logo.svg
Normal file
14
Moonlight.Client.Runtime/wwwroot/svg/logo.svg
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="256px" height="301px" viewBox="0 0 256 301" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid">
|
||||
<defs>
|
||||
<linearGradient x1="2.17771739%" y1="34.7938955%" x2="92.7221942%" y2="91.3419405%" id="linearGradient-1">
|
||||
<stop stop-color="#41A7EF" offset="0%"></stop>
|
||||
<stop stop-color="#813DDE" offset="54.2186236%"></stop>
|
||||
<stop stop-color="#8F2EE2" offset="74.4988788%"></stop>
|
||||
<stop stop-color="#A11CE6" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g>
|
||||
<path d="M124.183681,101.699 C124.183681,66.515 136.256681,34.152 156.486681,8.525 C159.197681,5.092 156.787681,0.069 152.412681,0.012 C151.775681,0.004 151.136681,0 150.497681,0 C67.6206813,0 0.390681343,66.99 0.00168134279,149.775 C-0.386318657,232.369 66.4286813,300.195 149.019681,300.988 C189.884681,301.381 227.036681,285.484 254.376681,259.395 C257.519681,256.396 255.841681,251.082 251.548681,250.42 C179.413681,239.291 124.183681,176.949 124.183681,101.699" fill="url(#linearGradient-1)"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user