diff options
author | Yoshie Muranaka <yoshiemuranaka@gmail.com> | 2020-02-20 21:18:36 +0300 |
---|---|---|
committer | Yoshie Muranaka <yoshiemuranaka@gmail.com> | 2020-02-25 01:53:37 +0300 |
commit | 1b1c1005905c0d5a0145377718ad773fe08d0863 (patch) | |
tree | 977960b251df84403364eee9337e33810c606a87 /src/store/modules | |
parent | 52b0223005c91dc95f82ef0752ea2f3ae50788e6 (diff) | |
download | webui-vue-1b1c1005905c0d5a0145377718ad773fe08d0863.tar.xz |
Add account settings to local user page
Adds ability to change account LockoutThreshold and
LockoutDuration properties from the GUI.
Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: Ieeb75aa83c07b3de840bccdfc28e2d6e87512e2e
Diffstat (limited to 'src/store/modules')
-rw-r--r-- | src/store/modules/AccessControl/LocalUserMangementStore.js | 27 |
1 files changed, 27 insertions, 0 deletions
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); + }); } } }; |