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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
id: Access consoles
section: extensions
source: react
propComponents: ['AccessConsoles']
ouia: false
beta: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
id: DesktopViewer
section: consoles
source: react
propComponents: ['DesktopViewer']
ouia: false
beta: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
import React from 'react';
import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components';
import { DesktopViewer } from '@patternfly/react-console';
const pageData = {
"id": "DesktopViewer",
"section": "consoles",
"source": "react",
"slug": "/consoles/desktopviewer/react",
"sourceLink": "https://github.com/patternfly/patternfly-react/blob/main/packages/module/patternfly-docs/content/extensions/react-console/examples/DesktopViewer.md",
"propComponents": [
{
"name": "DesktopViewer",
"description": "",
"props": [
{
"name": "children",
"type": "React.ReactNode",
"description": "Custom content of more-info section",
"defaultValue": "null"
},
{
"name": "rdp",
"type": "ConsoleDetailPropType",
"description": "Connection details for RDP",
"defaultValue": "null"
},
{
"name": "spice",
"type": "ConsoleDetailPropType",
"description": "Connection details for Spice",
"defaultValue": "null"
},
{
"name": "textAddress",
"type": "string",
"description": ""
},
{
"name": "textConnectWith",
"type": "string",
"description": ""
},
{
"name": "textConnectWithRDP",
"type": "string",
"description": ""
},
{
"name": "textConnectWithRemoteViewer",
"type": "string",
"description": ""
},
{
"name": "textManualConnection",
"type": "string",
"description": ""
},
{
"name": "textMoreInfo",
"type": "string",
"description": "Text that appears in the toggle"
},
{
"name": "textMoreInfoContent",
"type": "string | React.ReactNode",
"description": "The information content appearing above the description list for guidelines to install virt-viewer"
},
{
"name": "textMoreRDPInfo",
"type": "string",
"description": "Text that appears in the toggle"
},
{
"name": "textMoreRDPInfoContent",
"type": "string | React.ReactNode",
"description": "The information content appearing above the description list for guidelines to install virt-viewer"
},
{
"name": "textNoProtocol",
"type": "string",
"description": ""
},
{
"name": "textRdpAddress",
"type": "string",
"description": ""
},
{
"name": "textRDPPort",
"type": "string",
"description": ""
},
{
"name": "textSpiceAddress",
"type": "string",
"description": ""
},
{
"name": "textSpicePort",
"type": "string",
"description": ""
},
{
"name": "textSpiceTlsPort",
"type": "string",
"description": ""
},
{
"name": "textVNCAddress",
"type": "string",
"description": ""
},
{
"name": "textVNCPort",
"type": "string",
"description": ""
},
{
"name": "textVNCTlsPort",
"type": "string",
"description": ""
},
{
"name": "vnc",
"type": "ConsoleDetailPropType",
"description": "Connection details for VNC",
"defaultValue": "null"
}
]
}
],
"beta": true,
"examples": [
"Basic Usage"
]
};
pageData.liveContext = {
DesktopViewer
};
pageData.relativeImports = {

};
pageData.examples = {
'Basic Usage': props =>
<Example {...pageData} {...props} {...{"code":"import React from 'react';\nimport { DesktopViewer } from '@patternfly/react-console';\n\nconst BasicUsage = () => <DesktopViewer spice={{ address: \"127.0.0.1\", port: \"5900\" }} vnc={{ address: \"127.0.0.1\", port: \"5901\" }} />","title":"Basic Usage","lang":"js"}}>

</Example>
};

const Component = () => (
<React.Fragment>
<AutoLinkHeader {...{"id":"note","size":"h3","className":"ws-title ws-h3"}}>
{`Note`}
</AutoLinkHeader>
<p {...{"className":"ws-p"}}>
{`DesktopViewer lives in its own package at `}
<PatternflyThemeLink {...{"to":"https://www.npmjs.com/package/@patternfly/react-console"}}>
<code {...{"className":"ws-code"}}>
{`@patternfly/react-console`}
</code>
</PatternflyThemeLink>
</p>
<AutoLinkHeader {...{"id":"examples","size":"h2","className":"ws-title ws-h2"}}>
{`Examples`}
</AutoLinkHeader>
{React.createElement(pageData.examples["Basic Usage"])}
</React.Fragment>
);
Component.displayName = 'ConsolesDesktopviewerReactDocs';
Component.pageData = pageData;

export default Component;
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import React from 'react';
import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components';
import { AccessConsoles, SerialConsole, VncConsole, DesktopViewer } from '@patternfly/react-console';
import { SerialConsoleCustom } from '../../../content/extensions/react-console/examples/./SerialConsoleCustom.jsx';
const pageData = {
"id": "Access consoles",
"section": "extensions",
"source": "react",
"slug": "/extensions/access-consoles/react",
"sourceLink": "https://github.com/patternfly/patternfly-react/blob/main/packages/module/patternfly-docs/content/extensions/react-console/examples/AccessConsoles.md",
"propComponents": [
{
"name": "AccessConsoles",
"description": "",
"props": [
{
"name": "preselectedType",
"type": "No type info",
"defaultValue": "null"
},
{
"name": "textDesktopViewerConsole",
"type": "No type info",
"defaultValue": "'Desktop viewer'"
},
{
"name": "textSelectConsoleType",
"type": "No type info",
"defaultValue": "'Select console type'"
},
{
"name": "textSerialConsole",
"type": "No type info",
"defaultValue": "'Serial console'"
},
{
"name": "textVncConsole",
"type": "No type info",
"defaultValue": "'VNC console'"
}
]
}
],
"beta": true,
"examples": [
"Basic Usage"
]
};
pageData.liveContext = {
AccessConsoles,
SerialConsole,
VncConsole,
DesktopViewer,
SerialConsoleCustom
};
pageData.relativeImports = {

};
pageData.examples = {
'Basic Usage': props =>
<Example {...pageData} {...props} {...{"code":"import React from 'react';\nimport { AccessConsoles, SerialConsole, VncConsole, DesktopViewer } from '@patternfly/react-console';\nimport { SerialConsoleCustom } from './SerialConsoleCustom.jsx';\n\nAccessConsolesVariants = () => {\n const [status, setStatus] = React.useState('disconnected');\n const setConnected = React.useRef(debounce(() => setStatus('connected'), 3000)).current;\n const ref = React.createRef();\n\n return (\n <AccessConsoles preselectedType=\"SerialConsole\">\n <VncConsole host=\"localhost\" port=\"9090\" encrypt shared />\n <SerialConsole\n onConnect={() => {\n setStatus('loading');\n setConnected();\n }}\n status={status}\n onDisconnect={() => setStatus('disconnected')}\n onData={data => {\n ref.current.onDataReceived(data);\n }}\n ref={ref}\n />\n <SerialConsoleCustom type='Serial Console pty2' />\n <DesktopViewer spice={{ address: '127.0.0.1', port: '5900' }} vnc={{ address: '127.0.0.1', port: '5901' }} />\n </AccessConsoles>\n );\n};","title":"Basic Usage","lang":"js"}}>

</Example>
};

const Component = () => (
<React.Fragment>
<AutoLinkHeader {...{"id":"note","size":"h3","className":"ws-title ws-h3"}}>
{`Note`}
</AutoLinkHeader>
<p {...{"className":"ws-p"}}>
{`AccessConsoles lives in its own package at `}
<PatternflyThemeLink {...{"to":"https://www.npmjs.com/package/@patternfly/react-console"}}>
<code {...{"className":"ws-code"}}>
{`@patternfly/react-console`}
</code>
</PatternflyThemeLink>
</p>
<AutoLinkHeader {...{"id":"examples","size":"h2","className":"ws-title ws-h2"}}>
{`Examples`}
</AutoLinkHeader>
{React.createElement(pageData.examples["Basic Usage"])}
</React.Fragment>
);
Component.displayName = 'ExtensionsAccessConsolesReactDocs';
Component.pageData = pageData;

export default Component;
12 changes: 6 additions & 6 deletions packages/module/patternfly-docs/generated/index.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
module.exports = {
'/extensions/access-consoles/extensions': {
'/extensions/access-consoles/react': {
id: "Access consoles",
title: "Access consoles",
toc: [[{"text":"Note"}],{"text":"Examples"},[{"text":"Basic Usage"}]],
examples: ["Basic Usage"],
section: "extensions",
source: "extensions",
Component: () => import(/* webpackChunkName: "extensions/access-consoles/extensions/index" */ './extensions/access-consoles/extensions')
source: "react",
Component: () => import(/* webpackChunkName: "extensions/access-consoles/react/index" */ './extensions/access-consoles/react')
},
'/consoles/desktopviewer/extensions': {
'/consoles/desktopviewer/react': {
id: "DesktopViewer",
title: "DesktopViewer",
toc: [[{"text":"Note"}],{"text":"Examples"},[{"text":"Basic Usage"}]],
examples: ["Basic Usage"],
section: "consoles",
source: "extensions",
Component: () => import(/* webpackChunkName: "consoles/desktopviewer/extensions/index" */ './consoles/desktopviewer/extensions')
source: "react",
Component: () => import(/* webpackChunkName: "consoles/desktopviewer/react/index" */ './consoles/desktopviewer/react')
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export interface SerialConsoleProps extends XTermProps {
const SerialConsoleBase: React.FunctionComponent<SerialConsoleProps> = ({
onConnect,
onDisconnect,
// eslint-disable-next-line @typescript-eslint/no-empty-function
onTitleChanged = () => {},
onData,
cols,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/no-extraneous-dependencies */
import React from 'react';
import { render } from '@testing-library/react';
import { VncConsole } from './VncConsole';
Expand Down
1 change: 1 addition & 0 deletions packages/module/src/components/VncConsole/VncConsole.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export const VncConsole: React.FunctionComponent<VncConsoleProps> = ({
vncLogging = 'warn',
consoleContainerId,
additionalButtons = [] as React.ReactNode[],
// eslint-disable-next-line @typescript-eslint/no-empty-function
onDisconnected = () => {},
onInitFailed,
onSecurityFailure,
Expand Down