mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
parent
ee88c0ffcb
commit
9837534bbd
@ -66,7 +66,7 @@ const ImageCreateCard = memo(
|
||||
const classes = useStyles()
|
||||
|
||||
return (
|
||||
<Grid item xs={12} md={6} onClick={onClick}>
|
||||
<Grid item xs={12} md={6} onClick={onClick} data-cy="create">
|
||||
<Paper variant="outlined" className={classes.root}>
|
||||
{Icon && (
|
||||
<Box className={classes.figure}>
|
||||
|
@ -23,7 +23,9 @@ import { T } from 'client/constants'
|
||||
|
||||
export const STEP_ID = 'advanced'
|
||||
|
||||
const Content = () => <FormWithSchema id={STEP_ID} fields={FIELDS} />
|
||||
const Content = () => (
|
||||
<FormWithSchema id={STEP_ID} fields={FIELDS} cy={`${STEP_ID}`} />
|
||||
)
|
||||
|
||||
/**
|
||||
* Advanced options create image.
|
||||
|
@ -24,7 +24,9 @@ import { T } from 'client/constants'
|
||||
|
||||
export const STEP_ID = 'general'
|
||||
|
||||
const Content = () => <FormWithSchema id={STEP_ID} fields={FIELDS} />
|
||||
const Content = () => (
|
||||
<FormWithSchema id={STEP_ID} fields={FIELDS} cy={`${STEP_ID}`} />
|
||||
)
|
||||
|
||||
/**
|
||||
* General configuration about VM Template.
|
||||
|
@ -25,6 +25,7 @@ export default [
|
||||
{ Header: 'Name', accessor: 'NAME' },
|
||||
{ Header: 'Owner', accessor: 'UNAME' },
|
||||
{ Header: 'Group', accessor: 'GNAME' },
|
||||
{ Header: 'Locked', id: 'locked', accessor: 'LOCK' },
|
||||
{
|
||||
Header: 'State',
|
||||
id: 'STATE',
|
||||
|
@ -36,7 +36,7 @@ const Row = ({ original, value, ...props }) => {
|
||||
TYPE,
|
||||
DISK_TYPE,
|
||||
PERSISTENT,
|
||||
LOCK,
|
||||
locked,
|
||||
DATASTORE,
|
||||
TOTAL_VMS,
|
||||
RUNNING_VMS,
|
||||
@ -59,7 +59,7 @@ const Row = ({ original, value, ...props }) => {
|
||||
<Typography noWrap component="span" data-cy="name">
|
||||
{NAME}
|
||||
</Typography>
|
||||
{LOCK && <Lock />}
|
||||
{locked && <Lock />}
|
||||
<span className={classes.labels}>
|
||||
{labels.map((label) => (
|
||||
<StatusChip key={label} text={label} />
|
||||
|
@ -26,7 +26,11 @@ import { StatusChip } from 'client/components/Status'
|
||||
import { List } from 'client/components/Tabs/Common'
|
||||
|
||||
import { getType, getState } from 'client/models/Image'
|
||||
import { timeToString, booleanToString } from 'client/models/Helper'
|
||||
import {
|
||||
timeToString,
|
||||
booleanToString,
|
||||
levelLockToString,
|
||||
} from 'client/models/Helper'
|
||||
import { arrayToOptions, prettyBytes } from 'client/utils'
|
||||
import { T, Image, IMAGE_ACTIONS, IMAGE_TYPES } from 'client/constants'
|
||||
import { PATH } from 'client/apps/sunstone/routesOne'
|
||||
@ -49,6 +53,7 @@ const InformationPanel = ({ image = {}, actions }) => {
|
||||
NAME,
|
||||
SIZE,
|
||||
PERSISTENT,
|
||||
LOCK,
|
||||
REGTIME,
|
||||
DATASTORE_ID,
|
||||
DATASTORE = '--',
|
||||
@ -110,6 +115,11 @@ const InformationPanel = ({ image = {}, actions }) => {
|
||||
handleEdit: handleChangeType,
|
||||
dataCy: 'type',
|
||||
},
|
||||
{
|
||||
name: T.Locked,
|
||||
value: levelLockToString(LOCK?.LOCKED),
|
||||
dataCy: 'locked',
|
||||
},
|
||||
{
|
||||
name: T.Persistent,
|
||||
value: booleanToString(+PERSISTENT),
|
||||
@ -127,6 +137,7 @@ const InformationPanel = ({ image = {}, actions }) => {
|
||||
{
|
||||
name: T.State,
|
||||
value: <StatusChip text={stateName} stateColor={stateColor} />,
|
||||
dataCy: 'state',
|
||||
},
|
||||
{
|
||||
name: T.RunningVMs,
|
||||
|
@ -27,6 +27,7 @@ import {
|
||||
Permission,
|
||||
IMAGE_TYPES_STR,
|
||||
} from 'client/constants'
|
||||
import { getType } from 'client/models/Image'
|
||||
|
||||
const { IMAGE } = ONE_RESOURCES
|
||||
const { IMAGE_POOL } = ONE_RESOURCES_POOL
|
||||
@ -50,7 +51,19 @@ const imageApi = oneApi.injectEndpoints({
|
||||
|
||||
return { params, command }
|
||||
},
|
||||
transformResponse: (data) => [data?.IMAGE_POOL?.IMAGE ?? []].flat(),
|
||||
transformResponse: (data) => {
|
||||
const images = data?.IMAGE_POOL?.IMAGE?.filter?.((image) => {
|
||||
const type = getType(image)
|
||||
|
||||
return (
|
||||
type === IMAGE_TYPES_STR.OS ||
|
||||
type === IMAGE_TYPES_STR.CDROM ||
|
||||
type === IMAGE_TYPES_STR.DATABLOCK
|
||||
)
|
||||
})
|
||||
|
||||
return [images ?? []].flat()
|
||||
},
|
||||
providesTags: (images) =>
|
||||
images
|
||||
? [
|
||||
|
Loading…
x
Reference in New Issue
Block a user