-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding the option to enable RDP Service to window vm
Signed-off-by: Dana Orr <dorr@redhat.com>
- Loading branch information
Showing
12 changed files
with
197 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 16 additions & 6 deletions
22
src/utils/components/Consoles/components/DesktopViewer/Components/RDPConnector.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/utils/components/Consoles/components/DesktopViewer/Components/RDPServiceModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import * as React from 'react'; | ||
|
||
import { V1VirtualMachine, V1VirtualMachineInstance } from '@kubevirt-ui/kubevirt-api/kubevirt'; | ||
import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; | ||
import { Alert, Checkbox, ModalVariant, Stack, StackItem } from '@patternfly/react-core'; | ||
import TabModal from '@kubevirt-utils/components/TabModal/TabModal'; | ||
import ExternalLink from '@kubevirt-utils/components/ExternalLink/ExternalLink'; | ||
import { NODE_PORTS_LINK } from '../utils/constants'; | ||
import { createRDPService } from '../utils/utils'; | ||
|
||
type RDPServiceModalProps = { | ||
vmi: V1VirtualMachineInstance; | ||
vm: V1VirtualMachine; | ||
isOpen: boolean; | ||
onClose: () => void; | ||
}; | ||
|
||
const RDPServiceModal: React.FC<RDPServiceModalProps> = ({ vmi, vm, isOpen, onClose }) => { | ||
const { t } = useKubevirtTranslation(); | ||
const [isChecked, setChecked] = React.useState<boolean>(false); | ||
|
||
return ( | ||
<TabModal | ||
isOpen={isOpen} | ||
isDisabled={!isChecked} | ||
onClose={onClose} | ||
onSubmit={() => createRDPService(vm, vmi)} | ||
headerText={t('RDP Service')} | ||
modalVariant={ModalVariant.medium} | ||
> | ||
<Stack hasGutter> | ||
<StackItem> | ||
<Checkbox | ||
id="rdp-service-checkbox" | ||
className="kv-rdp-service-checkbox--main" | ||
label={t('Expose RDP Service')} | ||
isChecked={isChecked} | ||
data-checked-state={isChecked} | ||
onChange={setChecked} | ||
/> | ||
</StackItem> | ||
<StackItem> | ||
<Alert variant="info" isInline title={t('Node port')}> | ||
<div> | ||
{t('RDP Service is using a node port. Node port requires additional port resources.')} | ||
<div> | ||
<ExternalLink text={t('Learn more')} href={NODE_PORTS_LINK} /> | ||
</div> | ||
</div> | ||
</Alert> | ||
</StackItem> | ||
</Stack> | ||
</TabModal> | ||
); | ||
}; | ||
|
||
export default RDPServiceModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/utils/components/Consoles/components/DesktopViewer/Components/rdp-service.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.kv-create-rdp-service-button { | ||
display: block; | ||
margin-top: var(--pf-global--spacer--md) | ||
; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters