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
diff --git a/src/store/modules/AccessControl/LocalUserMangementStore.js b/src/store/modules/AccessControl/LocalUserMangementStore.js
index 67c3a1e..7ad3ff5 100644
--- a/src/store/modules/AccessControl/LocalUserMangementStore.js
+++ b/src/store/modules/AccessControl/LocalUserMangementStore.js
@@ -257,6 +257,33 @@
             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);
+        });
     }
   }
 };