Copilot commented on code in PR #11164: URL: https://github.com/apache/cloudstack/pull/11164#discussion_r2232791589
########## ui/src/views/compute/DeployVM.vue: ########## @@ -1381,6 +1391,12 @@ export default { queryArchId () { return this.$route.query.arch || null }, + querySnapshotId () { + return this.$route.query.snapshotid | null Review Comment: The bitwise OR operator '|' should be the logical OR operator '||' to match the pattern used in other query methods. ```suggestion return this.$route.query.snapshotid || null ``` ########## ui/src/views/compute/DeployVM.vue: ########## @@ -2680,6 +2835,50 @@ export default { this.loading.isos = false }) }, + fetchAllVolumes (params) { + const promises = [] + const volumes = {} + this.loading.volumes = true + this.imageSearchFilters = params + const volumeFilters = this.getImageFilters(params) + volumeFilters.forEach((filter) => { + volumes[filter] = { count: 0, iso: [] } Review Comment: The property name should be 'volume' instead of 'iso' to match the volume context and be consistent with the response structure. ```suggestion volumes[filter] = { count: 0, volume: [] } ``` ########## ui/src/views/compute/DeployVM.vue: ########## @@ -2680,6 +2835,50 @@ export default { this.loading.isos = false }) }, + fetchAllVolumes (params) { + const promises = [] + const volumes = {} + this.loading.volumes = true + this.imageSearchFilters = params + const volumeFilters = this.getImageFilters(params) + volumeFilters.forEach((filter) => { + volumes[filter] = { count: 0, iso: [] } + promises.push(this.fetchUnattachedVolumes(filter, params)) + }) + this.options.volumes = volumes + Promise.all(promises).then((response) => { + response.forEach((resItem, idx) => { + volumes[volumeFilters[idx]] = _.isEmpty(resItem.listvolumesresponse) ? { count: 0, volume: [] } : resItem.listvolumesresponse + this.options.volumes = { ...volumes } + }) + }).catch((reason) => { + console.log(reason) + }).finally(() => { + this.loading.volumes = false + }) + }, + fetchAllSnapshots (params) { + const promises = [] + const snapshots = {} + this.loading.snapshots = true + this.imageSearchFilters = params + const snapshotFilters = this.getImageFilters(params) + snapshotFilters.forEach((filter) => { + snapshots[filter] = { count: 0, iso: [] } Review Comment: The property name should be 'snapshot' instead of 'iso' to match the snapshot context and be consistent with the response structure. ```suggestion snapshots[filter] = { count: 0, snapshot: [] } ``` -- 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: commits-unsubscr...@cloudstack.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org