stag7824 commented on issue #13944:
URL: https://github.com/apache/cloudstack/issues/13944#issuecomment-5662888603
I had a look at this. I could not reproduce it for resource types 15 and 16
specifically, and I think the diagnosis in the report is off — though there is
a real gap next door.
`ResourceLimitTab.vue` builds the limits panel entirely from what
`listResourceLimits` returns; there is no hardcoded list of types to filter
against. Each label is looked up as:
```js
$t('label.max' + item.resourcetypename.replace('_', ''))
```
For 15 and 16 that resolves to `label.maxobjectstorage` and `label.maxgpu`,
and both are present in `en.json` ("Max. Object Storage (GiB)" and "Max.
GPUs"). Resolving all 17 `Resource.ResourceType` values through that expression
against the real locale file, the only one that misses is **type 12, `backup`**
→ `label.maxbackup`, which exists in no locale. That row renders the raw key.
I've opened #14163 for it.
Two things that may actually be behind what you saw, @ms30063600 — both
worth checking against your setup:
1. **Storage types are converted to GiB on the way out.**
`ApiResponseHelper.createResourceLimitResponse` divides by `bytesToGiB` and
rounds up for every type where `ResourceType.isStorageType` is true, which
includes `object_storage` (15). So a limit set in bytes via
`updateResourceLimit` comes back in GiB in `listResourceLimits`, and the UI
shows the GiB figure. Values under 1 GiB round up to 1. GPU (16) is not a
storage type and is not converted. If the number you set and the number
displayed differ by a factor of ~2^30, that's this.
2. **A limit of `0` displays as Unlimited.** In `fetchData`, tagged limits
are read as `subItem.max || -1`, so a stored `0` becomes `-1`. Untagged limits
get corrected a few lines later by `form[item.resourcetype] = item.max == null
? -1 : item.max`, but tagged ones do not, and `origValues` is only recorded for
the untagged entry — so a tagged limit of 0 both displays as Unlimited and is
written back as `-1` on the next save. That one looks like a genuine bug to me,
separate from the label. Happy to raise it separately if it isn't already known.
Could you say which values you set for 15 and 16, and whether the rows were
tagged? That would tell us which of these you hit.
--
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]