Compare commits

...

5 Commits

Author SHA1 Message Date
Aveline 65c23fbf1d
Merge bbbea61723 into 542f9c0862 2025-11-10 15:19:10 +00:00
Adam Shiervani bbbea61723 fix: simplify tooltip text in FailSafeModeOverlay for clarity 2025-11-10 16:19:02 +01:00
Adam Shiervani 426cd6fe56 fix: update KvmIdRoute to conditionally render WebRTCVideo based on failsafeReason 2025-11-10 16:17:37 +01:00
Siyuan 9115362956 chore: make downgrade version configurable 2025-11-10 11:57:07 +00:00
Aveline 6b052e7777
Update ui/src/components/FailSafeModeOverlay.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-10 12:29:26 +01:00
3 changed files with 15 additions and 8 deletions

View File

@ -10,9 +10,12 @@ import { useDeviceUiNavigation } from "@/hooks/useAppNavigation";
import { useVersion } from "@/hooks/useVersion";
import { useDeviceStore } from "@/hooks/stores";
import notifications from "@/notifications";
import { DOWNGRADE_VERSION } from "@/ui.config";
import { GitHubIcon } from "./Icons";
interface FailSafeModeOverlayProps {
reason: string;
}
@ -86,7 +89,7 @@ export function FailSafeModeOverlay({ reason }: FailSafeModeOverlayProps) {
const handleReportAndDownloadLogs = () => {
setIsDownloadingLogs(true);
send("getFailSafeLogs", {}, (resp: JsonRpcResponse) => {
send("getFailSafeLogs", {}, async (resp: JsonRpcResponse) => {
setIsDownloadingLogs(false);
if ("error" in resp) {
@ -105,7 +108,9 @@ export function FailSafeModeOverlay({ reason }: FailSafeModeOverlayProps) {
a.href = url;
a.download = filename;
document.body.appendChild(a);
await new Promise(resolve => setTimeout(resolve, 1000));
a.click();
await new Promise(resolve => setTimeout(resolve, 1000));
document.body.removeChild(a);
URL.revokeObjectURL(url);
@ -114,7 +119,7 @@ export function FailSafeModeOverlay({ reason }: FailSafeModeOverlayProps) {
// Open GitHub issue
const issueBody = `## Issue Description
The \`${reason}\` process encountered an error and fail safe mode was activated.
The \`${reason}\` process encountered an error and failsafe mode was activated.
**Reason:** \`${reason}\`
**Timestamp:** ${new Date().toISOString()}
@ -126,7 +131,7 @@ Please attach the recovery logs file that was downloaded to your computer:
\`${filename}\`
> [!NOTE]
> Please omit any sensitive information from the logs.
> Please remove any sensitive information from the logs. The reports are public and can be viewed by anyone.
## Additional Context
[Please describe what you were doing when this occurred]`;
@ -141,7 +146,7 @@ Please attach the recovery logs file that was downloaded to your computer:
};
const handleDowngrade = () => {
navigateTo("/settings/general/update?app=0.4.8");
navigateTo(`/settings/general/update?app=${DOWNGRADE_VERSION}`);
};
return (
@ -177,7 +182,7 @@ Please attach the recovery logs file that was downloaded to your computer:
/>
<div className="h-8 w-px bg-slate-200 dark:bg-slate-700 block" />
<Tooltip text="Download logs first to unlock" show={!hasDownloadedLogs}>
<Tooltip text="Download logs first" show={!hasDownloadedLogs}>
<Button
onClick={() => navigateTo("/settings/general/reboot")}
theme="light"
@ -187,12 +192,12 @@ Please attach the recovery logs file that was downloaded to your computer:
/>
</Tooltip>
<Tooltip text="Download logs first to unlock" show={!hasDownloadedLogs}>
<Tooltip text="Download logs first" show={!hasDownloadedLogs}>
<Button
size="SM"
onClick={handleDowngrade}
theme="light"
text="Downgrade to v0.4.8"
text={`Downgrade to v${DOWNGRADE_VERSION}`}
disabled={!hasDownloadedLogs}
/>
</Tooltip>

View File

@ -853,7 +853,7 @@ export default function KvmIdRoute() {
/>
<div className="relative flex h-full w-full overflow-hidden">
{!isFailsafeMode && <WebRTCVideo />}
{!isFailsafeMode && failsafeReason === "video" && <WebRTCVideo />}
<div
style={{ animationDuration: "500ms" }}
className="animate-slideUpFade pointer-events-none absolute inset-0 flex items-center justify-center p-4"

View File

@ -1,4 +1,6 @@
export const CLOUD_API = import.meta.env.VITE_CLOUD_API;
export const DOWNGRADE_VERSION = import.meta.env.VITE_DOWNGRADE_VERSION || "0.4.8";
// In device mode, an empty string uses the current hostname (the JetKVM device's IP) as the API endpoint
export const DEVICE_API = "";