mirror of https://github.com/jetkvm/kvm.git
Merge a819739790
into 1d6b7ad83a
This commit is contained in:
commit
cceb8d18ed
|
@ -10,12 +10,14 @@ import Container from "@components/Container";
|
|||
import { LuHardDrive, LuMaximize, LuSettings, LuSignal } from "react-icons/lu";
|
||||
import { cx } from "@/cva.config";
|
||||
import PasteModal from "@/components/popovers/PasteModal";
|
||||
import { FaKeyboard } from "react-icons/fa6";
|
||||
import { FaKeyboard, FaLock } from "react-icons/fa6";
|
||||
import WakeOnLanModal from "@/components/popovers/WakeOnLan/Index";
|
||||
import { Popover, PopoverButton, PopoverPanel } from "@headlessui/react";
|
||||
import MountPopopover from "./popovers/MountPopover";
|
||||
import { Fragment, useCallback, useRef } from "react";
|
||||
import { CommandLineIcon } from "@heroicons/react/20/solid";
|
||||
import useKeyboard from "@/hooks/useKeyboard";
|
||||
import { keys, modifiers } from "@/keyboardMappings";
|
||||
|
||||
export default function Actionbar({
|
||||
requestFullscreen,
|
||||
|
@ -52,6 +54,8 @@ export default function Actionbar({
|
|||
[setDisableFocusTrap],
|
||||
);
|
||||
|
||||
const { sendKeyboardEvent, resetKeyboardState } = useKeyboard();
|
||||
|
||||
return (
|
||||
<Container className="bg-white border-b border-b-slate-800/20 dark:bg-slate-900 dark:border-b-slate-300/20">
|
||||
<div
|
||||
|
@ -203,6 +207,23 @@ export default function Actionbar({
|
|||
onClick={() => setVirtualKeyboard(!virtualKeyboard)}
|
||||
/>
|
||||
</div>
|
||||
{useSettingsStore().actionBarCtrlAltDel && (
|
||||
<div className="hidden lg:block">
|
||||
<Button
|
||||
size="XS"
|
||||
theme="light"
|
||||
text="Ctrl + Alt + Del"
|
||||
LeadingIcon={FaLock}
|
||||
onClick={() => {
|
||||
sendKeyboardEvent(
|
||||
[keys["Delete"]],
|
||||
[modifiers["ControlLeft"], modifiers["AltLeft"]],
|
||||
);
|
||||
setTimeout(resetKeyboardState, 100);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap items-center gap-x-2 gap-y-2">
|
||||
|
|
|
@ -796,6 +796,15 @@ export default function SettingsSidebar() {
|
|||
}}
|
||||
/>
|
||||
</SettingsItem>
|
||||
<SettingsItem
|
||||
title="Ctrl + Alt + Del Button"
|
||||
description="Display Ctrl + Alt + Del button on the Action Bar"
|
||||
>
|
||||
<Checkbox
|
||||
checked={settings.actionBarCtrlAltDel}
|
||||
onChange={e => settings.setActionBarCtrlAltDel(e.target.checked)}
|
||||
/>
|
||||
</SettingsItem>
|
||||
<div className="h-[1px] w-full bg-slate-800/10 dark:bg-slate-300/20" />
|
||||
<div className="pb-2 space-y-4">
|
||||
<SectionHeader
|
||||
|
|
|
@ -270,6 +270,9 @@ interface SettingsState {
|
|||
// Add new developer mode state
|
||||
developerMode: boolean;
|
||||
setDeveloperMode: (enabled: boolean) => void;
|
||||
|
||||
actionBarCtrlAltDel: boolean;
|
||||
setActionBarCtrlAltDel: (enabled: boolean) => void;
|
||||
}
|
||||
|
||||
export const useSettingsStore = create(
|
||||
|
@ -287,6 +290,9 @@ export const useSettingsStore = create(
|
|||
// Add developer mode with default value
|
||||
developerMode: false,
|
||||
setDeveloperMode: enabled => set({ developerMode: enabled }),
|
||||
|
||||
actionBarCtrlAltDel: false,
|
||||
setActionBarCtrlAltDel: enabled => set({ actionBarCtrlAltDel: enabled }),
|
||||
}),
|
||||
{
|
||||
name: "settings",
|
||||
|
|
Loading…
Reference in New Issue