diff options
author | Sandeepa Singh <sandeepa.singh@ibm.com> | 2022-01-10 16:49:36 +0300 |
---|---|---|
committer | Dixsie Wolmers <dixsiew@gmail.com> | 2022-02-04 17:21:05 +0300 |
commit | 05887b50f1d1b08468b401b357faf13f505ee75f (patch) | |
tree | 9a016ca5142e43e3ac7f88ecce045048270fcaa0 /src/store/modules/Operations | |
parent | aee27141f4c002306e9a4bf44dc4f9618a5fae62 (diff) | |
download | webui-vue-05887b50f1d1b08468b401b357faf13f505ee75f.tar.xz |
Add Key clear page under Operations section
This page will allow privileged user to clear encrypted keys.
- Only admin and CE login user will be able to see the page
- The UI will be different for both, admin and CE login user(service)
- This page is IBM only
Signed-off-by: Sandeepa Singh <sandeepa.singh@ibm.com>
Change-Id: Ic6fe3454de815629a6b2250daa99ab21f2b316c3
Diffstat (limited to 'src/store/modules/Operations')
-rw-r--r-- | src/store/modules/Operations/KeyClearStore.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/store/modules/Operations/KeyClearStore.js b/src/store/modules/Operations/KeyClearStore.js new file mode 100644 index 00000000..1dc96e0f --- /dev/null +++ b/src/store/modules/Operations/KeyClearStore.js @@ -0,0 +1,25 @@ +import api from '@/store/api'; +import i18n from '@/i18n'; + +const KeyClearStore = { + namespaced: true, + actions: { + async clearEncryptionKeys(_, selectedKey) { + const selectedKeyForClearing = { + Attributes: { hb_key_clear_request: selectedKey }, + }; + return await api + .patch( + '/redfish/v1/Systems/system/Bios/Settings', + selectedKeyForClearing + ) + .then(() => i18n.t('pageKeyClear.toast.selectedKeyClearedSuccess')) + .catch((error) => { + console.log('Key clear', error); + throw new Error(i18n.t('pageKeyClear.toast.selectedKeyClearedError')); + }); + }, + }, +}; + +export default KeyClearStore; |