|
|
@ -48,12 +48,12 @@
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<q-input
|
|
|
|
<q-input
|
|
|
|
dark
|
|
|
|
dark
|
|
|
|
v-model="device.identifier"
|
|
|
|
v-model="changes.identifier"
|
|
|
|
:after="identifierButtons"
|
|
|
|
:after="identifierButtons"
|
|
|
|
@keyup.enter="saveIdentifier"
|
|
|
|
@keyup.enter="saveIdentifier"
|
|
|
|
@input="$v.device.identifier.$touch"
|
|
|
|
@input="$v.changes.identifier.$touch"
|
|
|
|
@blur="$v.device.identifier.$touch"
|
|
|
|
@blur="$v.changes.identifier.$touch"
|
|
|
|
:error="$v.device.identifier.$error"
|
|
|
|
:error="$v.changes.identifier.$error"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</q-field>
|
|
|
|
</q-field>
|
|
|
|
<q-field
|
|
|
|
<q-field
|
|
|
@ -186,7 +186,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
validations: {
|
|
|
|
validations: {
|
|
|
|
device: {
|
|
|
|
changes: {
|
|
|
|
identifier: {
|
|
|
|
identifier: {
|
|
|
|
required,
|
|
|
|
required,
|
|
|
|
customMacAddress
|
|
|
|
customMacAddress
|
|
|
@ -247,6 +247,9 @@
|
|
|
|
stationName() {
|
|
|
|
stationName() {
|
|
|
|
return this.device.station_name;
|
|
|
|
return this.device.station_name;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
identifier() {
|
|
|
|
|
|
|
|
return this.device.station_name;
|
|
|
|
|
|
|
|
},
|
|
|
|
deviceModel() {
|
|
|
|
deviceModel() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
id: this.changes.id,
|
|
|
|
id: this.changes.id,
|
|
|
@ -263,7 +266,18 @@
|
|
|
|
identifierButtons() {
|
|
|
|
identifierButtons() {
|
|
|
|
let buttons = [];
|
|
|
|
let buttons = [];
|
|
|
|
let self = this;
|
|
|
|
let self = this;
|
|
|
|
if(this.identifierHasChanges) {
|
|
|
|
if (this.identifierHasChanges && this.$v.changes.identifier.$error) {
|
|
|
|
|
|
|
|
buttons.push({
|
|
|
|
|
|
|
|
icon: 'clear',
|
|
|
|
|
|
|
|
error: true,
|
|
|
|
|
|
|
|
handler (event) {
|
|
|
|
|
|
|
|
event.stopPropagation();
|
|
|
|
|
|
|
|
self.resetIdentifier();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (this.identifierHasChanges) {
|
|
|
|
buttons.push({
|
|
|
|
buttons.push({
|
|
|
|
icon: 'check',
|
|
|
|
icon: 'check',
|
|
|
|
error: false,
|
|
|
|
error: false,
|
|
|
@ -287,12 +301,12 @@
|
|
|
|
return _.get(this.device, 'profile.id', null);
|
|
|
|
return _.get(this.device, 'profile.id', null);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
identifierErrorMessage() {
|
|
|
|
identifierErrorMessage() {
|
|
|
|
if (!this.$v.device.identifier.required) {
|
|
|
|
if (!this.$v.changes.identifier.required) {
|
|
|
|
return this.$t('validationErrors.fieldRequired', {
|
|
|
|
return this.$t('validationErrors.fieldRequired', {
|
|
|
|
field: this.$t('pbxConfig.deviceIdentifier')
|
|
|
|
field: this.$t('pbxConfig.deviceIdentifier')
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!this.$v.device.identifier.customMacAddress) {
|
|
|
|
else if (!this.$v.changes.identifier.customMacAddress) {
|
|
|
|
return this.$t('validationErrors.macAddress');
|
|
|
|
return this.$t('validationErrors.macAddress');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -333,7 +347,7 @@
|
|
|
|
this.changes.identifier = this.device.identifier;
|
|
|
|
this.changes.identifier = this.device.identifier;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
saveIdentifier() {
|
|
|
|
saveIdentifier() {
|
|
|
|
if (!this.$v.device.identifier.$error) {
|
|
|
|
if (!this.$v.changes.identifier.$error) {
|
|
|
|
this.$emit('save-identifier', this.deviceModel);
|
|
|
|
this.$emit('save-identifier', this.deviceModel);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|