MT#9177 Add fields for edit Panasonic credentials

While without logic changes to save credentials from parameters.
changes/52/552/1
Irina Peshinskaya 11 years ago
parent 8d134d191d
commit ea3d731bf2

@ -254,6 +254,29 @@ has_field 'bootstrap_config_http_sync_params' => (
title => ['The parameters appended to the sync URI when setting the provisioning server, e.g. server.uri/$MA. The server.uri variable is automatically expanded during provisioning time.'],
},
);
has_field 'bootstrap_config_panasonic_user' => (
type => 'Text',
required => 0,
label => 'Panasonic username',
default => '',
wrapper_class => [qw/ngcp-bootstrap-config ngcp-bootstrap-config-redirect_panasonic/],
element_attr => {
rel => ['tooltip'],
title => ['Username used to configure bootstrap url on Panasonic redirect server. Obtained from Panasonic.'],
},
);
has_field 'bootstrap_config_panasonic_password' => (
type => 'Text',
required => 0,
label => 'Panasonic password',
default => '',
wrapper_class => [qw/ngcp-bootstrap-config ngcp-bootstrap-config-redirect_panasonic/],
element_attr => {
rel => ['tooltip'],
title => ['Password used to configure bootstrap url on Panasonic redirect server. Obtained from Panasonic.'],
},
);
has_field 'save' => (
type => 'Submit',
@ -265,7 +288,7 @@ has_field 'save' => (
has_block 'fields' => (
tag => 'div',
class => [qw/modal-body/],
render_list => [qw/vendor model linerange linerange_add bootstrap_method bootstrap_config_http_sync_uri bootstrap_config_http_sync_method bootstrap_config_http_sync_params front_image mac_image/],
render_list => [qw/vendor model linerange linerange_add bootstrap_method bootstrap_config_http_sync_uri bootstrap_config_http_sync_method bootstrap_config_http_sync_params bootstrap_config_panasonic_user bootstrap_config_panasonic_password front_image mac_image/],
);
has_block 'actions' => (

@ -7,7 +7,7 @@ use Moose::Util::TypeConstraints;
has_block 'fields' => (
tag => 'div',
class => [qw/modal-body/],
render_list => [qw/reseller vendor model linerange bootstrap_method bootstrap_config_http_sync_uri bootstrap_config_http_sync_method bootstrap_config_http_sync_params/],
render_list => [qw/reseller vendor model linerange bootstrap_method bootstrap_config_http_sync_uri bootstrap_config_http_sync_method bootstrap_config_http_sync_params bootstrap_config_panasonic_user bootstrap_config_panasonic_password/],
);
override 'field_list' => sub {

@ -26,7 +26,7 @@ has_field 'save' => (
has_block 'fields' => (
tag => 'div',
class => [qw/modal-body/],
render_list => [qw/reseller vendor model linerange linerange_add bootstrap_method bootstrap_config_http_sync_uri bootstrap_config_http_sync_method bootstrap_config_http_sync_params front_image mac_image/],
render_list => [qw/reseller vendor model linerange linerange_add bootstrap_method bootstrap_config_http_sync_uri bootstrap_config_http_sync_method bootstrap_config_http_sync_params bootstrap_config_panasonic_user bootstrap_config_panasonic_password front_image mac_image/],
);
has_block 'actions' => (

@ -13,34 +13,45 @@ function bootstrapDynamicFields(selectedValue){
$('.ngcp-bootstrap-config-'+selectedValue).css("display","block");
}
function vendor2bootstrapMethod(vendorField){
var bootstrapMethod='';
switch(vendorField.value.toLowerCase()){
case "cisco":
bootstrapMethod = 'http';
break;
;
case "panasonic":
bootstrapMethod = 'redirect_panasonic';
break;
;
case "linksys":
bootstrapMethod = 'redirect_linksys';
break;
;
case "yealink":
bootstrapMethod = 'redirect_yealink';
break;
;
if(!vendorField){
var bootstrapMethodFields = document.getElementsByName('bootstrap_method');
if(bootstrapMethodFields && bootstrapMethodFields.length){
vendorField = bootstrapMethodFields[0].form['vendor'];
}
}
var bootstrapMethodField = vendorField.form['bootstrap_method'];
var length = bootstrapMethodField.options.length;
for(var i=0; i < length; i++){
if(bootstrapMethodField.options[i].value == bootstrapMethod){
bootstrapMethodField.options[i].selected = true;
if(vendorField){
var bootstrapMethod='';
switch(vendorField.value.toLowerCase()){
case "cisco":
bootstrapMethod = 'http';
break;
;
case "panasonic":
bootstrapMethod = 'redirect_panasonic';
break;
;
case "linksys":
bootstrapMethod = 'redirect_linksys';
break;
;
case "yealink":
bootstrapMethod = 'redirect_yealink';
break;
;
}
var bootstrapMethodField = vendorField.form['bootstrap_method'];
var length = bootstrapMethodField.options.length;
for(var i=0; i < length; i++){
if(bootstrapMethodField.options[i].value == bootstrapMethod){
bootstrapMethodField.options[i].selected = true;
}
}
bootstrapDynamicFields(bootstrapMethod);
}
bootstrapDynamicFields(bootstrapMethod);
}
$( document ).ready(function() {
vendor2bootstrapMethod();
});
</script>
<div class="row">

Loading…
Cancel
Save