-
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.
Add a edit provider credential action
Signed-off-by: Yaacov Zamir <[email protected]>
- Loading branch information
Showing
22 changed files
with
548 additions
and
525 deletions.
There are no files selected for viewing
18 changes: 15 additions & 3 deletions
18
packages/forklift-console-plugin/locales/en/plugin__forklift-console-plugin.json
Large diffs are not rendered by default.
Oops, something went wrong.
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
3 changes: 3 additions & 0 deletions
3
packages/forklift-console-plugin/src/modules/Providers/modals/components/alerts.style.css
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,3 @@ | ||
.forklift-alert--margin-top { | ||
margin-top: var(--pf-global--spacer--md); | ||
} |
1 change: 1 addition & 0 deletions
1
...forklift-console-plugin/src/modules/Providers/views/details/ProviderDetailsPage.style.css
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.forklift-page-headings-alerts { | ||
padding-left: 0; | ||
padding-top: 0; | ||
} | ||
|
||
.forklift-page-section { | ||
|
137 changes: 21 additions & 116 deletions
137
...lugin/src/modules/Providers/views/details/components/DetailsSection/OVADetailsSection.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 |
---|---|---|
@@ -1,145 +1,50 @@ | ||
import React from 'react'; | ||
import { Trans } from 'react-i18next'; | ||
import { PROVIDERS } from 'src/utils/enums'; | ||
import { useForkliftTranslation } from 'src/utils/i18n'; | ||
|
||
import { ResourceLink, Timestamp } from '@openshift-console/dynamic-plugin-sdk'; | ||
import { DescriptionList, Label, Text } from '@patternfly/react-core'; | ||
import { DescriptionList } from '@patternfly/react-core'; | ||
|
||
import { DetailsItem, OwnerReferencesItem } from '../../../../utils'; | ||
import { DetailsItem } from '../../../../utils'; | ||
|
||
import { | ||
CreatedAtDetailsItem, | ||
NameDetailsItem, | ||
NamespaceDetailsItem, | ||
OwnerDetailsItem, | ||
TypeDetailsItem, | ||
URLDetailsItem, | ||
} from './components'; | ||
import { DetailsSectionProps } from './DetailsSection'; | ||
|
||
export const OVADetailsSection: React.FC<DetailsSectionProps> = ({ data }) => { | ||
const { t } = useForkliftTranslation(); | ||
|
||
const { provider } = data; | ||
const type = PROVIDERS[provider?.spec?.type] || provider?.spec?.type; | ||
|
||
return ( | ||
<DescriptionList | ||
columnModifier={{ | ||
default: '2Col', | ||
}} | ||
> | ||
<DetailsItem | ||
title={t('Type')} | ||
content={ | ||
<> | ||
{type}{' '} | ||
{!provider?.spec?.url && ( | ||
<Label isCompact color={'grey'} className="forklift-table__flex-cell-label"> | ||
{t('Host cluster')} | ||
</Label> | ||
)} | ||
</> | ||
} | ||
moreInfoLink={ | ||
'https://access.redhat.com/documentation/en-us/migration_toolkit_for_virtualization/2.5/html-single/installing_and_using_the_migration_toolkit_for_virtualization/index#adding-providers' | ||
} | ||
helpContent={ | ||
<Text> | ||
{t( | ||
'Specify the type of source provider. Allowed values are ova, ovirt, vsphere, openshift, and openstack. This label is needed to verify the credentials are correct when the remote system is accessible and, for RHV, to retrieve the Manager CA certificate when a third-party certificate is specified.', | ||
)} | ||
</Text> | ||
} | ||
crumbs={['Provider', 'spec', 'type']} | ||
/> | ||
<TypeDetailsItem resource={provider} /> | ||
|
||
<DetailsItem title={''} content={''} /> | ||
|
||
<DetailsItem | ||
title={t('Name')} | ||
content={provider?.metadata?.name} | ||
moreInfoLink={'https://kubernetes.io/docs/concepts/overview/working-with-objects/names'} | ||
helpContent={ | ||
<Text> | ||
{t( | ||
'Name is primarily intended for creation idempotence and configuration definition. Cannot be updated.', | ||
)} | ||
</Text> | ||
} | ||
crumbs={['Provider', 'metadata', 'name']} | ||
/> | ||
<NameDetailsItem resource={provider} /> | ||
|
||
<DetailsItem | ||
title={t('Namespace')} | ||
content={ | ||
<ResourceLink | ||
groupVersionKind={{ version: 'v1', kind: 'Namespace' }} | ||
name={provider?.metadata?.namespace} | ||
namespace={provider?.metadata?.namespace} | ||
/> | ||
} | ||
moreInfoLink={ | ||
'https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces' | ||
} | ||
helpContent={t( | ||
`Namespace defines the space within which each name must be unique. | ||
An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. | ||
Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.`, | ||
)} | ||
crumbs={['Provider', 'metadata', 'namespace']} | ||
/> | ||
<NamespaceDetailsItem resource={provider} /> | ||
|
||
<DetailsItem | ||
title={t('URL')} | ||
content={provider?.spec?.url || <span className="text-muted">{t('Empty')}</span>} | ||
moreInfoLink={ | ||
'https://access.redhat.com/documentation/en-us/migration_toolkit_for_virtualization/2.5/html-single/installing_and_using_the_migration_toolkit_for_virtualization/index#adding-providers' | ||
} | ||
helpContent={ | ||
<Text> | ||
<Trans t={t} ns="plugin__forklift-console-plugin"> | ||
URL of the NFS file share that serves the OVA.{'<br><br>'} | ||
The URL must be in the following format: {'<strong>'}nfs_server:/nfs_path | ||
{'</strong>'}, where:{'<br>'} | ||
{'<strong>'}nfs_server:{'</strong>'} An IP or hostname of the server where the share | ||
was created.{'<br>'} | ||
{'<strong>'}nfs_path: {'</strong>'} The path on the server where the OVA files are | ||
stored.{'<br>'} | ||
For example: {'<strong>'}10.10.0.10:/ova{'</strong>'} .{'<br><br>'} | ||
Note:{'<br>'} This URL field is not editable. | ||
</Trans> | ||
</Text> | ||
} | ||
crumbs={['Provider', 'spec', 'url']} | ||
/> | ||
<CreatedAtDetailsItem resource={provider} /> | ||
|
||
<DetailsItem | ||
title={t('Created at')} | ||
content={<Timestamp timestamp={provider?.metadata?.creationTimestamp} />} | ||
moreInfoLink={'https://kubernetes.io/docs/reference/using-api/api-concepts'} | ||
helpContent={ | ||
<Text> | ||
{t( | ||
`CreationTimestamp is a timestamp representing the server time when this object was created. | ||
It is not guaranteed to be set in happens-before order across separate operations. | ||
Clients may not set this value. It is represented in RFC3339 form and is in UTC.`, | ||
)} | ||
</Text> | ||
} | ||
crumbs={['Provider', 'metadata', 'creationTimestamp']} | ||
<URLDetailsItem | ||
resource={provider} | ||
canPatch={false} | ||
helpContent={t( | ||
`URL of the NFS file share that serves the OVA., for example, 10.10.0.10:/ova`, | ||
)} | ||
/> | ||
|
||
<DetailsItem | ||
title={t('Owner')} | ||
content={<OwnerReferencesItem resource={provider} />} | ||
moreInfoLink={ | ||
'https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/' | ||
} | ||
helpContent={ | ||
<Text> | ||
{t( | ||
`List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. | ||
If this object is managed by a controller, then an entry in this list will point to this controller, | ||
with the controller field set to true. There cannot be more than one managing controller.`, | ||
)} | ||
</Text> | ||
} | ||
crumbs={['Provider', 'metadata', 'ownerReferences']} | ||
/> | ||
<OwnerDetailsItem resource={provider} /> | ||
</DescriptionList> | ||
); | ||
}; |
Oops, something went wrong.