Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.
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
2 changes: 2 additions & 0 deletions packages/design/src/Icon/Icon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ export const Expand = makeFontIcon('Expand', 'icon-frame-expand');
export const Facebook = makeFontIcon('Facebook', 'icon-facebook');
export const FacebookSquare = makeFontIcon('FacebookSquare', 'icon-facebook2');
export const FileCode = makeFontIcon('Youtube', 'icon-file-code');
export const FolderPlus = makeFontIcon('FolderPlus', 'icon-folder-plus');
Comment thread
ibeckermayer marked this conversation as resolved.
export const FolderShared = makeFontIcon('FolderShared', 'icon-folder-shared');
export const ForwarderAdded = makeFontIcon(
'ForwarderAdded',
'icon-add-fowarder'
Expand Down
2 changes: 2 additions & 0 deletions packages/design/src/Icon/Icon.story.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ export const ListOfIcons = () => (
<IconBox IconCmpt={Icon.Expand} text="Expand" />
<IconBox IconCmpt={Icon.Facebook} text="Facebook" />
<IconBox IconCmpt={Icon.FacebookSquare} text="FacebookSquare" />
<IconBox IconCmpt={Icon.FolderPlus} text="FolderPlus" />
<IconBox IconCmpt={Icon.FolderShared} text="FolderShared" />
<IconBox IconCmpt={Icon.ForwarderAdded} text="ForwarderAdded" />
<IconBox IconCmpt={Icon.Github} text="Github" />
<IconBox IconCmpt={Icon.Google} text="Google" />
Expand Down
Binary file modified packages/design/src/assets/icomoon/fonts/icomoon.eot
Binary file not shown.
4 changes: 4 additions & 0 deletions packages/design/src/assets/icomoon/fonts/icomoon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/design/src/assets/icomoon/fonts/icomoon.ttf
Binary file not shown.
Binary file modified packages/design/src/assets/icomoon/fonts/icomoon.woff
Binary file not shown.
Binary file modified packages/design/src/assets/icomoon/fonts/icomoon.woff2
Binary file not shown.
14 changes: 13 additions & 1 deletion packages/design/src/assets/icomoon/style.css

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion packages/teleport/src/DesktopSession/ActionMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import * as Icons from 'design/Icon';
import { Flex } from 'design';

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

return (
<Flex alignItems="center">
<MenuIcon
Expand All @@ -31,7 +33,13 @@ export default function ActionMenu(props: Props) {
}}
menuProps={menuProps}
>
<MenuItem onClick={props.onDisconnect}>
{showShareDirectory && (
<MenuItem onClick={onShareDirectory}>
<MenuItemIcon as={Icons.FolderPlus} mr="2" />
Share Directory
</MenuItem>
)}
<MenuItem onClick={onDisconnect}>
<MenuItemIcon as={Icons.PowerSwitch} mr="2" />
Disconnect
</MenuItem>
Expand All @@ -41,6 +49,8 @@ export default function ActionMenu(props: Props) {
}

type Props = {
showShareDirectory: boolean;
onShareDirectory: VoidFunction;
Comment thread
ibeckermayer marked this conversation as resolved.
onDisconnect: VoidFunction;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ const props: State = {
onWsClose: () => {},
wsConnection: 'closed',
disconnected: false,
setDisconnected: () => null,
setDisconnected: () => {},
setClipboardState: () => {},
setIsRecording: () => {},
canShareDirectory: true,
isSharingDirectory: false,
setIsSharingDirectory: () => {},
onPngFrame: () => {},
onTdpError: () => {},
onKeyDown: () => {},
Expand Down Expand Up @@ -136,6 +141,7 @@ export const ConnectedSettingsTrue = () => {
errorText: '',
}}
isRecording={true}
isSharingDirectory={true}
onPngFrame={(ctx: CanvasRenderingContext2D) => {
fillGray(ctx.canvas);
}}
Expand Down
20 changes: 18 additions & 2 deletions packages/teleport/src/DesktopSession/DesktopSession.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,12 @@ function Session(props: PropsWithChildren<State>) {
username,
hostname,
clipboardState,
setClipboardState,
isRecording,
setIsRecording,
canShareDirectory,
isSharingDirectory,
setIsSharingDirectory,
onPngFrame,
onClipboardData,
onTdpError,
Expand Down Expand Up @@ -144,11 +149,22 @@ function Session(props: PropsWithChildren<State>) {
<TopBar
onDisconnect={() => {
setDisconnected(true);
setClipboardState(prevState => ({
...prevState,
enabled: false,
}));
setIsRecording(false);
setIsSharingDirectory(false);
tdpClient.nuke();
}}
userHost={`${username}@${hostname}`}
clipboard={clipboardSharingActive}
recording={isRecording}
clipboardSharingEnabled={clipboardSharingActive}
isRecording={isRecording}
canShareDirectory={canShareDirectory}
isSharingDirectory={isSharingDirectory}
onShareDirectory={() => {
setIsSharingDirectory(true);
}}
/>

{props.children}
Expand Down
80 changes: 56 additions & 24 deletions packages/teleport/src/DesktopSession/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,20 @@ limitations under the License.
import React from 'react';
import styled, { useTheme } from 'styled-components';
import { Text, TopNav, Flex } from 'design';
import { Clipboard } from 'design/Icon';
import { Clipboard, FolderShared } from 'design/Icon';
import { colors } from 'teleport/Console/colors';
import ActionMenu from './ActionMenu';

export default function TopBar(props: Props) {
const { userHost, clipboard, recording, onDisconnect } = props;
const {
userHost,
clipboardSharingEnabled,
isRecording,
onDisconnect,
canShareDirectory,
isSharingDirectory,
onShareDirectory,
} = props;
const theme = useTheme();

const primaryOnTrue = (b: boolean): any => {
Expand All @@ -42,30 +50,45 @@ export default function TopBar(props: Props) {
{userHost}
</Text>

<Text
style={{
...primaryOnTrue(clipboard),
verticalAlign: 'text-bottom',
}}
>
<StyledClipboard style={primaryOnTrue(clipboard)} pr={2} />
Clipboard Sharing {clipboard ? 'Enabled' : 'Disabled'}
</Text>

<Flex px={3}>
<Flex alignItems="center">
<StyledRecordingIndicator
style={{
backgroundColor: recording
? theme.colors.error.light
: theme.colors.text.secondary,
}}
<StyledFolderShared
style={primaryOnTrue(isSharingDirectory)}
pr={3}
title={
isSharingDirectory
? 'Directory Sharing Enabled'
: 'Directory Sharing Disabled'
}
/>
<Text style={primaryOnTrue(recording)}>
{recording ? '' : 'Not '}Recording
</Text>
<StyledClipboard
style={primaryOnTrue(clipboardSharingEnabled)}
pr={3}
title={
clipboardSharingEnabled
? 'Clipboard Sharing Enabled'
: 'Clipboard Sharing Disabled'
}
/>
<Flex
title={isRecording ? 'Recording In Progress' : 'Not Recording'}
alignItems="center"
>
<StyledRecordingIndicator
style={{
backgroundColor: isRecording
? theme.colors.error.light
: theme.colors.text.secondary,
}}
/>
<Text style={primaryOnTrue(isRecording)}>Recording</Text>
</Flex>
</Flex>
<ActionMenu onDisconnect={onDisconnect} />
<ActionMenu
onDisconnect={onDisconnect}
showShareDirectory={canShareDirectory && !isSharingDirectory}
onShareDirectory={onShareDirectory}
/>
</Flex>
</TopNav>
);
Expand All @@ -79,6 +102,12 @@ const StyledClipboard = styled(Clipboard)`
align-self: 'center';
`;

const StyledFolderShared = styled(FolderShared)`
font-weight: ${({ theme }) => theme.fontWeights.bold};
font-size: ${({ theme }) => theme.fontSizes[6] + 'px'};
Comment on lines +106 to +107
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i like this, we should be doing this more to keep in line with our theme @rudream

align-self: 'center';
`;

const StyledRecordingIndicator = styled.div`
width: 10px;
height: 10px;
Expand All @@ -89,7 +118,10 @@ const StyledRecordingIndicator = styled.div`

type Props = {
userHost: string;
clipboard: boolean;
recording: boolean;
clipboardSharingEnabled: boolean;
isRecording: boolean;
canShareDirectory: boolean;
isSharingDirectory: boolean;
onDisconnect: VoidFunction;
onShareDirectory: VoidFunction;
};
Loading