summaryrefslogtreecommitdiff
path: root/src/store/modules/Operations
diff options
context:
space:
mode:
authorSandeepa Singh <sandeepa.singh@ibm.com>2022-01-10 16:49:36 +0300
committerDixsie Wolmers <dixsiew@gmail.com>2022-02-04 17:21:05 +0300
commit05887b50f1d1b08468b401b357faf13f505ee75f (patch)
tree9a016ca5142e43e3ac7f88ecce045048270fcaa0 /src/store/modules/Operations
parentaee27141f4c002306e9a4bf44dc4f9618a5fae62 (diff)
downloadwebui-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.js25
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;