Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web/packages/design/src/Icon/Icons.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export const Icons = () => (
<IconBox IconCmpt={Icon.Integrations} text="Integrations" />
<IconBox IconCmpt={Icon.Invoices} text="Invoices" />
<IconBox IconCmpt={Icon.Key} text="Key" />
<IconBox IconCmpt={Icon.Keyboard} text="Keyboard" />
<IconBox IconCmpt={Icon.Keypair} text="Keypair" />
<IconBox IconCmpt={Icon.Kubernetes} text="Kubernetes" />
<IconBox IconCmpt={Icon.Label} text="Label" />
Expand Down
73 changes: 73 additions & 0 deletions web/packages/design/src/Icon/Icons/Keyboard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/**
* Teleport
* Copyright (C) 2023 Gravitational, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/* MIT License

Copyright (c) 2020 Phosphor Icons

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

*/

import React from 'react';

import { Icon, IconProps } from '../Icon';

/*

THIS FILE IS GENERATED. DO NOT EDIT.

*/

export function Keyboard({ size = 24, color, ...otherProps }: IconProps) {
return (
<Icon
size={size}
color={color}
className="icon icon-keyboard"
{...otherProps}
>
<path d="M5.25 11.25C4.83579 11.25 4.5 11.5858 4.5 12C4.5 12.4142 4.83579 12.75 5.25 12.75H18.75C19.1642 12.75 19.5 12.4142 19.5 12C19.5 11.5858 19.1642 11.25 18.75 11.25H5.25Z" />
<path d="M4.5 9C4.5 8.58579 4.83579 8.25 5.25 8.25H18.75C19.1642 8.25 19.5 8.58579 19.5 9C19.5 9.41421 19.1642 9.75 18.75 9.75H5.25C4.83579 9.75 4.5 9.41421 4.5 9Z" />
<path d="M5.25 14.25C4.83579 14.25 4.5 14.5858 4.5 15C4.5 15.4142 4.83579 15.75 5.25 15.75H6C6.41421 15.75 6.75 15.4142 6.75 15C6.75 14.5858 6.41421 14.25 6 14.25H5.25Z" />
<path d="M8.25 15C8.25 14.5858 8.58579 14.25 9 14.25H15C15.4142 14.25 15.75 14.5858 15.75 15C15.75 15.4142 15.4142 15.75 15 15.75H9C8.58579 15.75 8.25 15.4142 8.25 15Z" />
<path d="M18 14.25C17.5858 14.25 17.25 14.5858 17.25 15C17.25 15.4142 17.5858 15.75 18 15.75H18.75C19.1642 15.75 19.5 15.4142 19.5 15C19.5 14.5858 19.1642 14.25 18.75 14.25H18Z" />
<path
fillRule="evenodd"
clipRule="evenodd"
d="M3.04594 4.5C2.19214 4.5 1.5 5.19214 1.5 6.04594V17.9541C1.5 18.8079 2.19214 19.5 3.04594 19.5H20.9541C21.8079 19.5 22.5 18.8079 22.5 17.9541V6.04594C22.5 5.19214 21.8079 4.5 20.9541 4.5H3.04594ZM3 6.04594C3 6.02057 3.02057 6 3.04594 6H20.9541C20.9794 6 21 6.02057 21 6.04594V17.9541C21 17.9794 20.9794 18 20.9541 18H3.04594C3.02057 18 3 17.9794 3 17.9541V6.04594Z"
/>
</Icon>
);
}
8 changes: 8 additions & 0 deletions web/packages/design/src/Icon/assets/Keyboard.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions web/packages/design/src/Icon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export { Info } from './Icons/Info';
export { Integrations } from './Icons/Integrations';
export { Invoices } from './Icons/Invoices';
export { Key } from './Icons/Key';
export { Keyboard } from './Icons/Keyboard';
export { Keypair } from './Icons/Keypair';
export { Kubernetes } from './Icons/Kubernetes';
export { Label } from './Icons/Label';
Expand Down
8 changes: 7 additions & 1 deletion web/packages/teleport/src/DesktopSession/ActionMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import * as Icons from 'design/Icon';
import { Flex } from 'design';

export default function ActionMenu(props: Props) {
const { showShareDirectory, onShareDirectory, onDisconnect } = props;
const { showShareDirectory, onShareDirectory, onDisconnect, onCtrlAltDel } =
props;

return (
<Flex alignItems="center">
Expand All @@ -41,6 +42,10 @@ export default function ActionMenu(props: Props) {
Share Directory
</MenuItem>
)}
<MenuItem onClick={onCtrlAltDel}>
<MenuItemIcon as={Icons.Keyboard} mr="2" />
Send Ctrl+Alt+Del
</MenuItem>
<MenuItem onClick={onDisconnect}>
<MenuItemIcon as={Icons.PowerSwitch} mr="2" />
Disconnect
Expand All @@ -54,6 +59,7 @@ type Props = {
showShareDirectory: boolean;
onShareDirectory: VoidFunction;
onDisconnect: VoidFunction;
onCtrlAltDel: VoidFunction;
};

const menuListCss = () => `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const props: State = {
},
setDirectorySharingState: () => {},
onShareDirectory: () => {},
onCtrlAltDel: () => {},
clientOnPngFrame: () => {},
clientOnBitmapFrame: () => {},
clientOnClientScreenSpec: () => {},
Expand Down
2 changes: 2 additions & 0 deletions web/packages/teleport/src/DesktopSession/DesktopSession.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export function DesktopSession(props: State) {
clientScreenSpecToRequest,
clipboardSharingState,
onShareDirectory,
onCtrlAltDel,
warnings,
onRemoveWarning,
fetchAttempt,
Expand Down Expand Up @@ -133,6 +134,7 @@ export function DesktopSession(props: State) {
isSharingDirectory={isSharingDirectory(directorySharingState)}
isSharingClipboard={isSharingClipboard(clipboardSharingState)}
onShareDirectory={onShareDirectory}
onCtrlAltDel={onCtrlAltDel}
warnings={warnings}
onRemoveWarning={onRemoveWarning}
/>
Expand Down
3 changes: 3 additions & 0 deletions web/packages/teleport/src/DesktopSession/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default function TopBar(props: Props) {
canShareDirectory,
isSharingDirectory,
onShareDirectory,
onCtrlAltDel,
warnings,
onRemoveWarning,
} = props;
Expand Down Expand Up @@ -91,6 +92,7 @@ export default function TopBar(props: Props) {
onDisconnect={onDisconnect}
showShareDirectory={canShareDirectory && !isSharingDirectory}
onShareDirectory={onShareDirectory}
onCtrlAltDel={onCtrlAltDel}
/>
</Flex>
</TopNav>
Expand Down Expand Up @@ -119,6 +121,7 @@ type Props = {
isSharingDirectory: boolean;
onDisconnect: VoidFunction;
onShareDirectory: VoidFunction;
onCtrlAltDel: VoidFunction;
warnings: NotificationItem[];
onRemoveWarning(id: string): void;
};
11 changes: 11 additions & 0 deletions web/packages/teleport/src/DesktopSession/useDesktopSession.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { useParams } from 'react-router';

import useAttempt from 'shared/hooks/useAttemptNext';

import { ButtonState } from 'teleport/lib/tdp';
import useWebAuthn from 'teleport/lib/useWebAuthn';
import desktopService from 'teleport/services/desktops';
import userService from 'teleport/services/user';
Expand Down Expand Up @@ -185,6 +186,15 @@ export default function useDesktopSession() {
}
};

const onCtrlAltDel = () => {
if (!tdpClient) {
return;
}
tdpClient.sendKeyboardInput('ControlLeft', ButtonState.DOWN);
tdpClient.sendKeyboardInput('AltLeft', ButtonState.DOWN);
tdpClient.sendKeyboardInput('Delete', ButtonState.DOWN);
Comment thread
ibeckermayer marked this conversation as resolved.
Outdated
};

return {
hostname,
username,
Expand All @@ -200,6 +210,7 @@ export default function useDesktopSession() {
showAnotherSessionActiveDialog,
setShowAnotherSessionActiveDialog,
onShareDirectory,
onCtrlAltDel,
warnings,
onRemoveWarning,
...clientCanvasProps,
Expand Down