-
Notifications
You must be signed in to change notification settings - Fork 300
feat: Added copy text to clipboard from kvm using OCR #1207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,18 @@ | ||
| import { Fragment, useCallback, useRef } from "react"; | ||
| import { MdOutlineContentPasteGo } from "react-icons/md"; | ||
| import { LuCable, LuHardDrive, LuMaximize, LuSettings, LuSignal } from "react-icons/lu"; | ||
| import { LuCable, LuHardDrive, LuMaximize, LuScanText, LuSettings, LuSignal } from "react-icons/lu"; | ||
| import { FaKeyboard } from "react-icons/fa6"; | ||
| import { Popover, PopoverButton, PopoverPanel } from "@headlessui/react"; | ||
| import { CommandLineIcon } from "@heroicons/react/20/solid"; | ||
|
|
||
| import { cx } from "@/cva.config"; | ||
| import { useHidStore, useMountMediaStore, useSettingsStore, useUiStore } from "@hooks/stores"; | ||
| import { | ||
| useHidStore, | ||
| useMountMediaStore, | ||
| useSettingsStore, | ||
| useUiStore, | ||
| useVideoStore, | ||
| } from "@hooks/stores"; | ||
| import { useDeviceUiNavigation } from "@hooks/useAppNavigation"; | ||
| import { Button } from "@components/Button"; | ||
| import Container from "@components/Container"; | ||
|
|
@@ -23,9 +29,16 @@ export default function Actionbar({ | |
| }) { | ||
| const { navigateTo } = useDeviceUiNavigation(); | ||
| const { isVirtualKeyboardEnabled, setVirtualKeyboardEnabled } = useHidStore(); | ||
| const { setDisableVideoFocusTrap, terminalType, setTerminalType, toggleSidebarView } = | ||
| useUiStore(); | ||
| const { | ||
| setDisableVideoFocusTrap, | ||
| terminalType, | ||
| setTerminalType, | ||
| toggleSidebarView, | ||
| isOcrMode, | ||
| setOcrMode, | ||
| } = useUiStore(); | ||
| const { remoteVirtualMediaState } = useMountMediaStore(); | ||
| const { width: videoWidth, height: videoHeight } = useVideoStore(); | ||
| const { developerMode } = useSettingsStore(); | ||
|
|
||
| // This is the only way to get a reliable state change for the popover | ||
|
|
@@ -63,6 +76,14 @@ export default function Actionbar({ | |
| onClick={() => setTerminalType(terminalType === "kvm" ? "none" : "kvm")} | ||
| /> | ||
| )} | ||
| <Button | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: The Action bar is already too crowded. You don't need to change anything here, but once I get time I'll rethink the action bar, so. just letting you know that I'll probably move after it merges with |
||
| size="XS" | ||
| theme={isOcrMode ? "primary" : "light"} | ||
| text={m.action_bar_copy_text()} | ||
| LeadingIcon={LuScanText} | ||
| disabled={videoWidth === 0 || videoHeight === 0} | ||
| onClick={() => setOcrMode(!isOcrMode)} | ||
| /> | ||
| <Popover> | ||
| <PopoverButton as={Fragment}> | ||
| <Button | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the Review comments have been addressed make sure to machine translate to other languages too. See DEVELOPMENT.md for details.