mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Optional chaining used to enhance readability (#5961)
* Optional chaining used to enhance readability * Added Suggested change Co-authored-by: YashikaSarkar <65132044+YashikaSarkar@users.noreply.github.com>
This commit is contained in:
parent
41d25d54a7
commit
38181b2afa
@ -79,7 +79,7 @@ export default {
|
|||||||
const getNextPage = () => {
|
const getNextPage = () => {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
api('listProjects', { listAll: true, details: 'min', page: page, pageSize: 500, showIcon: true }).then(json => {
|
api('listProjects', { listAll: true, details: 'min', page: page, pageSize: 500, showIcon: true }).then(json => {
|
||||||
if (json && json.listprojectsresponse && json.listprojectsresponse.project) {
|
if (json?.listprojectsresponse?.listprojectsresponse.project) {
|
||||||
projects.push(...json.listprojectsresponse.project)
|
projects.push(...json.listprojectsresponse.project)
|
||||||
}
|
}
|
||||||
if (projects.length < json.listprojectsresponse.count) {
|
if (projects.length < json.listprojectsresponse.count) {
|
||||||
|
|||||||
@ -155,7 +155,7 @@ export default {
|
|||||||
this.tableChanged = true
|
this.tableChanged = true
|
||||||
},
|
},
|
||||||
filterItems () {
|
filterItems () {
|
||||||
if (this.appliedFilterStatus && this.appliedFilterStatus.length > 0) {
|
if (this.appliedFilterStatus?.length > 0) {
|
||||||
this.filteredItems = this.selectedItems.filter(item => {
|
this.filteredItems = this.selectedItems.filter(item => {
|
||||||
if (this.appliedFilterStatus.includes(item.status)) {
|
if (this.appliedFilterStatus.includes(item.status)) {
|
||||||
return item
|
return item
|
||||||
|
|||||||
@ -121,8 +121,7 @@ export default {
|
|||||||
api('listDedicatedZones', {
|
api('listDedicatedZones', {
|
||||||
zoneid: this.resource.id
|
zoneid: this.resource.id
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
if (response.listdedicatedzonesresponse.dedicatedzone &&
|
if (response?.listdedicatedzonesresponse?.dedicatedzone?.length > 0) {
|
||||||
response.listdedicatedzonesresponse.dedicatedzone.length > 0) {
|
|
||||||
this.dedicatedDomainId = response.listdedicatedzonesresponse.dedicatedzone[0].domainid
|
this.dedicatedDomainId = response.listdedicatedzonesresponse.dedicatedzone[0].domainid
|
||||||
this.dedicatedAccountId = response.listdedicatedzonesresponse.dedicatedzone[0].accountid
|
this.dedicatedAccountId = response.listdedicatedzonesresponse.dedicatedzone[0].accountid
|
||||||
}
|
}
|
||||||
@ -134,8 +133,7 @@ export default {
|
|||||||
api('listDedicatedPods', {
|
api('listDedicatedPods', {
|
||||||
podid: this.resource.id
|
podid: this.resource.id
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
if (response.listdedicatedpodsresponse.dedicatedpod &&
|
if (response?.listdedicatedpodsresponse?.dedicatedpod?.length > 0) {
|
||||||
response.listdedicatedpodsresponse.dedicatedpod.length > 0) {
|
|
||||||
this.dedicatedDomainId = response.listdedicatedpodsresponse.dedicatedpod[0].domainid
|
this.dedicatedDomainId = response.listdedicatedpodsresponse.dedicatedpod[0].domainid
|
||||||
this.dedicatedAccountId = response.listdedicatedpodsresponse.dedicatedpod[0].accountid
|
this.dedicatedAccountId = response.listdedicatedpodsresponse.dedicatedpod[0].accountid
|
||||||
}
|
}
|
||||||
@ -147,8 +145,7 @@ export default {
|
|||||||
api('listDedicatedClusters', {
|
api('listDedicatedClusters', {
|
||||||
clusterid: this.resource.id
|
clusterid: this.resource.id
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
if (response.listdedicatedclustersresponse.dedicatedcluster &&
|
if (response?.listdedicatedclustersresponse?.dedicatedcluster?.length > 0) {
|
||||||
response.listdedicatedclustersresponse.dedicatedcluster.length > 0) {
|
|
||||||
this.dedicatedDomainId = response.listdedicatedclustersresponse.dedicatedcluster[0].domainid
|
this.dedicatedDomainId = response.listdedicatedclustersresponse.dedicatedcluster[0].domainid
|
||||||
this.dedicatedAccountId = response.listdedicatedclustersresponse.dedicatedcluster[0].accountid
|
this.dedicatedAccountId = response.listdedicatedclustersresponse.dedicatedcluster[0].accountid
|
||||||
}
|
}
|
||||||
@ -160,8 +157,7 @@ export default {
|
|||||||
api('listDedicatedHosts', {
|
api('listDedicatedHosts', {
|
||||||
hostid: this.resource.id
|
hostid: this.resource.id
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
if (response.listdedicatedhostsresponse.dedicatedhost &&
|
if (response?.listdedicatedhostsresponse?.dedicatedhost?.length > 0) {
|
||||||
response.listdedicatedhostsresponse.dedicatedhost.length > 0) {
|
|
||||||
this.dedicatedDomainId = response.listdedicatedhostsresponse.dedicatedhost[0].domainid
|
this.dedicatedDomainId = response.listdedicatedhostsresponse.dedicatedhost[0].domainid
|
||||||
this.dedicatedAccountId = response.listdedicatedhostsresponse.dedicatedhost[0].accountid
|
this.dedicatedAccountId = response.listdedicatedhostsresponse.dedicatedhost[0].accountid
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user