This commit is contained in:
legop3
2025-11-15 22:49:33 -05:00
parent f27a5554f2
commit e87938746c
3 changed files with 18 additions and 13 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>webui</title> <title>webui</title>
<script type="module" crossorigin src="/assets/index-sCjLoHHT.js"></script> <script type="module" crossorigin src="/assets/index-CFSn5fM6.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BLqBO1Eu.css"> <link rel="stylesheet" crossorigin href="/assets/index-BLqBO1Eu.css">
</head> </head>
<body> <body>
+11 -6
View File
@@ -157,7 +157,17 @@ export default function VideoTile({ sessionInfo, label, forceMute = false, telem
} }
function BatteryBar({ charge, capacity, config, label, status }) { function BatteryBar({ charge, capacity, config, label, status }) {
if (charge == null || !config?.full || config.warn == null) { if (!config) {
return null;
}
const normalizedConfig = {
full: config.full ?? config.Full ?? 0,
warn: config.warn ?? config.Warn ?? 0,
urgent: config.urgent ?? config.Urgent ?? null,
};
if (charge == null || normalizedConfig.full === 0 || normalizedConfig.warn == null) {
return ( return (
<div className="rounded-sm bg-[#1e1e1e] px-2 py-1 text-sm text-slate-200"> <div className="rounded-sm bg-[#1e1e1e] px-2 py-1 text-sm text-slate-200">
<div className="flex items-center justify-between text-xs text-slate-400"> <div className="flex items-center justify-between text-xs text-slate-400">
@@ -168,11 +178,6 @@ function BatteryBar({ charge, capacity, config, label, status }) {
</div> </div>
); );
} }
const normalizedConfig = {
full: config.full ?? config.Full ?? 0,
warn: config.warn ?? config.Warn ?? 0,
urgent: config.urgent ?? config.Urgent ?? null,
};
const span = normalizedConfig.full - normalizedConfig.warn; const span = normalizedConfig.full - normalizedConfig.warn;
if (span <= 0) return null; if (span <= 0) return null;