Генирировать массив обьектов циклом?
Как можно генерить такой массив обьектов через цикл?
getSliderListResourceUtilization() {
return [
{
preset: this.formattedPresent(this.resourceUtilization.cpuUsedInPercent),
cardTitle: `${this.$t('service.serviceVps.resourceUtilization.col.title')}`,
cardLabel: `${this.$t('service.serviceVps.resourceUtilization.col.name')}`,
unitMeasurement: '%',
firstCardIcon: 'cpu',
secondCardIcon: 'cpu',
firstCardLabel: `${this.$t('service.serviceVps.resourceUtilization.col.label')}`,
secondCardLabel: `${this.$t('service.serviceVps.resourceUtilization.col.label2')}`,
firstCardValue: '-',
secondCardValue: '-',
},
{
preset: this.resourceUtilization.ramUsedInPercent,
cardTitle: `${this.$t('service.serviceVps.resourceUtilization.col2.title')}`,
cardLabel: `${this.$t('service.serviceVps.resourceUtilization.col2.name')}`,
unitMeasurement: '%',
firstCardIcon: 'ram',
secondCardIcon: 'ram',
firstCardLabel: `${this.$t('service.serviceVps.resourceUtilization.col2.label')}`,
secondCardLabel: `${this.$t('service.serviceVps.resourceUtilization.col2.label2')}`,
firstCardValue: this.convertByteToMb(this.resourceUtilization.ramTotal),
secondCardValue: this.convertByteToMb(this.resourceUtilization.ramUsed),
},
{
preset: this.formattedPresent(this.resourceUtilization.sysLoadInPercent),
cardTitle: `${this.$t('service.serviceVps.resourceUtilization.col3.title')}`,
cardLabel: `${this.$t('service.serviceVps.resourceUtilization.col3.name')}`,
unitMeasurement: '%',
firstCardIcon: 'chart',
secondCardIcon: 'cpu',
firstCardLabel: `${this.$t('service.serviceVps.resourceUtilization.col3.label')}`,
secondCardLabel: `${this.$t('service.serviceVps.resourceUtilization.col3.label2')}`,
firstCardValue: this.formattedSystemLoadAvg(this.resourceUtilization.sysLoadAvg),
secondCardValue: (this.resourceUtilization.cpuCores || '-'),
},
{
preset: this.formattedPresent(this.resourceUtilization.diskSpaceUsedInPercent),
cardTitle: `${this.$t('service.serviceVps.resourceUtilization.col4.title')}`,
cardLabel: `${this.$t('service.serviceVps.resourceUtilization.col4.name')}`,
unitMeasurement: '%',
firstCardIcon: 'disk',
secondCardIcon: 'disk',
firstCardLabel: `${this.$t('service.serviceVps.resourceUtilization.col4.label')}`,
secondCardLabel: `${this.$t('service.serviceVps.resourceUtilization.col4.label2')}`,
firstCardValue: this.convertByteToGB(this.resourceUtilization.diskSpaceTotal),
secondCardValue: this.convertByteToGB(this.resourceUtilization.diskSpaceUsed),
},
{
progressType: 'simple',
cardTitle: `${this.$t('service.serviceVps.resourceUtilization.col5.title')}`,
cardLabel: `${this.$t('service.serviceVps.resourceUtilization.col5.name')}`,
unitMeasurement: 'GB',
summaryTotal: this.formattedBandwidthValue(this.resourceUtilization.bandwidth),
firstCardIcon: 'ram',
secondCardIcon: 'ram',
firstCardLabel: `${this.$t('service.serviceVps.resourceUtilization.col5.label')}`,
secondCardLabel: `${this.$t('service.serviceVps.resourceUtilization.col5.label2')}`,
firstCardValue: '∞',
secondCardValue: this.formattedBandwidthValue(this.resourceUtilization.bandwidth),
},
];
},