forked from patternfly/react-console
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDesktopViewer.tsx
More file actions
94 lines (87 loc) · 3.05 KB
/
DesktopViewer.tsx
File metadata and controls
94 lines (87 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import { ManualConnection } from './ManualConnection';
import { ConnectWithRemoteViewer, ConnectWithRemoteViewerProps } from './ConnectWithRemoteViewer';
import { ConsoleDetailPropType } from './ConsoleDetailPropType';
import { createUseStyles } from 'react-jss';
const useStyles = createUseStyles({
consoleDesktopViewer: {
gridArea: 'main',
display: 'grid',
gap: 'var(--pf-t-global--spacer--md)',
gridTemplateColumns: 'repeat(auto-fit, minmax(20rem, 1fr))'
}
});
export interface DesktopViewerProps extends ConnectWithRemoteViewerProps {
/** Custom content of more-info section */
children?: React.ReactNode;
/** Connection details for Spice */
spice?: ConsoleDetailPropType;
/** Connection details for VNC */
vnc?: ConsoleDetailPropType;
/** Connection details for RDP */
rdp?: ConsoleDetailPropType;
textManualConnection?: string;
textNoProtocol?: string;
textConnectWith?: string;
textAddress?: string;
textSpiceAddress?: string;
textVNCAddress?: string;
textSpicePort?: string;
textVNCPort?: string;
textSpiceTlsPort?: string;
textVNCTlsPort?: string;
textRDPPort?: string;
textRdpAddress?: string;
textConnectWithRemoteViewer?: string;
textConnectWithRDP?: string;
/** Text that appears in the toggle */
textMoreInfo?: string;
/** The information content appearing above the description list for guidelines to install virt-viewer */
textMoreInfoContent?: string | React.ReactNode;
/** Text that appears in the toggle */
textMoreRDPInfo?: string;
/** The information content appearing above the description list for guidelines to install virt-viewer */
textMoreRDPInfoContent?: string | React.ReactNode;
}
export const DesktopViewer: React.FunctionComponent<DesktopViewerProps> = ({
children = null,
spice = null,
vnc = null,
rdp = null,
...props
}: DesktopViewerProps) => (
<div className={useStyles().consoleDesktopViewer}>
<ConnectWithRemoteViewer
spice={spice}
vnc={vnc}
rdp={rdp}
onGenerate={props.onGenerate}
onDownload={props.onDownload}
textConnectWithRemoteViewer={props.textConnectWithRemoteViewer}
textConnectWithRDP={props.textConnectWithRDP}
textMoreInfo={props.textMoreInfo}
textMoreRDPInfo={props.textMoreRDPInfo}
textMoreInfoContent={props.textMoreInfoContent}
textMoreRDPInfoContent={props.textMoreRDPInfoContent}
>
{children}
</ConnectWithRemoteViewer>
<ManualConnection
spice={spice}
vnc={vnc}
rdp={rdp}
textManualConnection={props.textManualConnection}
textNoProtocol={props.textNoProtocol}
textConnectWith={props.textConnectWith}
textAddress={props.textAddress}
textSpiceAddress={props.textSpiceAddress}
textVNCAddress={props.textVNCAddress}
textSpicePort={props.textSpicePort}
textVNCPort={props.textVNCPort}
textSpiceTlsPort={props.textSpiceTlsPort}
textVNCTlsPort={props.textVNCTlsPort}
textRDPPort={props.textRDPPort}
textRdpAddress={props.textRdpAddress}
/>
</div>
);
DesktopViewer.displayName = 'DesktopViewer';