Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
265 additions
and
98 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
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
34 changes: 34 additions & 0 deletions
34
frontend/packages/kubevirt-plugin/src/components/vm-like/vm-like-details-page.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,34 @@ | ||
import * as React from 'react'; | ||
import { Firehose } from '@console/internal/components/utils'; | ||
import { VirtualMachineInstanceModel, VirtualMachineModel } from '../../models'; | ||
import { getResource } from '../../utils'; | ||
import { | ||
VirtualMachinesDetailsPage, | ||
VirtualMachinesDetailsPageProps, | ||
} from '../vms/vm-details-page'; | ||
|
||
export const VMLikeDetailsPage: React.FC<VirtualMachinesDetailsPageProps> = (props) => { | ||
const { name, ns: namespace } = props.match.params; | ||
const resources = [ | ||
getResource(VirtualMachineModel, { | ||
name, | ||
namespace, | ||
isList: false, | ||
prop: 'vm', | ||
optional: true, | ||
}), | ||
getResource(VirtualMachineInstanceModel, { | ||
name, | ||
namespace, | ||
isList: false, | ||
prop: 'vmi', | ||
optional: true, | ||
}), | ||
]; | ||
|
||
return ( | ||
<Firehose resources={resources}> | ||
<VirtualMachinesDetailsPage {...props} name={name} namespace={namespace} /> | ||
</Firehose> | ||
); | ||
}; |
34 changes: 34 additions & 0 deletions
34
frontend/packages/kubevirt-plugin/src/components/vm-like/vm-like-resource-link.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,34 @@ | ||
import * as React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
import * as classNames from 'classnames'; | ||
import { connectToModel } from '@console/internal/kinds'; | ||
import { ResourceIcon, resourcePath } from '@console/internal/components/utils'; | ||
import { getName, getNamespace } from '@console/shared'; | ||
import { VirtualMachineInstanceModel, VirtualMachineModel } from '../../models'; | ||
import { isVM } from '../../selectors/vm'; | ||
|
||
export const VMLikeResourceLink = connectToModel(({ className, inline = false, title, obj }) => { | ||
const name = getName(obj); | ||
const namespace = getNamespace(obj); | ||
|
||
const VMpath = resourcePath(VirtualMachineModel.kind, name, namespace); | ||
const classes = classNames('co-resource-item', className, { | ||
'co-resource-item--inline': inline, | ||
}); | ||
|
||
return ( | ||
<span className={classes}> | ||
<ResourceIcon | ||
kind={isVM(obj) ? VirtualMachineModel.kind : VirtualMachineInstanceModel.kind} | ||
/> | ||
<Link | ||
to={VMpath} | ||
title={title} | ||
className="co-resource-item__resource-name" | ||
data-test-id={name} | ||
> | ||
{name} | ||
</Link> | ||
</span> | ||
); | ||
}); |
11 changes: 11 additions & 0 deletions
11
frontend/packages/kubevirt-plugin/src/components/vms/vm-create-yaml.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,11 @@ | ||
import * as React from 'react'; | ||
import { CreateYAML } from '@console/internal/components/create-yaml'; | ||
import { VirtualMachineModel } from '../../models'; | ||
|
||
export const VMCreateYAML = (props: any) => ( | ||
<CreateYAML | ||
{...props as any} | ||
kindObj={VirtualMachineModel.kind} | ||
plural={VirtualMachineModel.plural} | ||
/> | ||
); |
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
Oops, something went wrong.