Skip to content

Commit

Permalink
update to v6 alphas
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcfaul committed Apr 15, 2024
1 parent dc7ad94 commit ab9365e
Show file tree
Hide file tree
Showing 5 changed files with 327 additions and 182 deletions.
13 changes: 6 additions & 7 deletions packages/module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
},
"dependencies": {
"@novnc/novnc": "^1.3.0",
"@patternfly/react-core": "^5.0.0",
"@patternfly/react-styles": "^5.0.0",
"@patternfly/react-core": "6.0.0-alpha.50",
"@patternfly/react-styles": "6.0.0-alpha.19",
"@spice-project/spice-html5": "^0.2.1",
"file-saver": "^1.3.8",
"xterm": "^4.8.1",
Expand All @@ -46,14 +46,13 @@
"react-dom": "^17 || ^18"
},
"devDependencies": {
"@patternfly/documentation-framework": "^5.0.15",
"@patternfly/patternfly": "^5.0.0",
"@patternfly/documentation-framework": "6.0.0-alpha.20",
"@patternfly/patternfly": "6.0.0-alpha.117",
"@patternfly/patternfly-a11y": "^4.3.1",
"@patternfly/react-code-editor": "^5.0.0",
"@patternfly/react-table": "^5.0.0",
"@patternfly/react-code-editor": "6.0.0-alpha.50",
"@patternfly/react-table": "6.0.0-alpha.50",
"rimraf": "^2.6.2",
"serve": "^14.1.2",
"react-monaco-editor": "^0.51.0",
"monaco-editor": "^0.34.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const pageData = {
"section": "extensions",
"subsection": "",
"deprecated": false,
"template": false,
"beta": true,
"demo": false,
"newImplementationLink": false,
Expand Down Expand Up @@ -362,9 +363,7 @@ pageData.liveContext = {
SerialConsoleCustom,
debounce
};
pageData.relativeImports = {

};
pageData.relativeImports = "import { SerialConsoleCustom } from 'content/extensions/react-console/examples/./SerialConsoleCustom.jsx';"
pageData.examples = {
'Basic Usage': props =>
<Example {...pageData} {...props} thumbnail={srcImportbasicusage} {...{"code":"import React from 'react';\nimport { AccessConsoles, SerialConsole, VncConsole, DesktopViewer } from '@patternfly/react-console';\nimport { SerialConsoleCustom } from './SerialConsoleCustom.jsx';\nimport { debounce } from '@patternfly/react-core';\n\nAccessConsolesVariants = () => {\n const [status, setStatus] = React.useState('disconnected');\n const setConnected = React.useRef(debounce(() => setStatus('connected'), 3000)).current;\n const onConnect = React.useCallback(() => {\n setStatus('loading');\n setConnected();\n }, [setConnected])\n const onDisconnect = React.useCallback(() => setStatus('disconnected'), [])\n const ref = React.createRef();\n\n return (\n <AccessConsoles preselectedType=\"SerialConsole\">\n <VncConsole host=\"localhost\" port=\"9090\" encrypt shared />\n <SerialConsole\n onConnect={onConnect}\n status={status}\n onDisconnect={onDisconnect}\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","isFullscreen":true}}>
Expand Down
15 changes: 3 additions & 12 deletions packages/module/src/components/SerialConsole/SerialConsole.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import React from 'react';

import { css } from '@patternfly/react-styles';
import {
Button,
EmptyState,
EmptyStateBody,
EmptyStateIcon,
Spinner,
EmptyStateHeader,
EmptyStateFooter
} from '@patternfly/react-core';
import { Button, EmptyState, EmptyStateBody, Spinner, EmptyStateFooter } from '@patternfly/react-core';

import { XTerm, XTermProps } from './XTerm';
import { SerialConsoleActions } from './SerialConsoleActions';
Expand Down Expand Up @@ -115,7 +107,7 @@ const SerialConsoleBase: React.FunctionComponent<SerialConsoleProps> = ({
break;
case DISCONNECTED:
terminal = (
<EmptyState>
<EmptyState titleText>
<EmptyStateBody>{textDisconnected}</EmptyStateBody>
<EmptyStateFooter>
<Button onClick={onConnectClick}>{textConnect}</Button>
Expand All @@ -126,8 +118,7 @@ const SerialConsoleBase: React.FunctionComponent<SerialConsoleProps> = ({
case LOADING:
default:
terminal = (
<EmptyState>
<EmptyStateHeader icon={<EmptyStateIcon icon={Spinner} />} />
<EmptyState icon={Spinner} titleText>
<EmptyStateBody>{textLoading}</EmptyStateBody>
</EmptyState>
);
Expand Down
15 changes: 3 additions & 12 deletions packages/module/src/components/VncConsole/VncConsole.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import React from 'react';

import { css } from '@patternfly/react-styles';
import {
Button,
EmptyState,
EmptyStateBody,
EmptyStateIcon,
Spinner,
EmptyStateHeader,
EmptyStateFooter
} from '@patternfly/react-core';
import { Button, EmptyState, EmptyStateBody, Spinner, EmptyStateFooter } from '@patternfly/react-core';

import { initLogging } from '@novnc/novnc/core/util/logging';
/** Has bad types. https://github.com/larryprice/novnc-core/issues/5 */
Expand Down Expand Up @@ -226,7 +218,7 @@ export const VncConsole: React.FunctionComponent<VncConsoleProps> = ({
break;
case DISCONNECTED:
emptyState = (
<EmptyState>
<EmptyState titleText>
<EmptyStateBody>{textDisconnected}</EmptyStateBody>
<EmptyStateFooter>
<Button variant="primary" onClick={connect}>
Expand All @@ -239,8 +231,7 @@ export const VncConsole: React.FunctionComponent<VncConsoleProps> = ({
case CONNECTING:
default:
emptyState = (
<EmptyState>
<EmptyStateHeader icon={<EmptyStateIcon icon={Spinner} />} />
<EmptyState icon={Spinner} titleText>
<EmptyStateBody>{textConnecting}</EmptyStateBody>
</EmptyState>
);
Expand Down
Loading

0 comments on commit ab9365e

Please sign in to comment.