fix: add cachebusting to unraid.min.js

This commit is contained in:
ljm42
2022-04-21 10:08:37 -07:00
parent 1475cb1787
commit 1a98087f9a

View File

@@ -45,7 +45,7 @@ if (!file_exists('/usr/local/sbin/unraid-api')) { // When NOT using the plugin w
} else { // When PLG exists load from local when not signed in but when signed in load UPC from production.
$UPC_ENV = $UPC_ENV_CK ?? ((empty($remote['username']) || empty($var['regFILE'])) ? 'local' : 'production');
}
$upcLocalSrc = '/plugins/dynamix.my.servers/webComps/unraid.min.js'; // @NOTE - that using autov(); would render the file name below the body tag. So dont use it :(
$upcLocalSrc = autov('/plugins/dynamix.my.servers/webComps/unraid.min.js', true);
switch ($UPC_ENV) {
case 'production':
$upcSrc = 'https://registration.unraid.net/webComps/unraid.min.js';
@@ -75,7 +75,7 @@ setTimeout(() => {
console.log('[UPC] Fallback to filesystem src 😖');
const el = document.createElement('script');
el.type = 'text/javascript';
el.src = '<?autov($upcLocalSrc) ?>';
el.src = '<?=$upcLocalSrc?>';
document.head.appendChild(el);
return upcEnv('local', false, true); // set session cookie to prevent delayed loads of UPC
}