fix: Navigator folgt dem Unraid-Theme
Die Seite übernimmt das Display-Theme aus Unraid (black/gray dunkel, white/azure hell) als data-theme; die Farben hängen nicht mehr nur an prefers-color-scheme. Ohne bekanntes Theme wird der Seitenhintergrund ausgewertet. Paket 2026.11.21.r004. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
17cb65bd64
commit
a7e8325853
7 files changed
+46
-5
No files matched your search
+1
-1
@@ -5,7 +5,7 @@ set -eu
|
|||||||
export COPYFILE_DISABLE=1
|
export COPYFILE_DISABLE=1
|
||||||
|
|
||||||
PLUGIN="u-navigator"
|
PLUGIN="u-navigator"
|
||||||
VERSION="2026.11.21.r003"
|
VERSION="2026.11.21.r004"
|
||||||
PKG_DIR="packages"
|
PKG_DIR="packages"
|
||||||
WORK_DIR=".plugin-build"
|
WORK_DIR=".plugin-build"
|
||||||
PKG_NAME="${PLUGIN}-${VERSION}.tgz"
|
PKG_NAME="${PLUGIN}-${VERSION}.tgz"
|
||||||
|
|||||||
Binary file not shown.
@@ -9,9 +9,12 @@ Tag="Navigator U-Navigator Unraid File Navigator files explorer"
|
|||||||
<?PHP
|
<?PHP
|
||||||
$plugin = "u-navigator";
|
$plugin = "u-navigator";
|
||||||
$version = "__VERSION__";
|
$version = "__VERSION__";
|
||||||
|
// Follow the Unraid display theme (Settings > Display Settings): black/gray are dark, white/azure light.
|
||||||
|
$unavUnraidTheme = (string)($display['theme'] ?? '');
|
||||||
|
$unavTheme = in_array($unavUnraidTheme, ['black', 'gray'], true) ? 'dark' : (in_array($unavUnraidTheme, ['white', 'azure'], true) ? 'light' : '');
|
||||||
?>
|
?>
|
||||||
<link rel="stylesheet" href="/plugins/<?=$plugin?>/assets/styles.css?v=<?=$version?>">
|
<link rel="stylesheet" href="/plugins/<?=$plugin?>/assets/styles.css?v=<?=$version?>">
|
||||||
<div class="u-nav app-shell">
|
<div class="u-nav app-shell"<?=$unavTheme ? ' data-theme="'.$unavTheme.'"' : ''?> data-unraid-theme="<?=htmlspecialchars($unavUnraidTheme)?>">
|
||||||
<header class="topbar">
|
<header class="topbar">
|
||||||
<div>
|
<div>
|
||||||
<h1>U-Navigator</h1>
|
<h1>U-Navigator</h1>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ const statusText = document.querySelector('#statusText');
|
|||||||
const transferButton = document.querySelector('#newQueueButton');
|
const transferButton = document.querySelector('#newQueueButton');
|
||||||
const settingsButton = document.querySelector('#settingsButton');
|
const settingsButton = document.querySelector('#settingsButton');
|
||||||
const API_BASE = window.UNAV_API_BASE || '/api';
|
const API_BASE = window.UNAV_API_BASE || '/api';
|
||||||
|
applyHostTheme();
|
||||||
const APP_VERSION = window.UNAV_VERSION || 'dev';
|
const APP_VERSION = window.UNAV_VERSION || 'dev';
|
||||||
const state = {
|
const state = {
|
||||||
config: null,
|
config: null,
|
||||||
@@ -4067,3 +4068,20 @@ function contextMenuActions(win, entry) {
|
|||||||
}
|
}
|
||||||
return actions;
|
return actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unraid normally tells us its theme (data-theme from the .page). If it does not,
|
||||||
|
// look at the page background around the navigator so custom/unknown themes still match.
|
||||||
|
function applyHostTheme() {
|
||||||
|
if (!appShell || appShell.dataset.theme) return;
|
||||||
|
let element = appShell.parentElement;
|
||||||
|
while (element) {
|
||||||
|
const match = getComputedStyle(element).backgroundColor.match(/rgba?\(([\d.]+),\s*([\d.]+),\s*([\d.]+)(?:,\s*([\d.]+))?/);
|
||||||
|
if (match && (match[4] === undefined || Number(match[4]) > 0.5)) {
|
||||||
|
const [r, g, b] = match.slice(1, 4).map(Number);
|
||||||
|
const luminance = (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;
|
||||||
|
appShell.dataset.theme = luminance < 0.5 ? 'dark' : 'light';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
element = element.parentElement;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,8 +20,25 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Dark palette: set from the Unraid theme (data-theme), or from the OS when the theme is unknown. */
|
||||||
|
.u-nav[data-theme="dark"] {
|
||||||
|
--bg: #101418;
|
||||||
|
--surface: #1b2229;
|
||||||
|
--surface-2: #222b33;
|
||||||
|
--surface-3: #2b3741;
|
||||||
|
--text: #eef3f7;
|
||||||
|
--muted: #a3b0bd;
|
||||||
|
--line: #36434f;
|
||||||
|
--shadow: 0 18px 55px rgba(0, 0, 0, 0.44);
|
||||||
|
color-scheme: dark;
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-nav[data-theme="light"] {
|
||||||
|
color-scheme: light;
|
||||||
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
.u-nav {
|
.u-nav:not([data-theme]) {
|
||||||
--bg: #101418;
|
--bg: #101418;
|
||||||
--surface: #1b2229;
|
--surface: #1b2229;
|
||||||
--surface-2: #222b33;
|
--surface-2: #222b33;
|
||||||
@@ -30,6 +47,7 @@
|
|||||||
--muted: #a3b0bd;
|
--muted: #a3b0bd;
|
||||||
--line: #36434f;
|
--line: #36434f;
|
||||||
--shadow: 0 18px 55px rgba(0, 0, 0, 0.44);
|
--shadow: 0 18px 55px rgba(0, 0, 0, 0.44);
|
||||||
|
color-scheme: dark;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE PLUGIN [
|
<!DOCTYPE PLUGIN [
|
||||||
<!ENTITY name "u-navigator">
|
<!ENTITY name "u-navigator">
|
||||||
<!ENTITY author "Michael Roll">
|
<!ENTITY author "Michael Roll">
|
||||||
<!ENTITY version "2026.11.21.r003">
|
<!ENTITY version "2026.11.21.r004">
|
||||||
<!ENTITY package "&name;-&version;.tgz">
|
<!ENTITY package "&name;-&version;.tgz">
|
||||||
<!ENTITY pluginURL "https://git.casaderoll.de/michael/Unraid-Navigator/raw/branch/main/u-navigator.plg">
|
<!ENTITY pluginURL "https://git.casaderoll.de/michael/Unraid-Navigator/raw/branch/main/u-navigator.plg">
|
||||||
<!ENTITY support "https://git.casaderoll.de/michael/Unraid-Navigator">
|
<!ENTITY support "https://git.casaderoll.de/michael/Unraid-Navigator">
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
&description;
|
&description;
|
||||||
|
|
||||||
### &version;
|
### &version;
|
||||||
|
- Folgt dem Unraid-Theme (black/gray dunkel, white/azure hell) statt nur der Systemeinstellung.
|
||||||
- Neuer Ordner, Tastaturbedienung, Kopieren/Ausschneiden/Einfügen, Zurück/Vorwärts, anklickbare Pfadleiste.
|
- Neuer Ordner, Tastaturbedienung, Kopieren/Ausschneiden/Einfügen, Zurück/Vorwärts, anklickbare Pfadleiste.
|
||||||
- Filter und rekursive Suche, Favoriten, Vorschaubilder, Nebeneinander-Ansicht, Statusleiste mit freiem Speicher.
|
- Filter und rekursive Suche, Favoriten, Vorschaubilder, Nebeneinander-Ansicht, Statusleiste mit freiem Speicher.
|
||||||
- Konfliktdialog (Ersetzen/Beide behalten/Überspringen), Transfers mit Geschwindigkeit, Restzeit und Abbrechen.
|
- Konfliktdialog (Ersetzen/Beide behalten/Überspringen), Transfers mit Geschwindigkeit, Restzeit und Abbrechen.
|
||||||
@@ -27,7 +28,7 @@
|
|||||||
|
|
||||||
<FILE Name="/boot/config/plugins/&name;/&package;">
|
<FILE Name="/boot/config/plugins/&name;/&package;">
|
||||||
<URL>https://git.casaderoll.de/michael/Unraid-Navigator/raw/branch/main/packages/&package;</URL>
|
<URL>https://git.casaderoll.de/michael/Unraid-Navigator/raw/branch/main/packages/&package;</URL>
|
||||||
<MD5>40d12d856aa3b87edb163e91345d2310</MD5>
|
<MD5>39df497b7df11629b3e857c896c48bfc</MD5>
|
||||||
</FILE>
|
</FILE>
|
||||||
|
|
||||||
<FILE Run="/bin/bash">
|
<FILE Run="/bin/bash">
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
&description;
|
&description;
|
||||||
|
|
||||||
### &version;
|
### &version;
|
||||||
|
- Folgt dem Unraid-Theme (black/gray dunkel, white/azure hell) statt nur der Systemeinstellung.
|
||||||
- Neuer Ordner, Tastaturbedienung, Kopieren/Ausschneiden/Einfügen, Zurück/Vorwärts, anklickbare Pfadleiste.
|
- Neuer Ordner, Tastaturbedienung, Kopieren/Ausschneiden/Einfügen, Zurück/Vorwärts, anklickbare Pfadleiste.
|
||||||
- Filter und rekursive Suche, Favoriten, Vorschaubilder, Nebeneinander-Ansicht, Statusleiste mit freiem Speicher.
|
- Filter und rekursive Suche, Favoriten, Vorschaubilder, Nebeneinander-Ansicht, Statusleiste mit freiem Speicher.
|
||||||
- Konfliktdialog (Ersetzen/Beide behalten/Überspringen), Transfers mit Geschwindigkeit, Restzeit und Abbrechen.
|
- Konfliktdialog (Ersetzen/Beide behalten/Überspringen), Transfers mit Geschwindigkeit, Restzeit und Abbrechen.
|
||||||
|
|||||||
Reference in new issue
Block a user