-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from laurapanzariello/develop
prefixv4 and prefixv6
- Loading branch information
Showing
4 changed files
with
212 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
html body { | ||
display: grid; | ||
grid-template-columns: 1fr; | ||
margin: 10%; | ||
background-color: #f2fcff; | ||
} | ||
|
||
section.container-cadvlan { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
flex-basis: 100%; | ||
|
||
} | ||
|
||
div.form-group-cadvlan { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
border-left: 2px solid #0D84A5; | ||
margin: 20px; | ||
} | ||
|
||
div.form-row-cadvlan { | ||
display: flex; | ||
flex-direction: row; | ||
align-content: space-between; | ||
align-items: flex-start; | ||
margin: 10px; | ||
margin-top: 16px; | ||
} | ||
|
||
div.form-group { | ||
display: flex; | ||
flex-direction: row; | ||
align-content: flex-start; | ||
align-items: flex-end; | ||
margin: 5px; | ||
} | ||
|
||
div.field-group { | ||
vertical-align: bottom; | ||
} | ||
|
||
.form-control, | ||
.input.form-control.bs-autocomplete { | ||
background-color : #FFFFFF; | ||
} | ||
|
||
input:required, | ||
select.form-control:required { | ||
border-left-color: #c87392; | ||
border-left-width: 1px; | ||
} | ||
|
||
button.btn.btn-social-add.btn-responsive.env { | ||
margin-top: 35px; | ||
} | ||
|
||
button#more_range.btn.btn-social-add.btn-responsive.channel, | ||
button#btn_add_router_env.btn.btn-social-add.btn-responsive.channel, | ||
button#btn_add_logic_env.btn.btn-social-add.btn-responsive.channel, | ||
button#btn_add_vrf.btn.btn-social-add.btn-responsive.channel, | ||
button#btn_add_fisic_env.btn.btn-social-add.btn-responsive.channel { | ||
margin-bottom: 0px; | ||
} | ||
|
||
select.form-control, | ||
input.form-control.bs-autocomplete { | ||
height: 36px; | ||
font-size: 0.875rem; | ||
border: 1px solid #e8e8e8; | ||
border-radius: 3px; | ||
padding: 0.5em 1.07em 0.5em; | ||
width: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
$(document).ready(function() { | ||
|
||
let id_prefixv4 = document.getElementById("id_prefixv4"); | ||
let id_prefixv6 = document.getElementById("id_prefixv6"); | ||
let btn_sav = document.getElementById("btn_sav"); | ||
let btn_can = document.getElementById("btn_can"); | ||
let id_name = document.getElementById("id_name"); | ||
let id_environment = document.getElementById("id_environment"); | ||
let id_network_ipv4 = document.getElementById("id_network_ipv4"); | ||
let id_network_ipv6 = document.getElementById("id_network_ipv6"); | ||
let id_vlan_number = document.getElementById("id_vlan_number"); | ||
let id_number = document.getElementById("id_number"); | ||
|
||
$(id_prefixv4).parent().hide(); | ||
$(id_prefixv6).parent().hide(); | ||
|
||
$(btn_sav).button({ icons: {primary: "ui-icon-disk"} }); | ||
|
||
$(btn_can).button({ icons: {primary: "ui-icon-cancel"} }).click(function(){ | ||
location.href = "vlan/list/"; | ||
}); | ||
|
||
$(id_name).keyup(function() { | ||
var valor = $(this).val().replace(/[^0-9A-Za-z_-]+/g,''); | ||
$(this).val(valor); | ||
}); | ||
|
||
$(id_name).mouseover(function() { | ||
$(this).attr("title","Somente letras maiúsculas e minúsculas, números, '-' e '_' são permitidos."); | ||
}); | ||
|
||
get_environment_configuration_available(); | ||
|
||
$(id_environment).change(function() { | ||
$(id_network_ipv4).val($('option:first', this).val()); | ||
$(id_network_ipv6).val($('option:first', this).val()); | ||
|
||
get_environment_configuration_available(); | ||
}); | ||
|
||
$(id_network_ipv4).change(function(){ | ||
var options = $(this).children("option:selected").text(); | ||
|
||
if (options == "Sim") { | ||
$(id_prefixv4).parent().show(); | ||
} else { | ||
$(id_prefixv4).parent().hide(); | ||
} | ||
}); | ||
|
||
$(id_network_ipv6).change(function(){ | ||
var options = $(this).children("option:selected").text(); | ||
|
||
if (options == "Sim") { | ||
$(id_prefixv6).parent().show(); | ||
} else { | ||
$(id_prefixv6).parent().hide(); | ||
} | ||
}); | ||
|
||
$(id_vlan_number).change(function(){ | ||
var options = $(this).children("option:selected").text(); | ||
|
||
if (options == "Sim") { | ||
$(id_number).parent().show(); | ||
} else { | ||
$(id_number).parent().hide(); | ||
} | ||
}); | ||
|
||
}) | ||
|
||
function get_environment_configuration_available() { | ||
|
||
var environment_id = $(id_environment).val(); | ||
|
||
var maskv4; | ||
var maskv6; | ||
|
||
$.ajax({ | ||
data: {environment_id: environment_id}, | ||
url: "/vlan/form/get/available/environment/configuration/by/environment/id/", | ||
method: 'GET', | ||
success: function(data) { | ||
|
||
data = $.parseJSON(data); | ||
|
||
var network_ipv4 = ''; | ||
var network_ipv6 = ''; | ||
|
||
if (data.available_environment_config_ipv4 == true) { | ||
$(id_network_ipv4).parent().show(); | ||
} else { | ||
$(id_network_ipv4).parent().hide(); | ||
} | ||
|
||
if (data.available_environment_config_ipv6 == true) { | ||
$(id_network_ipv6).parent().show(); | ||
} else { | ||
$(id_network_ipv6).parent().hide(); | ||
} | ||
|
||
if (data.vlan_range == true){ | ||
$(id_vlan_number).parent().show(); | ||
$(id_number).parent().hide(); | ||
} else { | ||
$(id_vlan_number).parent().hide(); | ||
$(id_number).parent().show(); | ||
} | ||
|
||
if (data.hide_vlan_range == true){ | ||
$(id_vlan_number).parent().hide(); | ||
$(id_number).parent().hide(); | ||
} | ||
|
||
if (data.maskv4){ | ||
id_prefixv4.value = data.maskv4 | ||
} | ||
|
||
if (data.maskv6){ | ||
id_prefixv6.value = data.maskv6 | ||
} | ||
}, | ||
error: function(data) { | ||
console.log(data); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters