Support browsers without crypto randomUUID
This commit is contained in:
+4
-4
@@ -9,12 +9,12 @@ Tag="URBM Unraid Restic Backup Manager backup snapshots restore"
|
||||
<?php
|
||||
$pluginRoot = '/plugins/urbm';
|
||||
?>
|
||||
<link rel="stylesheet" href="<?= $pluginRoot ?>/assets/urbm.css?v=20260615r014">
|
||||
<link rel="stylesheet" href="<?= $pluginRoot ?>/assets/urbm.css?v=20260615r015">
|
||||
<div id="urbm-app" data-api="<?= $pluginRoot ?>/api.php">
|
||||
<header class="bu-header">
|
||||
<div class="bu-brand">
|
||||
<img class="bu-logo" src="<?= $pluginRoot ?>/images/urbm.png?v=20260615r014" alt="URBM-Logo">
|
||||
<div><h1>URBM <span class="bu-version">2026.06.15.r014</span></h1><p>Restic Backup Manager für Unraid</p></div>
|
||||
<img class="bu-logo" src="<?= $pluginRoot ?>/images/urbm.png?v=20260615r015" alt="URBM-Logo">
|
||||
<div><h1>URBM <span class="bu-version">2026.06.15.r015</span></h1><p>Restic Backup Manager für Unraid</p></div>
|
||||
</div>
|
||||
<div id="bu-health" class="bu-health" tabindex="0" data-tooltip="Zeigt, ob die URBM-Hintergrundkomponente erreichbar ist. Beispiel: 'Daemon online' bedeutet, dass Jobs gestartet werden können.">Verbindung wird hergestellt...</div>
|
||||
</header>
|
||||
@@ -32,4 +32,4 @@ $pluginRoot = '/plugins/urbm';
|
||||
<div id="bu-tooltip" role="tooltip" aria-hidden="true"></div>
|
||||
</div>
|
||||
<script>window.URBM_CSRF = <?= json_encode($var['csrf_token'] ?? '') ?>;</script>
|
||||
<script src="<?= $pluginRoot ?>/assets/urbm-2026.06.15.r014.js"></script>
|
||||
<script src="<?= $pluginRoot ?>/assets/urbm-2026.06.15.r015.js"></script>
|
||||
|
||||
+15
-1
@@ -118,7 +118,21 @@
|
||||
toast.textContent = message; toast.className = `show${error ? ' error' : ''}`;
|
||||
clearTimeout(notify.timer); notify.timer = setTimeout(() => toast.className = '', 4500);
|
||||
};
|
||||
const id = (prefix) => `${prefix}-${crypto.randomUUID()}`;
|
||||
const uuid = () => {
|
||||
if (window.crypto && typeof window.crypto.randomUUID === 'function') return window.crypto.randomUUID();
|
||||
const bytes = new Uint8Array(16);
|
||||
if (window.crypto && typeof window.crypto.getRandomValues === 'function') {
|
||||
window.crypto.getRandomValues(bytes);
|
||||
} else {
|
||||
for (let i=0; i<bytes.length; i++) bytes[i]=Math.floor(Math.random()*256);
|
||||
const time=Date.now();
|
||||
for (let i=0; i<6; i++) bytes[i]^=(time/(2**(i*8)))&255;
|
||||
}
|
||||
bytes[6]=(bytes[6]&15)|64; bytes[8]=(bytes[8]&63)|128;
|
||||
const hex=Array.from(bytes, value=>value.toString(16).padStart(2,'0')).join('');
|
||||
return `${hex.slice(0,8)}-${hex.slice(8,12)}-${hex.slice(12,16)}-${hex.slice(16,20)}-${hex.slice(20)}`;
|
||||
};
|
||||
const id = (prefix) => `${prefix}-${uuid()}`;
|
||||
const repoName = (repoId) => state.config.repositories.find(r => r.id === repoId)?.name || repoId;
|
||||
const volatileLocation = (repo) => repo.type === 'local' && (/^\/tmp(?:\/|$)/.test(repo.location) || /^\/run(?:\/|$)/.test(repo.location));
|
||||
const tipAttr = (text) => text ? ` data-tooltip="${esc(text)}"` : '';
|
||||
|
||||
Reference in New Issue
Block a user