Add button to enable/disable storage pool (#874)
* Add button to enable/disable storage pool
* Disable only if pool state is Up
diff --git a/src/config/section/infra/primaryStorages.js b/src/config/section/infra/primaryStorages.js
index a443ce5..9f78ab9 100644
--- a/src/config/section/infra/primaryStorages.js
+++ b/src/config/section/infra/primaryStorages.js
@@ -64,6 +64,24 @@
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',
label: 'label.action.enable.maintenance.mode',
diff --git a/src/locales/en.json b/src/locales/en.json
index 894b735..be1f776 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -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.",