mirror of https://github.com/jetkvm/kvm.git
feat: implement FailSafeModeOverlay component with log download and issue reporting functionality
This commit is contained in:
parent
82ad2a467f
commit
5933adb23b
|
|
@ -50,7 +50,7 @@ const blockedMethodsByReason: Record<string, string[]> = {
|
|||
|
||||
export function useJsonRpc(onRequest?: (payload: JsonRpcRequest) => void) {
|
||||
const { rpcDataChannel } = useRTCStore();
|
||||
const { isFailsafeMode: isFailsafeMode, reason } = useFailsafeModeStore();
|
||||
const { isFailsafeMode, reason } = useFailsafeModeStore();
|
||||
|
||||
const send = useCallback(
|
||||
async (method: string, params: unknown, callback?: (resp: JsonRpcResponse) => void) => {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ import { Button } from "@components/Button";
|
|||
import LoadingSpinner from "../components/LoadingSpinner";
|
||||
import { useDeviceUiNavigation } from "../hooks/useAppNavigation";
|
||||
|
||||
// Time to wait after initiating reboot before redirecting to home
|
||||
const REBOOT_REDIRECT_DELAY_MS = 5000;
|
||||
|
||||
export default function SettingsGeneralRebootRoute() {
|
||||
const navigate = useNavigate();
|
||||
const { send } = useJsonRpc();
|
||||
|
|
@ -18,7 +21,7 @@ export default function SettingsGeneralRebootRoute() {
|
|||
// This is where we send the RPC to the golang binary
|
||||
send("reboot", { force: true });
|
||||
|
||||
await new Promise(resolve => setTimeout(resolve, 5000));
|
||||
await new Promise(resolve => setTimeout(resolve, REBOOT_REDIRECT_DELAY_MS));
|
||||
navigateTo("/");
|
||||
}, [navigateTo, send]);
|
||||
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ export default function SettingsRoute() {
|
|||
</div>
|
||||
</FeatureFlag>
|
||||
<div className={cx("shrink-0", {
|
||||
"opacity-50 cursor-not-allowed!": isVideoDisabled
|
||||
"opacity-50 cursor-not-allowed": isVideoDisabled
|
||||
})}>
|
||||
<NavLink
|
||||
to="video"
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ const ConnectionStatsSidebar = lazy(() => import('@/components/sidebar/connectio
|
|||
const Terminal = lazy(() => import('@components/Terminal'));
|
||||
const UpdateInProgressStatusCard = lazy(() => import("@/components/UpdateInProgressStatusCard"));
|
||||
import Modal from "@/components/Modal";
|
||||
import { FailSafeModeOverlay } from "@components/FaileSafeModeOverlay";
|
||||
import { FailSafeModeOverlay } from "@components/FailSafeModeOverlay";
|
||||
import { JsonRpcRequest, JsonRpcResponse, RpcMethodNotFound, useJsonRpc } from "@/hooks/useJsonRpc";
|
||||
import {
|
||||
ConnectionFailedOverlay,
|
||||
|
|
|
|||
Loading…
Reference in New Issue