@ -123,6 +123,25 @@
< / template >
< / q - i n p u t >
< q -input
v - model = "changes.admin_pass"
: label = "$t('Admin password')"
: disable = "isLoadingPreferences"
@ keyup . enter = "save"
>
< template
v - if = "hasAdminPasswordChanged"
# append
>
< csc -input -button -save
@ click . stop = "save"
/ >
< csc -input -button -reset
@ click . stop = "resetAdminPassword"
/ >
< / template >
< / q - i n p u t >
< q -list >
< q -item class = "q-pb-sm q-mt-md" >
< q -toggle
@ -153,7 +172,7 @@
< div class = "col-12 col-md-6 q-pa-lg" >
< csc -pbx -device -config
v - if = "device ModelImageMap[deviceProfileMap[deviceSelected.profile_id].device_id]"
v - if = "device Selected && device ModelImageMap[deviceProfileMap[deviceSelected? .profile_id].device_id]"
: device = "deviceSelected"
: model = "deviceModelMap[deviceProfileMap[deviceSelected.profile_id].device_id]"
: model - image = "deviceModelImageMap[deviceProfileMap[deviceSelected.profile_id].device_id]"
@ -169,12 +188,13 @@
< / template >
< script >
import useValidate from '@vuelidate/core'
import CscInputButtonReset from 'components/form/CscInputButtonReset'
import CscInputButtonSave from 'components/form/CscInputButtonSave'
import CscPageStickyTabs from 'components/CscPageStickyTabs'
import CscPbxDeviceConfig from 'components/pages/PbxConfiguration/CscPbxDeviceConfig'
import CscPbxModelSelect from 'components/pages/PbxConfiguration/CscPbxModelSelect'
import useValidate from '@vuelidate/core '
import { showGlobalError , showToast } from 'src/helpers/ui '
import {
mapActions ,
mapGetters ,
@ -182,10 +202,6 @@ import {
mapState
} from 'vuex'
import { RequestState } from 'src/store/common'
import {
showGlobalError ,
showToast
} from 'src/helpers/ui'
export default {
name : 'CscPagePbxDeviceDetails' ,
components : {
@ -250,19 +266,19 @@ export default {
]
} ,
isLoading ( ) {
return this . isDeviceLoading ( this . deviceSelected . id )
return this . isDeviceLoading ( this . deviceSelected ? . id )
} ,
isLoadingPreferences ( ) {
return this . isDevicePreferencesLoading ( this . devicePreferencesSelected . id )
return this . isDevicePreferencesLoading ( this . devicePreferencesSelected ? . id )
} ,
hasStationNameChanged ( ) {
return this . changes . station _name !== this . deviceSelected . station _name
return this . changes . station _name !== this . deviceSelected ? . station _name
} ,
hasIdentifierChanged ( ) {
return this . changes . identifier !== this . deviceSelected . identifier
return this . changes . identifier !== this . deviceSelected ? . identifier
} ,
hasProfileChanged ( ) {
return this . changes . profile _id !== this . deviceSelected . profile _id
return this . changes . profile _id !== this . deviceSelected ? . profile _id
} ,
imageUrl ( ) {
if ( this . modelImage && this . modelImage . url ) {
@ -271,10 +287,19 @@ export default {
return null
} ,
hasAdminNameChanged ( ) {
return this . changes . admin _name !== this . devicePreferencesSelected . admin _name
return this . changes . admin _name !== this . devicePreferencesSelected ? . admin _name
} ,
hasAdminPasswordChanged ( ) {
return this . changes . admin _pass !== this . devicePreferencesSelected ? . admin _pass
}
} ,
watch : {
async $route ( to ) {
if ( this . id !== to . params . id ) {
this . id = to . params . id
this . expandDevice ( this . id )
}
} ,
deviceSelected ( ) {
this . changes = this . getDeviceData ( )
} ,
@ -293,10 +318,14 @@ export default {
}
}
} ,
mounted ( ) {
async created ( ) {
await this . loadDeviceListItems ( )
if ( this . isDeviceMapByIdEmpty ) {
await this . loadDeviceListItems ( )
}
this . expandDevice ( this . id )
this . expandDevicePreferences ( this . id )
this . loadSubscribers ( )
await this . loadSubscribers ( )
} ,
methods : {
... mapMutations ( 'pbxDevices' , [
@ -304,11 +333,13 @@ export default {
'expandDevicePreferences'
] ) ,
... mapActions ( 'pbxDevices' , [
'loadDeviceListItems' ,
'setDeviceKeys' ,
'setDeviceStationName' ,
'setDeviceIdentifier' ,
'setDeviceProfile' ,
'setAdminName' ,
'setAdminPassword' ,
'setGui' ,
'setUserConfig' ,
'setFW'
@ -323,6 +354,7 @@ export default {
identifier : this . deviceSelected . identifier ,
profile _id : this . deviceSelected . profile _id ,
admin _name : this . devicePreferencesSelected . admin _name ? this . devicePreferencesSelected . admin _name : undefined ,
admin _pass : this . devicePreferencesSelected . admin _pass ? this . devicePreferencesSelected . admin _pass : undefined ,
web _gui _dis : this . devicePreferencesSelected . web _gui _dis ? this . devicePreferencesSelected . web _gui _dis : false ,
user _conf _priority : this . devicePreferencesSelected . user _conf _priority ? this . devicePreferencesSelected . user _conf _priority : false ,
FW _upg _dis : this . devicePreferencesSelected . FW _upg _dis ? this . devicePreferencesSelected . FW _upg _dis : false
@ -330,19 +362,22 @@ export default {
: null
} ,
resetStationName ( ) {
this . changes . station _name = this . deviceSelected . station _name
this . changes . station _name = this . deviceSelected ? . station _name
} ,
resetIdentifier ( ) {
this . changes . identifier = this . deviceSelected . identifier
this . changes . identifier = this . deviceSelected ? . identifier
} ,
resetAdminName ( ) {
this . changes . admin _name = this . devicePreferencesSelected . admin _name
this . changes . admin _name = this . devicePreferencesSelected ? . admin _name
} ,
resetAdminPassword ( ) {
this . changes . admin _pass = this . devicePreferencesSelected ? . admin _pass
} ,
selectedProfile ( profileId ) {
this . changes . profile _id = profileId
} ,
resetProfile ( ) {
this . changes . profile _id = this . deviceSelected . profile _id
this . changes . profile _id = this . deviceSelected ? . profile _id
} ,
selectTab ( tabName ) {
if ( this . selectedTab !== tabName ) {
@ -354,51 +389,57 @@ export default {
} ,
keysSave ( keys ) {
this . setDeviceKeys ( {
deviceId : this . deviceSelected . id ,
keys : keys
deviceId : this . deviceSelected ? . id ,
keys
} )
} ,
save ( ) {
if ( this . hasStationNameChanged ) {
this . setDeviceStationName ( {
deviceId : this . deviceSelected . id ,
deviceId : this . deviceSelected ? . id ,
stationName : this . changes . station _name
} )
}
if ( this . hasIdentifierChanged ) {
this . setDeviceIdentifier ( {
deviceId : this . deviceSelected . id ,
deviceId : this . deviceSelected ? . id ,
identifier : this . changes . identifier
} )
}
if ( this . hasProfileChanged ) {
this . setDeviceProfile ( {
deviceId : this . deviceSelected . id ,
deviceId : this . deviceSelected ? . id ,
profileId : this . changes . profile _id
} )
}
if ( this . hasAdminNameChanged ) {
this . setAdminName ( {
deviceId : this . devicePreferencesSelected . id ,
deviceId : this . devicePreferencesSelected ? . id ,
adminName : this . changes . admin _name
} )
}
if ( this . hasAdminPasswordChanged ) {
this . setAdminPassword ( {
deviceId : this . devicePreferencesSelected ? . id ,
adminPassword : this . changes . admin _pass
} )
}
} ,
changeGui ( ) {
this . setGui ( {
deviceId : this . devicePreferencesSelected . id ,
deviceId : this . devicePreferencesSelected ? . id ,
webGui : this . changes . web _gui _dis
} )
} ,
changeUserConfig ( ) {
this . setUserConfig ( {
deviceId : this . devicePreferencesSelected . id ,
deviceId : this . devicePreferencesSelected ? . id ,
userConf : this . changes . user _conf _priority
} )
} ,
changeFW ( ) {
this . setFW ( {
deviceId : this . devicePreferencesSelected . id ,
deviceId : this . devicePreferencesSelected ? . id ,
FWupg : this . changes . FW _upg _dis
} )
}