Add button to enable/disable storage pool (#874)

* Add button to enable/disable storage pool

* Disable only if pool state is Up

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Gabriel Beims Bräscher 2020-12-02 05:30:02 -03:00 committed by Rohit Yadav
parent 2998da0995
commit f400a4e0b1
2 changed files with 22 additions and 0 deletions

View File

@ -63,6 +63,24 @@ export default {
dataView: true,
args: ['name', 'tags', 'capacitybytes', 'capacityiops']
},
{
api: 'updateStoragePool',
icon: 'pause-circle',
label: 'label.disable.storage',
message: 'message.confirm.disable.storage',
dataView: true,
defaultArgs: { enabled: false },
show: (record) => { return record.state === 'Up' }
},
{
api: 'updateStoragePool',
icon: 'play-circle',
label: 'label.enable.storage',
message: 'message.confirm.enable.storage',
dataView: true,
defaultArgs: { enabled: true },
show: (record) => { return record.state === 'Disabled' }
},
{
api: 'enableStorageMaintenance',
icon: 'plus-square',

View File

@ -732,6 +732,7 @@
"label.directdownload": "Direct Download",
"label.disable.autoscale": "Disable Autoscale",
"label.disable.host": "Disable Host",
"label.disable.storage": "Disable Storage Pool",
"label.disable.network.offering": "Disable network offering",
"label.disable.provider": "Disable provider",
"label.disable.vnmc.provider": "Disable VNMC provider",
@ -830,6 +831,7 @@
"label.enable.provider": "Enable provider",
"label.enable.s3": "Enable S3-backed Secondary Storage",
"label.enable.swift": "Enable Swift",
"label.enable.storage": "Enable Storage Pool",
"label.enable.vnmc.device": "Enable VNMC device",
"label.enable.vnmc.provider": "Enable VNMC provider",
"label.enable.vpc.offering": "Enable VPC offering",
@ -2565,11 +2567,13 @@
"message.confirm.destroy.kubernetes.cluster": "Please confirm that you want to destroy this Kubernetes cluster.",
"message.confirm.destroy.router": "All services provided by this virtual router will be interrupted. Please confirm that you want to stop this router. Please confirm that you would like to destroy this router",
"message.confirm.disable.host": "Please confirm that you want to disable the host",
"message.confirm.disable.storage": "Please confirm that you want to disable the storage pool",
"message.confirm.disable.network.offering": "Are you sure you want to disable this network offering?",
"message.confirm.disable.provider": "Please confirm that you would like to disable this provider",
"message.confirm.disable.vnmc.provider": "Please confirm you would like to disable the VNMC provider.",
"message.confirm.disable.vpc.offering": "Are you sure you want to disable this VPC offering?",
"message.confirm.enable.host": "Please confirm that you want to enable the host",
"message.confirm.enable.storage": "Please confirm that you want to enable the storage pool",
"message.confirm.enable.network.offering": "Are you sure you want to enable this network offering?",
"message.confirm.enable.provider": "Please confirm that you would like to enable this provider",
"message.confirm.enable.vnmc.provider": "Please confirm you would like to enable the VNMC provider.",