Skip to content

Commit

Permalink
Bug 1987171: When customizing boot source, password is shown in defau…
Browse files Browse the repository at this point in the history
…lt font

Signed-off-by: Aviv Turgeman <aturgema@redhat.com>
  • Loading branch information
avivtur committed Aug 5, 2021
1 parent 9e2206e commit 2ba4e68
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,7 @@
"The following credentials for this operating system were created via <2>cloud-init</2>. If unsuccessful, cloud-init could be improperly configured. Please contact the image provider for more information.": "The following credentials for this operating system were created via <2>cloud-init</2>. If unsuccessful, cloud-init could be improperly configured. Please contact the image provider for more information.",
"User name:": "User name:",
"Password:": "Password:",
"Copy password": "Copy password",
"Hide password": "Hide password",
"Show password": "Show password",
"Selected type {{typeName}} is unsupported. Falling back to a supported type": "Selected type {{typeName}} is unsupported. Falling back to a supported type",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import { AccessConsoles } from '@patternfly/react-console';
import { Alert, AlertActionCloseButton, Button, Stack, StackItem } from '@patternfly/react-core';
import { CopyIcon } from '@patternfly/react-icons';
import { Trans, useTranslation } from 'react-i18next';
import { LoadingInline } from '@console/internal/components/utils';
import { ConsoleType } from '../../../constants/vm/console-type';
Expand Down Expand Up @@ -139,14 +140,25 @@ const VMConsoles: React.FC<VMConsolesProps> = ({
{showPassword ? (
<>
{cloudInitPassword}{' '}
<Button
isSmall
isInline
variant="link"
onClick={() => navigator.clipboard.writeText(cloudInitPassword)}
>
<CopyIcon />
{t('kubevirt-plugin~Copy password')}
</Button>{' '}
<Button isSmall isInline variant="link" onClick={() => setShowPassword(false)}>
{t('kubevirt-plugin~Hide password')}
</Button>
</>
) : (
<Button isSmall isInline variant="link" onClick={() => setShowPassword(true)}>
{t('kubevirt-plugin~Show password')}
</Button>
<>
<Button isSmall isInline variant="link" onClick={() => setShowPassword(true)}>
{t('kubevirt-plugin~Show password')}
</Button>
</>
)}
</p>
</Alert>
Expand Down

0 comments on commit 2ba4e68

Please sign in to comment.