diff --git a/src/components/Composables/useTableSelectableComposable.js b/src/components/Composables/useTableSelectableComposable.js index 9546ac580d..accb67fa25 100644 --- a/src/components/Composables/useTableSelectableComposable.js +++ b/src/components/Composables/useTableSelectableComposable.js @@ -63,6 +63,26 @@ const useTableSelectableComposable = () => { } }; + const toggleSelectRowByUsername = (tableRef, rowIndex, rowSelected, row) => { + if (tableRef && rowIndex !== undefined) { + if (!rowSelected) { + // Find the index of the object to remove + const indexToRemove = selectedRowsList.value.findIndex( + (item) => item.username === row.username, + ); + + // Check if the object exists in the array + if (indexToRemove !== -1) { + tableRef.unselectRow(rowIndex); + // Remove the object from the array + selectedRowsList.value.splice(indexToRemove, 1); + } + } else { + tableRef.selectRow(rowIndex); + } + } + }; + const toggleSelectRowByGroupName = (tableRef, rowIndex, rowSelected, row) => { if (tableRef && rowIndex !== undefined) { if (!rowSelected) { @@ -117,6 +137,7 @@ const useTableSelectableComposable = () => { toggleSelectRow, toggleSelectRowById, toggleSelectRowByGroupName, + toggleSelectRowByUsername, onRowSelected, onChangeHeaderCheckbox, selectedRowsList, diff --git a/src/components/Global/InfoTooltipPassword.vue b/src/components/Global/InfoTooltipPassword.vue index 98cfc0c928..caed983a46 100644 --- a/src/components/Global/InfoTooltipPassword.vue +++ b/src/components/Global/InfoTooltipPassword.vue @@ -8,7 +8,6 @@ - {{ $t('global.ariaLabel.tooltip') }}

diff --git a/src/router/routes.js b/src/router/routes.js index 2bfe168162..0d05947689 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -22,6 +22,7 @@ import PcieTopology from '../views/HardwareStatus/PcieTopology/PcieTopology.vue' import IBMiServiceFunctions from '@/views/Logs/IBMiServiceFunctions'; import Notices from '@/views/Notices/Notices.vue'; import Sessions from '@/views/SecurityAndAccess/Sessions'; +import UserManagement from '@/views/SecurityAndAccess/UserManagement'; import Firmware from '@/views/Operations/Firmware'; import Certificates from '@/views/SecurityAndAccess/Certificates'; import Inventory from '../views/HardwareStatus/Inventory/Inventory.vue'; @@ -272,6 +273,14 @@ export const routes = [ title: i18n.global.t('appPageTitle.sessions'), }, }, + { + path: '/security-and-access/user-management', + name: 'local-users', + component: UserManagement, + meta: { + title: i18n.global.t('appPageTitle.userManagement'), + }, + }, { path: '/security-and-access/certificates', name: 'certificates', diff --git a/src/store/modules/GlobalStore.js b/src/store/modules/GlobalStore.js index 158220e1b9..6fcff6aa0a 100644 --- a/src/store/modules/GlobalStore.js +++ b/src/store/modules/GlobalStore.js @@ -107,7 +107,6 @@ export const GlobalStore = defineStore('global', { .catch((error) => console.log(error)); }, getCurrentUser(username = localStorage.getItem('storedUsername')) { - if (localStorage.getItem('storedCurrentUser')) return; return api .get(`/redfish/v1/AccountService/Accounts/${username}`) .then(({ data }) => { diff --git a/src/store/modules/SecurityAndAccess/UserManagementStore.js b/src/store/modules/SecurityAndAccess/UserManagementStore.js index 495c4cdd05..f62b2dea3b 100644 --- a/src/store/modules/SecurityAndAccess/UserManagementStore.js +++ b/src/store/modules/SecurityAndAccess/UserManagementStore.js @@ -1,6 +1,6 @@ -import api from '@/store/api'; +import api, { getResponseCount } from '@/store/api'; import i18n from '@/i18n'; -// import { REGEX_MAPPINGS } from '@/utilities/GlobalConstants'; +import { REGEX_MAPPINGS } from '@/utilities/GlobalConstants'; import { defineStore } from 'pinia'; export const UserManagementStore = defineStore('userManagment', { @@ -8,12 +8,11 @@ export const UserManagementStore = defineStore('userManagment', { state: () => ({ allUsers: [], accountRoles: [], - // accountLockoutDuration: null, - // accountLockoutThreshold: null, - // accountMinPasswordLength: null, - // accountMaxPasswordLength: null, - - }), + accountLockoutDuration: null, + accountLockoutThreshold: null, + accountMinPasswordLength: null, + accountMaxPasswordLength: null, + }), getters: { allUsersGetter(state) { return state.allUsers; @@ -24,18 +23,18 @@ export const UserManagementStore = defineStore('userManagment', { filteredAccountRoles(state) { return state.accountRoles.filter((role) => role !== 'OemIBMServiceAgent'); }, - // accountSettings(state) { - // return { - // lockoutDuration: state.accountLockoutDuration, - // lockoutThreshold: state.accountLockoutThreshold, - // }; - // }, - // accountPasswordRequirements(state) { - // return { - // minLength: state.accountMinPasswordLength, - // maxLength: state.accountMaxPasswordLength, - // }; - // }, + accountSettingsGetter(state) { + return { + lockoutDuration: state.accountLockoutDuration, + lockoutThreshold: state.accountLockoutThreshold, + }; + }, + accountPasswordRequirementsGetter(state) { + return { + minLength: state.accountMinPasswordLength, + maxLength: state.accountMaxPasswordLength, + }; + }, }, actions: { async getUsers() { @@ -50,6 +49,9 @@ export const UserManagementStore = defineStore('userManagment', { .then((users) => { const userData = users.map((user) => user.data); this.allUsers = userData; + this.allUsers.map((user) => { + user.isSelected = false; + }) }) .catch((error) => { console.log(error); @@ -67,23 +69,23 @@ export const UserManagementStore = defineStore('userManagment', { throw new Error(message); }); }, - // getAccountSettings() { - // api - // .get('/redfish/v1/AccountService') - // .then(({ data }) => { - // this.lockoutDuration = data.AccountLockoutDuration; - // this.lockoutThreshold = data.AccountLockoutThreshold; - // this.minPasswordLength = data.MinPasswordLength; - // this.maxPasswordLength = data.MaxPasswordLength; - // }) - // .catch((error) => { - // console.log(error); - // const message = i18n.t( - // 'pageUserManagement.toast.errorLoadAccountSettings', - // ); - // throw new Error(message); - // }); - // }, + getAccountSettings() { + api + .get('/redfish/v1/AccountService') + .then(({ data }) => { + this.accountLockoutDuration = data.AccountLockoutDuration; + this.accountLockoutThreshold = data.AccountLockoutThreshold; + this.accountMinPasswordLength = data.MinPasswordLength; + this.accountMaxPasswordLength = data.MaxPasswordLength; + }) + .catch((error) => { + console.log(error); + const message = i18n.global.t( + 'pageUserManagement.toast.errorLoadAccountSettings', + ); + throw new Error(message); + }); + }, getAccountRoles() { return api .get('/redfish/v1/AccountService/Roles') @@ -103,309 +105,305 @@ export const UserManagementStore = defineStore('userManagment', { }) .catch((error) => console.log(error)); }, - // async createUser({ dispatch }, { username, password, privilege, status }) { - // const data = { - // UserName: username, - // Password: password, - // RoleId: privilege, - // Enabled: status, - // }; - // return await api - // .post('/redfish/v1/AccountService/Accounts', data) - // .then(() => dispatch('getUsers')) - // .then(() => - // i18n.t('pageUserManagement.toast.successCreateUser', { - // username, - // }), - // ) - // .catch((error) => { - // console.log(error); + async createUser({ username, password, privilege, status }) { + const data = { + UserName: username, + Password: password, + RoleId: privilege, + Enabled: status, + }; + return await api + .post('/redfish/v1/AccountService/Accounts', data) + .then(() => this.getUsers()) + .then(() => + i18n.global.t('pageUserManagement.toast.successCreateUser', { + username, + }), + ) + .catch((error) => { + console.log(error); - // const errorMsg = error.response?.data?.error?.code; + const errorMsg = error.response?.data?.error?.code; - // switch (true) { - // case REGEX_MAPPINGS.propertyValueFormatError.test(errorMsg): - // throw new Error( - // i18n.t( - // 'pageUserManagement.toast.errorCreateUserPasswordNotAccepted', - // { - // username, - // }, - // ), - // ); - // case REGEX_MAPPINGS.createLimitReachedForResource.test(errorMsg): - // throw new Error( - // i18n.t('pageUserManagement.toast.errorCreateUserMaxUsers', { - // username, - // }), - // ); - // default: - // throw new Error( - // i18n.t('pageUserManagement.toast.errorCreateUser', { - // username, - // }), - // ); - // } - // }); - // }, - // async updateUserfromUserManagement( - // { dispatch }, - // { - // originalUsername, - // currentUser, - // username, - // password, - // privilege, - // status, - // locked, - // }, - // ) { - // const data = {}; - // const notReadOnly = - // privilege !== 'ReadOnly' && currentUser.RoleId !== 'ReadOnly'; - // if (username) data.UserName = username; - // if (password) data.Password = password; - // if (privilege && notReadOnly) { - // data.RoleId = privilege; - // } else if ( - // privilege && - // privilege === 'ReadOnly' && - // currentUser.RoleId !== 'ReadOnly' - // ) { - // data.RoleId = privilege; - // } - // if (status !== undefined) data.Enabled = status; - // if (locked !== undefined) data.Locked = locked; - // return await api - // .patch(`/redfish/v1/AccountService/Accounts/${originalUsername}`, data) - // .then(() => dispatch('getUsers')) - // .then(() => - // i18n.t('pageUserManagement.toast.successUpdateUser', { - // username: originalUsername, - // }), - // ) - // .catch((error) => { - // const messageId = error?.response?.data?.error?.code; - // const message = REGEX_MAPPINGS.propertyValueFormatError.test( - // messageId, - // ) - // ? i18n.t( - // 'pageUserManagement.toast.errorUpdateUserPasswordNotAccepted', - // { - // username: originalUsername, - // }, - // ) - // : i18n.t('pageUserManagement.toast.errorUpdateUser', { - // username: originalUsername, - // }); - // throw new Error(message); - // }); - // }, - // async updateUser( - // { dispatch }, - // { originalUsername, username, password, privilege, status, locked }, - // ) { - // const data = {}; - // if (username) data.UserName = username; - // if (password) data.Password = password; - // if (privilege) data.RoleId = privilege; - // if (status !== undefined) data.Enabled = status; - // if (locked !== undefined) data.Locked = locked; - // return await api - // .patch(`/redfish/v1/AccountService/Accounts/${originalUsername}`, data) - // .then(() => dispatch('getUsers')) - // .then(() => - // i18n.t('pageUserManagement.toast.successUpdateUser', { - // username: originalUsername, - // }), - // ) - // .catch((error) => { - // console.log(error); + switch (true) { + case REGEX_MAPPINGS.propertyValueFormatError.test(errorMsg): + throw new Error( + i18n.global.t( + 'pageUserManagement.toast.errorCreateUserPasswordNotAccepted', + { + username, + }, + ), + ); + case REGEX_MAPPINGS.createLimitReachedForResource.test(errorMsg): + throw new Error( + i18n.global.t('pageUserManagement.toast.errorCreateUserMaxUsers', { + username, + }), + ); + default: + throw new Error( + i18n.global.t('pageUserManagement.toast.errorCreateUser', { + username, + }), + ); + } + }); + }, + async updateUserfromUserManagement( + { + originalUsername, + currentUser, + username, + password, + privilege, + status, + locked, + }, + ) { + const data = {}; + const notReadOnly = + privilege !== 'ReadOnly' && currentUser.RoleId !== 'ReadOnly'; + if (username) data.UserName = username; + if (password) data.Password = password; + if (privilege && notReadOnly) { + data.RoleId = privilege; + } else if ( + privilege && + privilege === 'ReadOnly' && + currentUser.RoleId !== 'ReadOnly' + ) { + data.RoleId = privilege; + } + if (status !== undefined) data.Enabled = status; + if (locked !== undefined) data.Locked = locked; + return await api + .patch(`/redfish/v1/AccountService/Accounts/${originalUsername}`, data) + .then(() => this.getUsers()) + .then(() => + i18n.global.t('pageUserManagement.toast.successUpdateUser', { + username: originalUsername, + }), + ) + .catch((error) => { + const messageId = error?.response?.data?.error?.code; + const message = REGEX_MAPPINGS.propertyValueFormatError.test( + messageId, + ) + ? i18n.global.t( + 'pageUserManagement.toast.errorUpdateUserPasswordNotAccepted', + { + username: originalUsername, + }, + ) + : i18n.global.t('pageUserManagement.toast.errorUpdateUser', { + username: originalUsername, + }); + throw new Error(message); + }); + }, + async updateUser( + { originalUsername, username, password, privilege, status, locked }, + ) { + const data = {}; + if (username) data.UserName = username; + if (password) data.Password = password; + if (privilege) data.RoleId = privilege; + if (status !== undefined) data.Enabled = status; + if (locked !== undefined) data.Locked = locked; + return await api + .patch(`/redfish/v1/AccountService/Accounts/${originalUsername}`, data) + .then(() => this.getUsers()) + .then(() => + i18n.global.t('pageUserManagement.toast.successUpdateUser', { + username: originalUsername, + }), + ) + .catch((error) => { + console.log(error); - // const messageId = - // error.response.data['Password@Message.ExtendedInfo'][0].MessageId; + const messageId = + error.response.data['Password@Message.ExtendedInfo'][0].MessageId; - // const message = REGEX_MAPPINGS.propertyValueFormatError.test( - // messageId, - // ) - // ? i18n.t( - // 'pageUserManagement.toast.errorUpdateUserPasswordNotAccepted', - // { - // username: originalUsername, - // }, - // ) - // : i18n.t('pageUserManagement.toast.errorUpdateUser', { - // username: originalUsername, - // }); - // throw new Error(message); - // }); - // }, - // async deleteUser({ dispatch }, username) { - // return await api - // .delete(`/redfish/v1/AccountService/Accounts/${username}`) - // .then(() => dispatch('getUsers')) - // .then(() => - // i18n.t('pageUserManagement.toast.successDeleteUser', { - // username, - // }), - // ) - // .catch((error) => { - // console.log(error); - // const message = i18n.t('pageUserManagement.toast.errorDeleteUser', { - // username, - // }); - // throw new Error(message); - // }); - // }, - // async deleteUsers({ dispatch }, users) { - // const promises = users.map(({ username }) => { - // return api - // .delete(`/redfish/v1/AccountService/Accounts/${username}`) - // .catch((error) => { - // console.log(error); - // return error; - // }); - // }); - // return await api - // .all(promises) - // .then((response) => { - // dispatch('getUsers'); - // return response; - // }) - // .then( - // api.spread((...responses) => { - // const { successCount, errorCount } = getResponseCount(responses); - // let toastMessages = []; + const message = REGEX_MAPPINGS.propertyValueFormatError.test( + messageId, + ) + ? i18n.global.t( + 'pageUserManagement.toast.errorUpdateUserPasswordNotAccepted', + { + username: originalUsername, + }, + ) + : i18n.global.t('pageUserManagement.toast.errorUpdateUser', { + username: originalUsername, + }); + throw new Error(message); + }); + }, + async deleteUser(username) { + return await api + .delete(`/redfish/v1/AccountService/Accounts/${username}`) + .then(() => this.getUsers()) + .then(() => + i18n.global.t('pageUserManagement.toast.successDeleteUser', { + username, + }), + ) + .catch((error) => { + console.log(error); + const message = i18n.global.t('pageUserManagement.toast.errorDeleteUser', { + username, + }); + throw new Error(message); + }); + }, + async deleteUsers(users) { + const promises = users.map(({ username }) => { + return api + .delete(`/redfish/v1/AccountService/Accounts/${username}`) + .catch((error) => { + console.log(error); + return error; + }); + }); + return await api + .all(promises) + .then((response) => { + this.getUsers(); + return response; + }) + .then( + api.spread((...responses) => { + const { successCount, errorCount } = getResponseCount(responses); + let toastMessages = []; - // if (successCount) { - // const message = i18n.tc( - // 'pageUserManagement.toast.successBatchDelete', - // successCount, - // ); - // toastMessages.push({ type: 'success', message }); - // } + if (successCount) { + const message = i18n.global.t( + 'pageUserManagement.toast.successBatchDelete', + successCount, + ); + toastMessages.push({ type: 'success', message }); + } - // if (errorCount) { - // const message = i18n.tc( - // 'pageUserManagement.toast.errorBatchDelete', - // errorCount, - // ); - // toastMessages.push({ type: 'error', message }); - // } + if (errorCount) { + const message = i18n.global.t( + 'pageUserManagement.toast.errorBatchDelete', + errorCount, + ); + toastMessages.push({ type: 'error', message }); + } - // return toastMessages; - // }), - // ); - // }, - // async enableUsers({ dispatch }, users) { - // const data = { - // Enabled: true, - // }; - // const promises = users.map(({ username }) => { - // return api - // .patch(`/redfish/v1/AccountService/Accounts/${username}`, data) - // .catch((error) => { - // console.log(error); - // return error; - // }); - // }); - // return await api - // .all(promises) - // .then((response) => { - // dispatch('getUsers'); - // return response; - // }) - // .then( - // api.spread((...responses) => { - // const { successCount, errorCount } = getResponseCount(responses); - // let toastMessages = []; + return toastMessages; + }), + ); + }, + async enableUsers(users) { + const data = { + Enabled: true, + }; + const promises = users.map(({ username }) => { + return api + .patch(`/redfish/v1/AccountService/Accounts/${username}`, data) + .catch((error) => { + console.log(error); + return error; + }); + }); + return await api + .all(promises) + .then((response) => { + this.getUsers(); + return response; + }) + .then( + api.spread((...responses) => { + const { successCount, errorCount } = getResponseCount(responses); + let toastMessages = []; - // if (successCount) { - // const message = i18n.tc( - // 'pageUserManagement.toast.successBatchEnable', - // successCount, - // ); - // toastMessages.push({ type: 'success', message }); - // } + if (successCount) { + const message = i18n.global.t( + 'pageUserManagement.toast.successBatchEnable', + successCount, + ); + toastMessages.push({ type: 'success', message }); + } - // if (errorCount) { - // const message = i18n.tc( - // 'pageUserManagement.toast.errorBatchEnable', - // errorCount, - // ); - // toastMessages.push({ type: 'error', message }); - // } + if (errorCount) { + const message = i18n.global.t( + 'pageUserManagement.toast.errorBatchEnable', + errorCount, + ); + toastMessages.push({ type: 'error', message }); + } - // return toastMessages; - // }), - // ); - // }, - // async disableUsers({ dispatch }, users) { - // const data = { - // Enabled: false, - // }; - // const promises = users.map(({ username }) => { - // return api - // .patch(`/redfish/v1/AccountService/Accounts/${username}`, data) - // .catch((error) => { - // console.log(error); - // return error; - // }); - // }); - // return await api - // .all(promises) - // .then((response) => { - // dispatch('getUsers'); - // return response; - // }) - // .then( - // api.spread((...responses) => { - // const { successCount, errorCount } = getResponseCount(responses); - // let toastMessages = []; + return toastMessages; + }), + ); + }, + async disableUsers(users) { + const data = { + Enabled: false, + }; + const promises = users.map(({ username }) => { + return api + .patch(`/redfish/v1/AccountService/Accounts/${username}`, data) + .catch((error) => { + console.log(error); + return error; + }); + }); + return await api + .all(promises) + .then((response) => { + this.getUsers(); + return response; + }) + .then( + api.spread((...responses) => { + const { successCount, errorCount } = getResponseCount(responses); + let toastMessages = []; - // if (successCount) { - // const message = i18n.tc( - // 'pageUserManagement.toast.successBatchDisable', - // successCount, - // ); - // toastMessages.push({ type: 'success', message }); - // } + if (successCount) { + const message = i18n.global.t( + 'pageUserManagement.toast.successBatchDisable', + successCount, + ); + toastMessages.push({ type: 'success', message }); + } - // if (errorCount) { - // const message = i18n.tc( - // 'pageUserManagement.toast.errorBatchDisable', - // errorCount, - // ); - // toastMessages.push({ type: 'error', message }); - // } + if (errorCount) { + const message = i18n.global.t( + 'pageUserManagement.toast.errorBatchDisable', + errorCount, + ); + toastMessages.push({ type: 'error', message }); + } - // return toastMessages; - // }), - // ); - // }, - // async saveAccountSettings( - // { dispatch }, - // { lockoutThreshold, lockoutDuration }, - // ) { - // const data = {}; - // if (lockoutThreshold !== undefined) { - // data.AccountLockoutThreshold = lockoutThreshold; - // } - // if (lockoutDuration !== undefined) { - // data.AccountLockoutDuration = lockoutDuration; - // } + return toastMessages; + }), + ); + }, + async saveAccountSettings( + { 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('pageUserManagement.toast.successSaveSettings')) - // .catch((error) => { - // console.log(error); - // const message = i18n.t('pageUserManagement.toast.errorSaveSettings'); - // throw new Error(message); - // }); - // }, + return await api + .patch('/redfish/v1/AccountService', data) + .then(() => this.getAccountSettings()) + .then(() => i18n.global.t('pageUserManagement.toast.successSaveSettings')) + .catch((error) => { + console.log(error); + const message = i18n.global.t('pageUserManagement.toast.errorSaveSettings'); + throw new Error(message); + }); + }, }, }); diff --git a/src/utilities/GlobalConstants.js b/src/utilities/GlobalConstants.js index 2890e4bd8a..111f8f821a 100644 --- a/src/utilities/GlobalConstants.js +++ b/src/utilities/GlobalConstants.js @@ -1,14 +1,12 @@ export const REGEX_MAPPINGS = Object.freeze({ - resourceInStandby: /Base\.(\d+\.){3}ResourceInStandby/, - actionParameterUnknown: /Base\.(\d+\.){3}ActionParameterUnknown/, - resourceAtUriUnauthorized: /Base\.(\d+\.){3}ResourceAtUriUnauthorized/, - insufficientPrivilege: /Base\.(\d+\.){3}InsufficientPrivilege/, - resourceInUse: /Base\.(\d+\.){3}ResourceInUse/, - propertyValueFormatError: /Base\.(\d+\.){3}PropertyValueFormatError/, - createLimitReachedForResource: - /Base\.(\d+\.){3}CreateLimitReachedForResource/, - resourceCannotBeDeleted: /Base\.(\d+\.){3}ResourceCannotBeDeleted/, - ipv6Address: - /((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*(\/(\d|1\d|2\d|3[0-2]))?$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3}(\/(\d{1,2}|1[0-1]\d|12[0-8]))?)|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))|(^\*$)/, + resourceInStandby: /\w*\.ResourceInStandby/, + actionParameterUnknown: /\w*\.ActionParameterUnknown/, + resourceAtUriUnauthorized: /\w*\.ResourceAtUriUnauthorized/, + insufficientPrivilege: /\w*\.InsufficientPrivilege/, + resourceInUse: /\w*\.ResourceInUse/, + propertyValueFormatError: /\w*\.PropertyValueFormatError/, + createLimitReachedForResource: /\w*\.CreateLimitReachedForResource/, + resourceCannotBeDeleted: /\w*\.ResourceCannotBeDeleted/, + ipv6Address: /((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*(\/(\d|1\d|2\d|3[0-2]))?$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3}(\/(\d{1,2}|1[0-1]\d|12[0-8]))?)|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))|(^\*$)/, imageDirectory: /^\/([\w\W]+)*$/, }); diff --git a/src/views/SecurityAndAccess/UserManagement/ModalSettings.vue b/src/views/SecurityAndAccess/UserManagement/ModalSettings.vue index fae1f4e60c..3c031dbecb 100644 --- a/src/views/SecurityAndAccess/UserManagement/ModalSettings.vue +++ b/src/views/SecurityAndAccess/UserManagement/ModalSettings.vue @@ -1,46 +1,48 @@