diff --git a/MatrixUtils.Web/wwwroot/appsettings.json b/MatrixUtils.Web/wwwroot/appsettings.json
index 1ca99ed..826edbf 100644
--- a/MatrixUtils.Web/wwwroot/appsettings.json
+++ b/MatrixUtils.Web/wwwroot/appsettings.json
@@ -3,7 +3,8 @@
"LogLevel": {
"Default": "Trace",
"System": "Information",
- "Microsoft": "Information"
+ "Microsoft": "Information",
+ "ArcaneLibs.Blazor.Components.AuthorizedImage": "Information"
}
}
}
diff --git a/MatrixUtils.Web/wwwroot/css/app.css b/MatrixUtils.Web/wwwroot/css/app.css
index 3fac9ca..4511b3a 100644
--- a/MatrixUtils.Web/wwwroot/css/app.css
+++ b/MatrixUtils.Web/wwwroot/css/app.css
@@ -1,6 +1,11 @@
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
@import url('jetbrains-mono/jetbrains-mono.css');
+:root {
+ /*--bs-table-hover-bg: rgba(0, 0, 0, 0.75);*/
+ --bs-table-hover-bg: #FF00FF;
+}
+
.avatar48 {
width: 48px;
height: 48px;
diff --git a/MatrixUtils.Web/wwwroot/index.html b/MatrixUtils.Web/wwwroot/index.html
index 5182193..fa233b3 100644
--- a/MatrixUtils.Web/wwwroot/index.html
+++ b/MatrixUtils.Web/wwwroot/index.html
@@ -3,42 +3,35 @@
<head>
<meta charset="utf-8"/>
- <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<title>MatrixUtils.Web</title>
<base href="/"/>
- <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet"/>
- <link href="css/app.css" rel="stylesheet"/>
+ <link rel="preload" id="webassembly"/>
+ <link rel="stylesheet" href="css/bootstrap/bootstrap.min.css"/>
+ <link rel="stylesheet" href="css/app.css"/>
+ <link rel="icon" type="image/png" href="favicon.png"/>
+ <link href="MatrixUtils.Web.styles.css" rel="stylesheet"/>
<link rel="manifest" href="rmu.webmanifest"/>
<link rel="apple-touch-icon" sizes="512x512" href="icon-512.png"/>
- <link href="favicon.png" rel="icon" type="image/png"/>
- <link href="MatrixUtils.Web.styles.css" rel="stylesheet"/>
+ <link rel="apple-touch-icon" sizes="192x192" href="icon-192.png"/>
+ <script type="importmap"></script>
</head>
<body>
<div id="app">
<svg class="loading-progress">
- <circle cx="50%" cy="50%" r="40%"/>
- <circle cx="50%" cy="50%" r="40%"/>
+ <circle r="40%" cx="50%" cy="50%"/>
+ <circle r="40%" cx="50%" cy="50%"/>
</svg>
<div class="loading-progress-text"></div>
</div>
<div id="blazor-error-ui">
An unhandled error has occurred.
- <a class="reload" href="">Reload</a>
- <a class="dismiss">🗙</a>
+ <a href="." class="reload">Reload</a>
+ <span class="dismiss">🗙</span>
</div>
<script>
- function BlazorFocusElement(element) {
- if (element == null) return;
- if (element instanceof HTMLElement) {
- console.log(element);
- element.focus();
- } else if (element.hasOwnProperty("__internalId")) {
- console.log("Element is not an HTMLElement", element);
- }
- }
-
function getWidth(element) {
console.log("getWidth", element);
if (element == null) return 0;
@@ -57,9 +50,25 @@
height: window.innerHeight
};
}
+
+ setImageStream = async (element, imageStream) => {
+ if (!(element instanceof HTMLElement)) {
+ console.error("Element is not an HTMLElement", element);
+ return;
+ }
+
+ const arrayBuffer = await imageStream.arrayBuffer();
+ const blob = new Blob([arrayBuffer]);
+ const url = URL.createObjectURL(blob);
+ const image = document.getElementById(imageElementId);
+ image.onload = () => {
+ URL.revokeObjectURL(url);
+ }
+ image.src = url;
+ }
</script>
- <script src="_framework/blazor.webassembly.js"></script>
-<!-- <script>navigator.serviceWorker.register('service-worker.js');</script>-->
+ <script src="_framework/blazor.webassembly#[.{fingerprint}].js"></script>
+ <!-- <script>navigator.serviceWorker.register('service-worker.js');</script>-->
<script src="sw-registrator.js"></script>
</body>
diff --git a/MatrixUtils.Web/wwwroot/service-worker.published.js b/MatrixUtils.Web/wwwroot/service-worker.published.js
index 9219755..3e28e6c 100644
--- a/MatrixUtils.Web/wwwroot/service-worker.published.js
+++ b/MatrixUtils.Web/wwwroot/service-worker.published.js
@@ -9,7 +9,7 @@ self.addEventListener('fetch', event => event.respondWith(onFetch(event)));
const cacheNamePrefix = 'offline-cache-';
const cacheName = `${cacheNamePrefix}${self.assetsManifest.version}`;
const offlineAssetsInclude = [// Standard resources
- /\.dll$/, /\.pdb$/, /\.wasm/, /\.html/, /\.js$/, /\.json$/, /\.css$/, /\.woff$/, /\.png$/, /\.jpe?g$/, /\.gif$/, /\.ico$/, /\.blat$/, /\.dat$/, /* Extra known-static paths */
+ /\.dll$/, /\.pdb$/, /\.wasm/, /\.html/, /\.js$/, /\.json$/, /\.css$/, /\.woff$/, /\.png$/, /\.jpe?g$/, /\.gif$/, /\.ico$/, /\.blat$/, /\.dat$/, /\.webmanifest$/, /* Extra known-static paths */
/\/_matrix\/media\/.{2}\/download\//, /api\.dicebear\.com\/6\.x\/identicon\/svg/];
const offlineAssetsExclude = [/^service-worker\.js$/];
@@ -22,13 +22,13 @@ async function onInstall(event) {
console.info('Service worker: Install');
// Activate the new service worker as soon as the old one is retired.
- self.skipWaiting();
+ await self.skipWaiting();
// 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'}));
+ .map(asset => new Request(asset.url, {cache: 'no-cache'})); /* integrity: asset.hash */
await caches.open(cacheName).then(cache => cache.addAll(assetsRequests));
}
@@ -48,7 +48,8 @@ async function onFetch(event) {
// For all navigation requests, try to serve index.html from cache,
// unless that request is for an offline resource.
// If you need some URLs to be server-rendered, edit the following check to exclude those URLs
- const shouldServeIndexHtml = event.request.mode === 'navigate' && !manifestUrlList.some(url => url === event.request.url);
+ const shouldServeIndexHtml = event.request.mode === 'navigate'
+ && !manifestUrlList.some(url => url === event.request.url);
const request = shouldServeIndexHtml ? 'index.html' : event.request;
const shouldCache = offlineAssetsInclude.some(pattern => pattern.test(request.url));
@@ -72,7 +73,7 @@ async function onFetch(event) {
fetched, shouldCache, request, exception, cachedResponse, url: request.url,
}
Object.keys(consoleLog).forEach(key => consoleLog[key] == null && delete consoleLog[key])
- if(consoleLog.exception)
+ if (consoleLog.exception)
console.log("Service worker caching: ", consoleLog)
}
diff --git a/MatrixUtils.Web/wwwroot/sw-registrator.js b/MatrixUtils.Web/wwwroot/sw-registrator.js
index 94b96b2..b57d26a 100644
--- a/MatrixUtils.Web/wwwroot/sw-registrator.js
+++ b/MatrixUtils.Web/wwwroot/sw-registrator.js
@@ -8,14 +8,14 @@ window.updateAvailable = new Promise((resolve, reject) => {
return;
}
- navigator.serviceWorker.register('/service-worker.js')
+ navigator.serviceWorker.register('/service-worker.js', {updateViaCache: 'none'})
.then(registration => {
console.info(`Service worker registration successful (scope: ${registration.scope})`);
// detect updates every minute
setInterval(() => {
registration.update();
- }, 5 * 1000); // 60000ms -> check each minute
+ }, 30 * 1000); // 60000ms -> check each minute
registration.onupdatefound = () => {
const installingServiceWorker = registration.installing;
|