@ -42,9 +42,12 @@
v - if = "selectedTab === 'preferences'"
class = "col-12 column"
>
< div class = "col-12 col-md-6 q-pa-lg" >
< csc -list -spinner
v - if = "!deviceSelected || !changes"
/ >
< div
v - if = "changes"
class = "col-12 col-md-6 q-pa-lg"
v - else
side
top
>
@ -169,6 +172,7 @@
< / q - i t e m >
< / q - l i s t >
< / div >
< / div >
< div class = "col-12 col-md-6 q-pa-lg" >
< csc -list -spinner
@ -374,12 +378,17 @@ export default {
$route : {
async handler ( to ) {
this . id = to . params . id
this . changes = null
this . collapseDevice ( )
await this . getData ( this . id )
}
} ,
deviceSelected ( ) {
this . changes = this . getDeviceData ( )
} ,
devicePreferencesSelected ( ) {
this . changes = this . getDeviceData ( )
} ,
deviceUpdateState ( state ) {
if ( state === RequestState . succeeded ) {
showToast ( this . getDeviceUpdateToastMessage )
@ -416,7 +425,8 @@ export default {
methods : {
... mapMutations ( 'pbxDevices' , [
'expandDevice' ,
'expandDevicePreferences'
'expandDevicePreferences' ,
'collapseDevice'
] ) ,
... mapActions ( 'pbxDevices' , [
'setDeviceKeys' ,
@ -443,10 +453,15 @@ export default {
await this . loadDevice ( deviceId )
}
const deviceProfileId = this . deviceMapById [ deviceId ] . profile _id
const device = this . deviceMapById [ deviceId ]
if ( ! device ) {
return
}
const deviceProfileId = device . profile _id
const deviceProfile = this . deviceProfileMap [ deviceProfileId ]
if ( deviceProfile . device _id ) {
if ( deviceProfile && deviceProfile . device _id ) {
await this . loadDeviceModel ( {
type : 'all' ,
deviceId : deviceProfile . device _id
@ -462,18 +477,20 @@ export default {
this . loadSubscribers ( )
} ,
getDeviceData ( ) {
return ( this . deviceSelected && this . devicePreferencesSelected )
? {
if ( ! this . deviceSelected ) {
return null
}
return {
station _name : this . deviceSelected . station _name ,
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
admin _name : this . devicePreferencesSelected ? . admin _name || undefined ,
admin _pass : this . devicePreferencesSelected ? . admin _pass || undefined ,
web _gui _dis : this . devicePreferencesSelected ? . web _gui _dis || false ,
user _conf _priority : this . devicePreferencesSelected ? . user _conf _priority || false ,
FW _upg _dis : this . devicePreferencesSelected ? . FW _upg _dis || false
}
: null
} ,
resetStationName ( ) {
this . changes . station _name = this . deviceSelected ? . station _name