@ -42,132 +42,136 @@
v - if = "selectedTab === 'preferences'"
v - if = "selectedTab === 'preferences'"
class = "col-12 column"
class = "col-12 column"
>
>
< div
< div class = "col-12 col-md-6 q-pa-lg" >
v - if = "changes"
< csc -list -spinner
class = "col-12 col-md-6 q-pa-lg"
v - if = "!deviceSelected || !changes"
side
/ >
top
< div
>
v - else
< q -input
side
v - model = "changes.station_name"
top
: label = "$t('Station name')"
: disable = "isLoading"
@ keyup . enter = "save"
>
>
< template
< q -input
v - if = "hasStationNameChanged"
v - model = "changes.station_name"
# append
: label = "$t('Station name')"
: disable = "isLoading"
@ keyup . enter = "save"
>
>
< csc -input -button -save
< templat e
@ click . stop = "save "
v - if = "hasStationNameChanged "
/ >
# append
< csc -input -button -reset
>
@ click . stop = "resetStationName"
< csc -input -button -save
/ >
@ click . stop = "save"
< / template >
/ >
< / q - i n p u t >
< csc -input -button -reset
< q -input
@ click . stop = "resetStationName"
v - model = "changes.identifier"
/ >
: disable = "isLoading"
< / template >
:label = "$t('MAC address')"
</ q - i n p u t >
@ keyup . enter = "save"
< q -input
>
v - model = "changes.identifier"
< template
: disable = "isLoading"
v - if = "hasIdentifierChanged "
: label = "$t('MAC address') "
#append
@keyup . enter = "save"
>
>
< csc-input -button -sav e
< templat e
@ click . stop = "save "
v - if = "hasIdentifierChanged "
/ >
# append
< csc -input -button -reset
>
@ click . stop = "resetIdentifier"
< csc -input -button -save
/ >
@ click . stop = "save"
< / template >
/ >
< / q - i n p u t >
< csc -input -button -reset
< csc -pbx -model -select
@ click . stop = "resetIdentifier"
v - model = "changes.profile_id"
/ >
: profiles = "deviceProfileList"
< / template >
:profile - map = "deviceProfileMap"
</ q - i n p u t >
: has - reset - button = "false"
< csc -pbx -model -select
@ opened = "$emit('model-select-opened') "
v - model = "changes.profile_id "
@ input = "selectedProfile "
: profiles = "deviceProfileList "
>
: profile - map = "deviceProfileMap"
< template
: has - reset - button = "false"
v - if = "hasProfileChanged "
@ opened = "$emit('model-select-opened') "
#append
@input = "selectedProfile"
>
>
< csc-input -button -sav e
< templat e
@ click . stop = "save "
v - if = "hasProfileChanged "
/ >
# append
< csc -input -button -reset
>
@ click . stop = "resetProfile"
< csc -input -button -save
/ >
@ click . stop = "save"
< / template >
/ >
< / c s c - p b x - m o d e l - s e l e c t >
< csc -input -button -reset
< q -input
@ click . stop = "resetProfile"
v - model = "changes.admin_name"
/ >
: label = "$t('Admin name')"
< / template >
:disable = "isLoadingPreferences"
</ c s c - p b x - m o d e l - s e l e c t >
@ keyup . enter = "save"
< q -input
>
v - model = "changes.admin_name"
< template
: label = "$t('Admin name')"
v - if = "hasAdminNameChanged "
: disable = "isLoadingPreferences "
#append
@keyup . enter = "save"
>
>
< csc -input -button -save
< template
@ click . stop = "save"
v - if = "hasAdminNameChanged"
/ >
# append
< csc -input -button -reset
>
@ click . stop = "resetAdminName"
< csc -input -button -save
/ >
@ click . stop = "save"
< / template >
/ >
< / q - i n p u t >
< csc -input -button -reset
@ click . stop = "resetAdminName"
/ >
< / template >
< / q - i n p u t >
< q -input
< q -input
v - model = "changes.admin_pass"
v - model = "changes.admin_pass"
: label = "$t('Admin password')"
: label = "$t('Admin password')"
: disable = "isLoadingPreferences"
: disable = "isLoadingPreferences"
@ keyup . enter = "save"
@ keyup . enter = "save"
>
< template
v - if = "hasAdminPasswordChanged"
# append
>
>
< csc -input -button -save
< template
@ click . stop = "save"
v - if = "hasAdminPasswordChanged"
/ >
# append
< csc -input -button -reset
>
@ click . stop = "resetAdminPassword"
< csc -input -button -save
/ >
@ click . stop = "save"
< / template >
/ >
< / q - i n p u t >
< csc -input -button -reset
@ click . stop = "resetAdminPassword"
/ >
< / template >
< / q - i n p u t >
< q -list >
< q -list >
< q -item class = "q-pb-sm q-mt-md" >
< q -item class = "q-pb-sm q-mt-md" >
< q -toggle
< q -toggle
v - model = "changes.web_gui_dis"
v - model = "changes.web_gui_dis"
: label = "$t('Disable phone web interface')"
: label = "$t('Disable phone web interface')"
: disable = "isLoadingPreferences"
: disable = "isLoadingPreferences"
@ update : model - value = "changeGui"
@ update : model - value = "changeGui"
/ >
/ >
< / q - i t e m >
< / q - i t e m >
< q -item class = "q-pb-sm" >
< q -item class = "q-pb-sm" >
< q -toggle
< q -toggle
v - model = "changes.user_conf_priority"
v - model = "changes.user_conf_priority"
: label = "$t('User config priority over provisioning')"
: label = "$t('User config priority over provisioning')"
: disable = "isLoadingPreferences"
: disable = "isLoadingPreferences"
@ update : model - value = "changeUserConfig"
@ update : model - value = "changeUserConfig"
/ >
/ >
< / q - i t e m >
< / q - i t e m >
< q -item class = "q-pb-sm" >
< q -item class = "q-pb-sm" >
< q -toggle
< q -toggle
v - model = "changes.FW_upg_dis"
v - model = "changes.FW_upg_dis"
: label = "$t('Firmware Upgrade disable')"
: label = "$t('Firmware Upgrade disable')"
: disable = "isLoadingPreferences"
: disable = "isLoadingPreferences"
@ update : model - value = "changeFW"
@ update : model - value = "changeFW"
/ >
/ >
< / q - i t e m >
< / q - i t e m >
< / q - l i s t >
< / q - l i s t >
< / div >
< / div >
< / div >
< div class = "col-12 col-md-6 q-pa-lg" >
< div class = "col-12 col-md-6 q-pa-lg" >
@ -374,12 +378,17 @@ export default {
$route : {
$route : {
async handler ( to ) {
async handler ( to ) {
this . id = to . params . id
this . id = to . params . id
this . changes = null
this . collapseDevice ( )
await this . getData ( this . id )
await this . getData ( this . id )
}
}
} ,
} ,
deviceSelected ( ) {
deviceSelected ( ) {
this . changes = this . getDeviceData ( )
this . changes = this . getDeviceData ( )
} ,
} ,
devicePreferencesSelected ( ) {
this . changes = this . getDeviceData ( )
} ,
deviceUpdateState ( state ) {
deviceUpdateState ( state ) {
if ( state === RequestState . succeeded ) {
if ( state === RequestState . succeeded ) {
showToast ( this . getDeviceUpdateToastMessage )
showToast ( this . getDeviceUpdateToastMessage )
@ -416,7 +425,8 @@ export default {
methods : {
methods : {
... mapMutations ( 'pbxDevices' , [
... mapMutations ( 'pbxDevices' , [
'expandDevice' ,
'expandDevice' ,
'expandDevicePreferences'
'expandDevicePreferences' ,
'collapseDevice'
] ) ,
] ) ,
... mapActions ( 'pbxDevices' , [
... mapActions ( 'pbxDevices' , [
'setDeviceKeys' ,
'setDeviceKeys' ,
@ -443,10 +453,15 @@ export default {
await this . loadDevice ( deviceId )
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 ]
const deviceProfile = this . deviceProfileMap [ deviceProfileId ]
if ( deviceProfile . device _id ) {
if ( deviceProfile && deviceProfile . device _id ) {
await this . loadDeviceModel ( {
await this . loadDeviceModel ( {
type : 'all' ,
type : 'all' ,
deviceId : deviceProfile . device _id
deviceId : deviceProfile . device _id
@ -462,18 +477,20 @@ export default {
this . loadSubscribers ( )
this . loadSubscribers ( )
} ,
} ,
getDeviceData ( ) {
getDeviceData ( ) {
return ( this . deviceSelected && this . devicePreferencesSelected )
if ( ! this . deviceSelected ) {
? {
return null
station _name : this . deviceSelected . station _name ,
}
identifier : this . deviceSelected . identifier ,
profile _id : this . deviceSelected . profile _id ,
return {
admin _name : this . devicePreferencesSelected . admin _name ? this . devicePreferencesSelected . admin _name : undefined ,
station _name : this . deviceSelected . station _name ,
admin _pass : this . devicePreferencesSelected . admin _pass ? this . devicePreferencesSelected . admin _pass : undefined ,
identifier : this . deviceSelected . identifier ,
web _gui _dis : this . devicePreferencesSelected . web _gui _dis ? this . devicePreferencesSelected . web _gui _dis : false ,
profile _id : this . deviceSelected . profile _id ,
user _conf _priority : this . devicePreferencesSelected . user _conf _priority ? this . devicePreferencesSelected . user _conf _priority : false ,
admin _name : this . devicePreferencesSelected ? . admin _name || undefined ,
FW _upg _dis : this . devicePreferencesSelected . FW _upg _dis ? this . devicePreferencesSelected . FW _upg _dis : false
admin _pass : this . devicePreferencesSelected ? . admin _pass || undefined ,
}
web _gui _dis : this . devicePreferencesSelected ? . web _gui _dis || false ,
: null
user _conf _priority : this . devicePreferencesSelected ? . user _conf _priority || false ,
FW _upg _dis : this . devicePreferencesSelected ? . FW _upg _dis || false
}
} ,
} ,
resetStationName ( ) {
resetStationName ( ) {
this . changes . station _name = this . deviceSelected ? . station _name
this . changes . station _name = this . deviceSelected ? . station _name