diff --git a/src/api/common.js b/src/api/common.js index ae6d4517..6100166d 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -116,8 +116,8 @@ export async function getList (options) { options = _.merge({ all: false, params: { - page: LIST_DEFAULT_PAGE, - rows: LIST_DEFAULT_ROWS + page: options.page || LIST_DEFAULT_PAGE, + rows: options.rows || LIST_DEFAULT_ROWS }, headers: GET_HEADERS }, options) diff --git a/src/api/pbx-config.js b/src/api/pbx-config.js index 015881c1..cbee261f 100644 --- a/src/api/pbx-config.js +++ b/src/api/pbx-config.js @@ -52,8 +52,10 @@ export function getProfiles (options) { } export function getAllProfiles () { + // Replace 1000 rows with 300 as we expect to have max 150 profiles. return getProfiles({ - all: true + page: 1, + rows: 300 }) } diff --git a/src/components/pages/PbxConfiguration/CscPbxDevice.vue b/src/components/pages/PbxConfiguration/CscPbxDevice.vue index c5416d9f..9fe9b1d2 100644 --- a/src/components/pages/PbxConfiguration/CscPbxDevice.vue +++ b/src/components/pages/PbxConfiguration/CscPbxDevice.vue @@ -9,10 +9,21 @@ center no-wrap > - + + + + diff --git a/src/components/pages/PbxConfiguration/CscPbxDeviceFilters.vue b/src/components/pages/PbxConfiguration/CscPbxDeviceFilters.vue index db2f3680..83b9f4bb 100644 --- a/src/components/pages/PbxConfiguration/CscPbxDeviceFilters.vue +++ b/src/components/pages/PbxConfiguration/CscPbxDeviceFilters.vue @@ -90,6 +90,8 @@ import _ from 'lodash' import CscPbxModelSelect from '../PbxConfiguration/CscPbxModelSelect' import CscPbxAutoAttendantSelection from './CscPbxAutoAttendantSelection' import { mapActions, mapState } from 'vuex' +import { RequestState } from 'src/store/common' +import { showGlobalError } from 'src/helpers/ui' export default { name: 'CscPbxDeviceFilters', @@ -116,7 +118,9 @@ export default { ...mapState('pbx', [ 'deviceProfileMap', 'deviceProfileList', - 'subscriberList' + 'subscriberList', + 'subscriberListState', + 'subscriberListError' ]), subscribersOptions () { const options = [] @@ -191,6 +195,11 @@ export default { watch: { filterTypeModel () { this.typedFilter = null + }, + subscriberListState (state) { + if (state === RequestState.failed) { + showGlobalError(this.subscriberListError) + } } }, mounted () { diff --git a/src/components/pages/PbxConfiguration/CscPbxModelSelect.vue b/src/components/pages/PbxConfiguration/CscPbxModelSelect.vue index 435f3fdd..d4a6d10f 100644 --- a/src/components/pages/PbxConfiguration/CscPbxModelSelect.vue +++ b/src/components/pages/PbxConfiguration/CscPbxModelSelect.vue @@ -49,10 +49,11 @@ > - + /> @@ -120,15 +121,11 @@ export default { return _.get(this.deviceModelImageSmallMap, deviceModelId + '.url', null) }, options () { - const options = [] - this.profiles.forEach((profile) => { - options.push({ - label: profile.name, - value: profile.id, - model: profile.device_id - }) - }) - return options + return this.profiles.map((profile) => ({ + label: profile.name, + value: profile.id, + model: profile.device_id + })) } }, watch: { diff --git a/src/pages/CscPagePbxCallQueues.vue b/src/pages/CscPagePbxCallQueues.vue index 5a7c7ce0..3a690591 100644 --- a/src/pages/CscPagePbxCallQueues.vue +++ b/src/pages/CscPagePbxCallQueues.vue @@ -150,6 +150,10 @@ export default { 'getCallQueueCreationToastMessage', 'getCallQueueUpdateToastMessage', 'getCallQueueRemovalToastMessage' + ]), + ...mapState('pbx', [ + 'subscriberListState', + 'subscriberListError' ]) }, watch: { @@ -175,6 +179,16 @@ export default { } else if (state === RequestState.failed) { showGlobalError(this.callQueueRemovalError) } + }, + callQueueListState (state) { + if (state === RequestState.failed) { + showGlobalError(this.callQueueListError) + } + }, + subscriberListState (state) { + if (state === RequestState.failed) { + showGlobalError(this.subscriberListError) + } } }, mounted () { diff --git a/src/pages/CscPagePbxDeviceDetails.vue b/src/pages/CscPagePbxDeviceDetails.vue index 4e2c3cc0..3ff52058 100644 --- a/src/pages/CscPagePbxDeviceDetails.vue +++ b/src/pages/CscPagePbxDeviceDetails.vue @@ -175,10 +175,11 @@ v-if="!deviceSelected" /> { + const newProfile = this.deviceProfileMap[this.changes.profile_id] + if (newProfile && newProfile.device_id) { + this.loadDeviceModel({ + type: 'all', + deviceId: newProfile.device_id + }) + } }) } if (this.hasAdminNameChanged) { diff --git a/src/pages/CscPagePbxDevices.vue b/src/pages/CscPagePbxDevices.vue index a6aa72b8..81e572b8 100644 --- a/src/pages/CscPagePbxDevices.vue +++ b/src/pages/CscPagePbxDevices.vue @@ -3,9 +3,7 @@ id="csc-page-pbx-devices" class="q-pa-lg" > - + -