1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

F #5637: Add VROUTER attribute to template form (#2073)

This commit is contained in:
Sergio Betanzos 2022-05-24 18:17:47 +02:00 committed by GitHub
parent 145b281174
commit c1e7669037
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 6 deletions

View File

@ -64,8 +64,7 @@ const VmTemplateCard = memo(
GNAME,
REGTIME,
LOCK,
VROUTER,
TEMPLATE: { HYPERVISOR, LABELS, LOGO = '' } = {},
TEMPLATE: { VROUTER, HYPERVISOR, LABELS, LOGO = '' } = {},
} = template
const isExternalImage = useMemo(() => isExternalURL(LOGO), [LOGO])
@ -104,7 +103,7 @@ const VmTemplateCard = memo(
<span className={classes.labels}>
{HYPERVISOR && <StatusChip text={HYPERVISOR} />}
{LOCK && <Lock />}
{VROUTER && <StatusChip text={VROUTER} />}
{VROUTER && <StatusChip text={'VROUTER'} />}
<MultipleTags tags={labels} />
</span>
</div>

View File

@ -154,7 +154,7 @@ const RES_TABLE = {
},
},
[TYPES.VM]: {
initialState: { filters: [{ id: 'STATE', value: STATES.POWEROFF }] },
initialState: { filters: [{ id: 'state', value: STATES.POWEROFF }] },
},
[TYPES.VM_TEMPLATE]: { classes },
}[type]

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
import { string } from 'yup'
import { string, boolean } from 'yup'
import Image from 'client/components/Image'
import { Field, arrayToOptions } from 'client/utils'
@ -99,6 +99,15 @@ export const LOGO = {
grid: { md: 12 },
}
/** @type {Field} Virtual Router field */
export const VROUTER_FIELD = {
name: 'VROUTER',
label: T.MakeTemplateAvailableForVROnly,
type: INPUT_TYPES.SWITCH,
validation: boolean().yesOrNo(),
grid: { md: 12 },
}
/**
* @param {boolean} isUpdate - If `true`, the form is being updated
* @returns {Field[]} List of information fields

View File

@ -18,6 +18,7 @@ import { BaseSchema } from 'yup'
import {
FIELDS as INFORMATION_FIELDS,
HYPERVISOR_FIELD,
VROUTER_FIELD,
} from './informationSchema'
import {
MEMORY_FIELDS,
@ -52,7 +53,7 @@ const SECTIONS = (hypervisor, isUpdate) => [
id: 'hypervisor',
legend: T.Hypervisor,
required: true,
fields: [HYPERVISOR_FIELD],
fields: [HYPERVISOR_FIELD, VROUTER_FIELD],
},
{
id: 'capacity',

View File

@ -524,6 +524,8 @@ module.exports = {
When creating several VMs, the wildcard %%idx will be
replaced with a number starting from 0`,
NumberOfInstances: 'Number of instances',
MakeTemplateAvailableForVROnly:
'Make this template available for Virtual Router machines only',
VmOnHoldState: 'Start VM on hold state',
VmOnHoldStateConcept: `
Sets the new VM to hold state, instead of pending.