Skip to content
This repository was archived by the owner on Jan 20, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/view/DetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
{{ service.name }} : {{ service.provider[0].name }}
</div>
</div>
<div v-else-if="$route.meta.name === 'backup' && item === 'volumes'">
<div v-for="(volume, idx) in JSON.parse(resource[item])" :key="idx">
<router-link :to="{ path: '/volume/' + volume.uuid }">{{ volume.type }} - {{ volume.path }}</router-link> ({{ parseFloat(volume.size / (1024.0 * 1024.0 * 1024.0)).toFixed(1) }} GB)
</div>
</div>
<div v-else>
{{ resource[item] }}
</div>
Expand Down
32 changes: 19 additions & 13 deletions src/components/view/InfoCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</div>
<slot name="name">
<h4 class="name">
{{ resource.displayname || resource.displaytext || resource.name || resource.hostname || resource.username || resource.ipaddress }}
{{ resource.displayname || resource.displaytext || resource.name || resource.hostname || resource.username || resource.ipaddress || resource.virtualmachinename }}
</h4>
<console style="margin-left: 10px" :resource="resource" size="default" v-if="resource.id" />
</slot>
Expand Down Expand Up @@ -214,8 +214,8 @@
<div class="resource-detail-item__label">{{ $t('disksize') }}</div>
<div class="resource-detail-item__details">
<a-icon type="hdd" />
<span style="width: 100%;" v-if="resource.volumes">{{ (resource.volumes.reduce((total, item) => total += item.size, 0) / (1024 * 1024 * 1024.0)).toFixed(2) }} GB Storage</span>
<span style="width: 100%;" v-else-if="resource.sizegb">{{ resource.sizegb }}</span>
<span style="width: 100%;" v-if="$route.meta.name === 'vm' && resource.volumes">{{ (resource.volumes.reduce((total, item) => total += item.size, 0) / (1024 * 1024 * 1024.0)).toFixed(2) }} GB Storage</span>
<span style="width: 100%;" v-else-if="resource.sizegb || resource.size">{{ resource.sizegb || (resource.size/1024.0) }}</span>
</div>
<div style="margin-left: 25px; margin-top: 5px" v-if="resource.diskkbsread && resource.diskkbswrite && resource.diskioread && resource.diskiowrite">
<a-tag style="margin-bottom: 5px;">Read {{ toSize(resource.diskkbsread) }}</a-tag>
Expand Down Expand Up @@ -332,6 +332,17 @@
<router-link :to="{ path: '/vpc/' + resource.vpcid }">{{ resource.vpcname || resource.vpcid }}</router-link>
</div>
</div>
<div class="resource-detail-item" v-if="resource.affinitygroup && resource.affinitygroup.length > 0">
<div class="resource-detail-item__label">{{ $t('affinitygroup') }}</div>
<a-icon type="swap" />
<span
v-for="(group, index) in resource.affinitygroup"
:key="group.id"
>
<router-link :to="{ path: '/affinitygroup/' + group.id }">{{ group.name }}</router-link>
<span v-if="index + 1 < resource.affinitygroup.length">, </span>
</span>
</div>
<div class="resource-detail-item" v-if="resource.serviceofferingname && resource.serviceofferingid">
<div class="resource-detail-item__label">{{ $t('serviceofferingname') }}</div>
<div class="resource-detail-item__details">
Expand All @@ -353,6 +364,11 @@
<router-link :to="{ path: '/diskoffering/' + resource.diskofferingid }">{{ resource.diskofferingname || resource.diskofferingid }} </router-link>
</div>
</div>
<div class="resource-detail-item" v-if="resource.backupofferingid">
<div class="resource-detail-item__label">{{ $t('backupofferingid') }}</div>
<a-icon type="cloud-upload" />
<router-link :to="{ path: '/backupoffering/' + resource.backupofferingid }">{{ resource.backupofferingname || resource.backupofferingid }} </router-link>
</div>
<div class="resource-detail-item" v-if="resource.networkofferingid">
<div class="resource-detail-item__label">{{ $t('networkofferingid') }}</div>
<div class="resource-detail-item__details">
Expand Down Expand Up @@ -441,16 +457,6 @@
<a-icon type="calendar" />{{ resource.created }}
</div>
</div>
<div class="resource-detail-item" v-if="resource.affinitygroup && resource.affinitygroup.length > 0">
<a-icon type="swap" />
<span
v-for="(group, index) in resource.affinitygroup"
:key="group.id"
>
<router-link :to="{ path: '/affinitygroup/' + group.id }">{{ group.name }}</router-link>
<span v-if="index + 1 < resource.affinitygroup.length">, </span>
</span>
</div>
</div>

<div class="account-center-tags" v-if="$route.meta.related">
Expand Down
59 changes: 59 additions & 0 deletions src/config/section/compute.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export default {
name: 'vmsnapshot',
title: 'VM Snapshots',
param: 'virtualmachineid'
}, {
name: 'backup',
title: 'Backups',
param: 'virtualmachineid'
}, {
name: 'affinitygroup',
title: 'Affinity Groups',
Expand Down Expand Up @@ -125,6 +129,61 @@ export default {
}
}
},
{
api: 'assignVirtualMachineToBackupOffering',
icon: 'folder-add',
label: 'Assign VM to Backup Offering',
dataView: true,
args: ['virtualmachineid', 'backupofferingid'],
show: (record) => { return !record.backupofferingid },
mapping: {
virtualmachineid: {
value: (record, params) => { return record.id }
}
}
},
{
api: 'createBackup',
icon: 'cloud-upload',
label: 'Create Backup',
dataView: true,
args: ['virtualmachineid'],
show: (record) => { return record.backupofferingid },
mapping: {
virtualmachineid: {
value: (record, params) => { return record.id }
}
}
},
{
api: 'createBackupSchedule',
icon: 'schedule',
label: 'Configure Backup Schedule',
dataView: true,
args: ['virtualmachineid', 'intervaltype', 'schedule', 'timezone'],
show: (record) => { return record.backupofferingid },
mapping: {
virtualmachineid: {
value: (record, params) => { return record.id }
},
intervaltype: {
options: ['HOURLY', 'DAILY', 'WEEKLY', 'MONTHLY']
}
}
},
{
api: 'removeVirtualMachineFromBackupOffering',
icon: 'scissor',
label: 'Remove VM from Backup Offering',
dataView: true,
args: ['virtualmachineid', 'forced'],
show: (record) => { return record.backupofferingid },
mapping: {
virtualmachineid: {
value: (record, params) => { return record.id }
}
}
},
{
api: 'attachIso',
icon: 'paper-clip',
Expand Down
20 changes: 20 additions & 0 deletions src/config/section/offering.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,26 @@ export default {
dataView: true
}]
},
{
name: 'backupoffering',
title: 'Backup Offerings',
icon: 'cloud-upload',
permission: ['listBackupOfferings'],
columns: ['name', 'description', 'zoneid'],
details: ['name', 'id', 'description', 'externalid', 'zone', 'created'],
actions: [{
api: 'importBackupOffering',
icon: 'plus',
label: 'Import Offering',
listView: true,
args: ['name', 'description', 'zoneid', 'externalid']
}, {
api: 'deleteBackupOffering',
icon: 'delete',
label: 'Delete Offering',
dataView: true
}]
},
{
name: 'networkoffering',
title: 'Network Offerings',
Expand Down
52 changes: 52 additions & 0 deletions src/config/section/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,58 @@ export default {
}
}
]
},
{
name: 'backup',
title: 'Backups',
icon: 'cloud-upload',
permission: ['listBackups'],
columns: [{ name: (record) => { return record.virtualmachinename } }, 'status', 'type', 'created', 'account', 'zone'],
details: ['virtualmachinename', 'id', 'type', 'externalid', 'size', 'virtualsize', 'volumes', 'backupofferingname', 'zone', 'account', 'domain', 'created'],
actions: [
{
api: 'restoreBackup',
icon: 'sync',
label: 'Restore Backup',
dataView: true
},
{
api: 'restoreVolumeFromBackupAndAttachToVM',
icon: 'paper-clip',
label: 'Restore Volume and Attach',
dataView: true,
args: ['backupid', 'virtualmachineid', 'volumeid'],
mapping: {
backupid: {
value: (record) => { return record.id }
},
volumeid: {
options: ['todo: handle custom volume ID']
}
}
},
{
api: 'removeVirtualMachineFromBackupOffering',
icon: 'scissor',
label: 'Expunge Offering Assignment and Delete Backups',
dataView: true,
args: ['forced', 'virtualmachineid'],
mapping: {
forced: {
value: (record) => { return true }
},
virtualmachineid: {
value: (record) => { return record.virtualmachineid }
}
}
},
{
api: 'deleteBackup',
icon: 'delete',
label: 'Delete Backup',
dataView: true
}
]
}
]
}
4 changes: 3 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"add-scaleUpcondition": "Add",
"address": "Address",
"admin": "Domain Admin",
"affinitygroup": "Affinity Group",
"agentPassword": "Agent Password",
"agentPort": "Agent Port",
"agentUsername": "Agent Username",
Expand All @@ -95,6 +96,7 @@
"baremetalCpuCores": "# of CPU Cores",
"baremetalMAC": "Host MAC",
"baremetalMemory": "Memory (in MB)",
"backupofferingid": "Backup Offering",
"bcfdeviceid": "ID",
"bladeid": "Blade ID",
"bootable": "Bootable",
Expand Down Expand Up @@ -1035,7 +1037,7 @@
"volumegroup": "Volume Group",
"volumeids": "Volumes to be deleted",
"volumename": "Volume Name",
"volumes": "Volumes to be deleted",
"volumes": "Volumes",
"volumetotal": "Volume",
"volume.volumeFileUpload.description": "Click or drag file to this area to upload",
"vpcLimit": "VPC limits",
Expand Down