winterhazel commented on code in PR #9930:
URL: https://github.com/apache/cloudstack/pull/9930#discussion_r1843053061
##########
ui/src/components/view/ListView.vue:
##########
@@ -240,6 +240,12 @@
<template v-if="column.key === 'agentstate'">
<status :text="text ? text : ''" displayText />
</template>
+ <template v-if="column.key === 'cpunumber'">
+ <span>{{ record.serviceofferingdetails ?
`${record.serviceofferingdetails.mincpunumber} -
${record.serviceofferingdetails.maxcpunumber}` : record.cpunumber }}</span>
+ </template>
+ <template v-if="column.key === 'memory'">
+ <span>{{ record.serviceofferingdetails ?
`${record.serviceofferingdetails.minmemory} -
${record.serviceofferingdetails.maxmemory}` : record.memory }}</span>
Review Comment:
```suggestion
<span>{{ record.serviceofferingdetails?.minmemory &&
record.serviceofferingdetails?.maxmemory ?
`${record.serviceofferingdetails.minmemory} -
${record.serviceofferingdetails.maxmemory}` : record.memory }}</span>
```
Same situation here
##########
ui/src/components/view/ListView.vue:
##########
@@ -240,6 +240,12 @@
<template v-if="column.key === 'agentstate'">
<status :text="text ? text : ''" displayText />
</template>
+ <template v-if="column.key === 'cpunumber'">
+ <span>{{ record.serviceofferingdetails ?
`${record.serviceofferingdetails.mincpunumber} -
${record.serviceofferingdetails.maxcpunumber}` : record.cpunumber }}</span>
Review Comment:
```suggestion
<span>{{ record.serviceofferingdetails?.mincpunumber &&
record.serviceofferingdetails?.maxcpunumber ?
`${record.serviceofferingdetails.mincpunumber} -
${record.serviceofferingdetails.maxcpunumber}` : record.cpunumber }}</span>
```
This results in an error when `serviceofferingdetails` contains details
other than `mincpunumber` and `maxcpunumber`, such as when the compute offering
is associated to a zone. We should check if both `mincpunumber` and
`maxcpunumber` are present instead.

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]