Browse Source

UI-2225: Handle empty provision keys

4.3
Jean-Roch Maitre 10 years ago
parent
commit
57057b6088
2 changed files with 20 additions and 15 deletions
  1. +19
    -14
      submodules/devices/devices.js
  2. +1
    -1
      views/devices-sip_device.html

+ 19
- 14
submodules/devices/devices.js View File

@ -1199,20 +1199,25 @@ define(function(require){
devicesGetIterator: function(args, callbackSuccess, callbackError) { devicesGetIterator: function(args, callbackSuccess, callbackError) {
var self = this; var self = this;
monster.request({
resource: 'provisioner.ui.getModel',
data: {
brand: args.endpoint_brand,
family: args.endpoint_family,
model: args.endpoint_model
},
success: function(data, status) {
callbackSuccess && callbackSuccess(data.data.template);
},
error: function(data, status) {
callbackError && callbackError();
}
});
if(args.hasOwnProperty('endpoint_brand') && args.hasOwnProperty('endpoint_family') && args.hasOwnProperty('endpoint_model')) {
monster.request({
resource: 'provisioner.ui.getModel',
data: {
brand: args.endpoint_brand,
family: args.endpoint_family,
model: args.endpoint_model
},
success: function(data, status) {
callbackSuccess && callbackSuccess(data.data.template);
},
error: function(data, status) {
}
});
}
else {
callbackError && callbackError();
}
} }
}; };


+ 1
- 1
views/devices-sip_device.html View File

@ -1,7 +1,7 @@
<div class="edit-device" data-id="{{id}}"> <div class="edit-device" data-id="{{id}}">
<div class="title-bar clearfix"> <div class="title-bar clearfix">
<div class="device-title pull-left"> <div class="device-title pull-left">
{{#if provision}}
{{#if provision.endpoint_brand}}
<div class="device-image model-image" style="background-image: url('css/assets/models/{{toLowerCase provision.endpoint_brand}}_{{toLowerCase provision.endpoint_family}}_{{toLowerCase provision.endpoint_model}}.jpg');"></div> <div class="device-image model-image" style="background-image: url('css/assets/models/{{toLowerCase provision.endpoint_brand}}_{{toLowerCase provision.endpoint_family}}_{{toLowerCase provision.endpoint_model}}.jpg');"></div>
<div class="device-model">{{provision.endpoint_brand}} - {{provision.endpoint_model}}</div> <div class="device-model">{{provision.endpoint_brand}} - {{provision.endpoint_model}}</div>
{{else}} {{else}}


Loading…
Cancel
Save