diff options
author | Ed Tanous <ed@tanous.net> | 2024-02-27 22:26:24 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2024-03-05 07:23:10 +0300 |
commit | 8132399c29a07b783d2b24ccd80da7676460dbf3 (patch) | |
tree | d309b7cdaeeb63092d905da2a2df97e492e3bb02 /src/store/modules/SecurityAndAccess | |
parent | a0c29207a44028fd04e881bbd4e3cbc44ced35ac (diff) | |
download | webui-vue-8132399c29a07b783d2b24ccd80da7676460dbf3.tar.xz |
Reformat files with new linter
All changes should be whitespace, and were done using npm run-script
lint.
Change-Id: I943c6b435c5c872841af5affc1e89910468b5ca6
Signed-off-by: Ed Tanous <ed@tanous.net>
Diffstat (limited to 'src/store/modules/SecurityAndAccess')
4 files changed, 49 insertions, 45 deletions
diff --git a/src/store/modules/SecurityAndAccess/CertificatesStore.js b/src/store/modules/SecurityAndAccess/CertificatesStore.js index 97241f34..3583d7f1 100644 --- a/src/store/modules/SecurityAndAccess/CertificatesStore.js +++ b/src/store/modules/SecurityAndAccess/CertificatesStore.js @@ -24,7 +24,7 @@ export const CERTIFICATE_TYPES = [ const getCertificateProp = (type, prop) => { const certificate = CERTIFICATE_TYPES.find( - (certificate) => certificate.type === type + (certificate) => certificate.type === type, ); return certificate ? certificate[prop] : null; }; @@ -51,12 +51,16 @@ const CertificatesStore = { async getCertificates({ commit }) { return await api .get('/redfish/v1/CertificateService/CertificateLocations') - .then(({ data: { Links: { Certificates } } }) => - Certificates.map((certificate) => certificate['@odata.id']) + .then( + ({ + data: { + Links: { Certificates }, + }, + }) => Certificates.map((certificate) => certificate['@odata.id']), ) .then((certificateLocations) => { const promises = certificateLocations.map((location) => - api.get(location) + api.get(location), ); api.all(promises).then( api.spread((...responses) => { @@ -82,12 +86,12 @@ const CertificatesStore = { ({ type }) => !certificates .map((certificate) => certificate.type) - .includes(type) + .includes(type), ); commit('setCertificates', certificates); commit('setAvailableUploadTypes', availableUploadTypes); - }) + }), ); }); }, @@ -100,7 +104,7 @@ const CertificatesStore = { .then(() => i18n.t('pageCertificates.toast.successAddCertificate', { certificate: getCertificateProp(type, 'label'), - }) + }), ) .catch((error) => { console.log(error); @@ -109,7 +113,7 @@ const CertificatesStore = { }, async replaceCertificate( { dispatch }, - { certificateString, location, type } + { certificateString, location, type }, ) { const data = {}; data.CertificateString = certificateString; @@ -119,18 +123,18 @@ const CertificatesStore = { return await api .post( '/redfish/v1/CertificateService/Actions/CertificateService.ReplaceCertificate', - data + data, ) .then(() => dispatch('getCertificates')) .then(() => i18n.t('pageCertificates.toast.successReplaceCertificate', { certificate: getCertificateProp(type, 'label'), - }) + }), ) .catch((error) => { console.log(error); throw new Error( - i18n.t('pageCertificates.toast.errorReplaceCertificate') + i18n.t('pageCertificates.toast.errorReplaceCertificate'), ); }); }, @@ -141,12 +145,12 @@ const CertificatesStore = { .then(() => i18n.t('pageCertificates.toast.successDeleteCertificate', { certificate: getCertificateProp(type, 'label'), - }) + }), ) .catch((error) => { console.log(error); throw new Error( - i18n.t('pageCertificates.toast.errorDeleteCertificate') + i18n.t('pageCertificates.toast.errorDeleteCertificate'), ); }); }, @@ -190,7 +194,7 @@ const CertificatesStore = { return await api .post( '/redfish/v1/CertificateService/Actions/CertificateService.GenerateCSR', - data + data, ) //TODO: Success response also throws error so // can't accurately show legitimate error in UI diff --git a/src/store/modules/SecurityAndAccess/LdapStore.js b/src/store/modules/SecurityAndAccess/LdapStore.js index 5aa31c2d..edb063c7 100644 --- a/src/store/modules/SecurityAndAccess/LdapStore.js +++ b/src/store/modules/SecurityAndAccess/LdapStore.js @@ -56,7 +56,7 @@ const LdapStore = { } = {}, } = {}, RemoteRoleMapping = [], - } + }, ) => { state.ldap.serviceAddress = ServiceAddresses[0]; state.ldap.serviceEnabled = ServiceEnabled; @@ -80,7 +80,7 @@ const LdapStore = { } = {}, } = {}, RemoteRoleMapping = [], - } + }, ) => { state.activeDirectory.serviceEnabled = ServiceEnabled; state.activeDirectory.serviceAddress = ServiceAddresses[0]; @@ -137,7 +137,7 @@ const LdapStore = { .catch((error) => { console.log(error); throw new Error( - i18n.t('pageLdap.toast.errorSaveActiveDirectorySettings') + i18n.t('pageLdap.toast.errorSaveActiveDirectorySettings'), ); }); }, @@ -152,7 +152,7 @@ const LdapStore = { baseDn, userIdAttribute, groupIdAttribute, - } + }, ) { const data = { ServiceEnabled: serviceEnabled, @@ -180,7 +180,7 @@ const LdapStore = { }, async addNewRoleGroup( { dispatch, getters }, - { groupName, groupPrivilege } + { groupName, groupPrivilege }, ) { const data = {}; const enabledRoleGroups = getters['enabledRoleGroups']; @@ -203,7 +203,7 @@ const LdapStore = { .then(() => i18n.t('pageLdap.toast.successAddRoleGroup', { groupName, - }) + }), ) .catch((error) => { console.log(error); @@ -233,7 +233,7 @@ const LdapStore = { .patch('/redfish/v1/AccountService', data) .then(() => dispatch('getAccountSettings')) .then(() => - i18n.t('pageLdap.toast.successSaveRoleGroup', { groupName }) + i18n.t('pageLdap.toast.successSaveRoleGroup', { groupName }), ) .catch((error) => { console.log(error); @@ -260,12 +260,12 @@ const LdapStore = { .patch('/redfish/v1/AccountService', data) .then(() => dispatch('getAccountSettings')) .then(() => - i18n.tc('pageLdap.toast.successDeleteRoleGroup', roleGroups.length) + i18n.tc('pageLdap.toast.successDeleteRoleGroup', roleGroups.length), ) .catch((error) => { console.log(error); throw new Error( - i18n.tc('pageLdap.toast.errorDeleteRoleGroup', roleGroups.length) + i18n.tc('pageLdap.toast.errorDeleteRoleGroup', roleGroups.length), ); }); }, diff --git a/src/store/modules/SecurityAndAccess/SessionsStore.js b/src/store/modules/SecurityAndAccess/SessionsStore.js index 0349c8b7..e567c524 100644 --- a/src/store/modules/SecurityAndAccess/SessionsStore.js +++ b/src/store/modules/SecurityAndAccess/SessionsStore.js @@ -18,10 +18,10 @@ const SessionsStore = { return await api .get('/redfish/v1/SessionService/Sessions') .then((response) => - response.data.Members.map((sessionLogs) => sessionLogs['@odata.id']) + response.data.Members.map((sessionLogs) => sessionLogs['@odata.id']), ) .then((sessionUris) => - api.all(sessionUris.map((sessionUri) => api.get(sessionUri))) + api.all(sessionUris.map((sessionUri) => api.get(sessionUri))), ) .then((sessionUris) => { const allConnectionsData = sessionUris.map((sessionUri) => { @@ -46,7 +46,7 @@ const SessionsStore = { api.delete(uri).catch((error) => { console.log(error); return error; - }) + }), ); return await api .all(promises) @@ -62,7 +62,7 @@ const SessionsStore = { if (successCount) { const message = i18n.tc( 'pageSessions.toast.successDelete', - successCount + successCount, ); toastMessages.push({ type: 'success', message }); } @@ -70,12 +70,12 @@ const SessionsStore = { if (errorCount) { const message = i18n.tc( 'pageSessions.toast.errorDelete', - errorCount + errorCount, ); toastMessages.push({ type: 'error', message }); } return toastMessages; - }) + }), ); }, }, diff --git a/src/store/modules/SecurityAndAccess/UserManagementStore.js b/src/store/modules/SecurityAndAccess/UserManagementStore.js index 3bdf91d2..50361580 100644 --- a/src/store/modules/SecurityAndAccess/UserManagementStore.js +++ b/src/store/modules/SecurityAndAccess/UserManagementStore.js @@ -69,7 +69,7 @@ const UserManagementStore = { return await api .get('/redfish/v1/AccountService/Accounts') .then((response) => - response.data.Members.map((user) => user['@odata.id']) + response.data.Members.map((user) => user['@odata.id']), ) .then((userIds) => api.all(userIds.map((user) => api.get(user)))) .then((users) => { @@ -94,7 +94,7 @@ const UserManagementStore = { .catch((error) => { console.log(error); const message = i18n.t( - 'pageUserManagement.toast.errorLoadAccountSettings' + 'pageUserManagement.toast.errorLoadAccountSettings', ); throw new Error(message); }); @@ -123,7 +123,7 @@ const UserManagementStore = { .then(() => i18n.t('pageUserManagement.toast.successCreateUser', { username, - }) + }), ) .catch((error) => { let serverMessages = getServerErrorMessages(error); @@ -138,7 +138,7 @@ const UserManagementStore = { }, async updateUser( { dispatch }, - { originalUsername, username, password, privilege, status, locked } + { originalUsername, username, password, privilege, status, locked }, ) { const data = {}; if (username) data.UserName = username; @@ -152,7 +152,7 @@ const UserManagementStore = { .then(() => i18n.t('pageUserManagement.toast.successUpdateUser', { username: originalUsername, - }) + }), ) .catch((error) => { console.log(error); @@ -173,7 +173,7 @@ const UserManagementStore = { .then(() => i18n.t('pageUserManagement.toast.successDeleteUser', { username, - }) + }), ) .catch((error) => { console.log(error); @@ -206,7 +206,7 @@ const UserManagementStore = { if (successCount) { const message = i18n.tc( 'pageUserManagement.toast.successBatchDelete', - successCount + successCount, ); toastMessages.push({ type: 'success', message }); } @@ -214,13 +214,13 @@ const UserManagementStore = { if (errorCount) { const message = i18n.tc( 'pageUserManagement.toast.errorBatchDelete', - errorCount + errorCount, ); toastMessages.push({ type: 'error', message }); } return toastMessages; - }) + }), ); }, async enableUsers({ dispatch }, users) { @@ -249,7 +249,7 @@ const UserManagementStore = { if (successCount) { const message = i18n.tc( 'pageUserManagement.toast.successBatchEnable', - successCount + successCount, ); toastMessages.push({ type: 'success', message }); } @@ -257,13 +257,13 @@ const UserManagementStore = { if (errorCount) { const message = i18n.tc( 'pageUserManagement.toast.errorBatchEnable', - errorCount + errorCount, ); toastMessages.push({ type: 'error', message }); } return toastMessages; - }) + }), ); }, async disableUsers({ dispatch }, users) { @@ -292,7 +292,7 @@ const UserManagementStore = { if (successCount) { const message = i18n.tc( 'pageUserManagement.toast.successBatchDisable', - successCount + successCount, ); toastMessages.push({ type: 'success', message }); } @@ -300,18 +300,18 @@ const UserManagementStore = { if (errorCount) { const message = i18n.tc( 'pageUserManagement.toast.errorBatchDisable', - errorCount + errorCount, ); toastMessages.push({ type: 'error', message }); } return toastMessages; - }) + }), ); }, async saveAccountSettings( { dispatch }, - { lockoutThreshold, lockoutDuration } + { lockoutThreshold, lockoutDuration }, ) { const data = {}; if (lockoutThreshold !== undefined) { |