From f400a4e0b1ab8e7bd935312c8dcdf759741ce8f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Beims=20Br=C3=A4scher?= Date: Wed, 2 Dec 2020 05:30:02 -0300 Subject: [PATCH] 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 --- ui/src/config/section/infra/primaryStorages.js | 18 ++++++++++++++++++ ui/src/locales/en.json | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/ui/src/config/section/infra/primaryStorages.js b/ui/src/config/section/infra/primaryStorages.js index a443ce584d6..9f78ab95768 100644 --- a/ui/src/config/section/infra/primaryStorages.js +++ b/ui/src/config/section/infra/primaryStorages.js @@ -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', diff --git a/ui/src/locales/en.json b/ui/src/locales/en.json index 894b7358c4f..be1f776d7b5 100644 --- a/ui/src/locales/en.json +++ b/ui/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.",