From 1b1c1005905c0d5a0145377718ad773fe08d0863 Mon Sep 17 00:00:00 2001 From: Yoshie Muranaka Date: Thu, 20 Feb 2020 10:18:36 -0800 Subject: Add account settings to local user page Adds ability to change account LockoutThreshold and LockoutDuration properties from the GUI. Signed-off-by: Yoshie Muranaka Change-Id: Ieeb75aa83c07b3de840bccdfc28e2d6e87512e2e --- .../AccessControl/LocalUserMangementStore.js | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/store/modules/AccessControl/LocalUserMangementStore.js') diff --git a/src/store/modules/AccessControl/LocalUserMangementStore.js b/src/store/modules/AccessControl/LocalUserMangementStore.js index 67c3a1e4..7ad3ff50 100644 --- a/src/store/modules/AccessControl/LocalUserMangementStore.js +++ b/src/store/modules/AccessControl/LocalUserMangementStore.js @@ -257,6 +257,33 @@ const LocalUserManagementStore = { return toastMessages; }) ); + }, + async saveAccountSettings( + { dispatch }, + { lockoutThreshold, lockoutDuration } + ) { + const data = {}; + if (lockoutThreshold !== undefined) { + data.AccountLockoutThreshold = lockoutThreshold; + } + if (lockoutDuration !== undefined) { + data.AccountLockoutDuration = lockoutDuration; + } + + return await api + .patch('/redfish/v1/AccountService', data) + //GET new settings to update view + .then(() => dispatch('getAccountSettings')) + .then(() => + i18n.t('localUserManagement.toastMessages.successSaveSettings') + ) + .catch(error => { + console.log(error); + const message = i18n.t( + 'localUserManagement.toastMessages.errorSaveSettings' + ); + throw new Error(message); + }); } } }; -- cgit v1.2.3