forked from mirrors/thatmattlove-hyperglass
added display_name attr to routers
This commit is contained in:
parent
b489874928
commit
23f8c0bdd7
4 changed files with 24 additions and 6 deletions
|
|
@ -66,6 +66,12 @@ class dev:
|
|||
list.append(str(r["name"]))
|
||||
return list
|
||||
|
||||
def display_name():
|
||||
list = []
|
||||
for r in routers_list:
|
||||
list.appen(str(r["display_name"]))
|
||||
return list
|
||||
|
||||
|
||||
class gen:
|
||||
"""Functions to import config variables and return default values if undefined"""
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ def get_routers(asn):
|
|||
dict(
|
||||
location=r["location"],
|
||||
hostname=r["name"],
|
||||
display_name=r["display_name"],
|
||||
type=r["type"],
|
||||
requiresIP6Cidr=True,
|
||||
)
|
||||
|
|
@ -119,6 +120,7 @@ def get_routers(asn):
|
|||
dict(
|
||||
location=r["location"],
|
||||
hostname=r["name"],
|
||||
display_name=r["display_name"],
|
||||
type=r["type"],
|
||||
requiresIP6Cidr=False,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -88,10 +88,10 @@
|
|||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="field has-addons has-addons-centered">
|
||||
<div class="control has-icons-left">
|
||||
<div class="field has-addons has-addons-centered" id="lg-netlocdropdown">
|
||||
<div class="control has-icons-left" id="network-control">
|
||||
<div class="select is-medium is-rounded">
|
||||
<select id="network" name="network">
|
||||
<select id="network" name="network" style="width: 256px">
|
||||
<!-- <option value="" disabled></option> -->
|
||||
{% for net in device_networks %}
|
||||
<option value="{{ net }}">AS{{ net }}</option>
|
||||
|
|
@ -100,9 +100,9 @@
|
|||
</div>
|
||||
<span class="icon is-left"><i class="icofont-cloudapp"></i></span>
|
||||
</div>
|
||||
<div class="control has-icons-left">
|
||||
<div class="control has-icons-left" id="router-control">
|
||||
<div class="select is-medium is-rounded">
|
||||
<select id="router">
|
||||
<select id="router" style="width: 256px">
|
||||
<option id="text_location" selected disabled>{{ text_location }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ var progress = ($('#progress'));
|
|||
var resultsbox = ($('#resultsbox'));
|
||||
resultsbox.hide();
|
||||
progress.hide();
|
||||
adjustDropdowns();
|
||||
|
||||
// Bulma Toggable Dropdown - help text
|
||||
let dropdown = document.querySelector('#help-dropdown');
|
||||
|
|
@ -21,6 +22,15 @@ function adjustHeight() {
|
|||
}
|
||||
}
|
||||
|
||||
function adjustDropdowns() {
|
||||
var actual_width = window.innerWidth;
|
||||
if (actual_width < 1024) {
|
||||
$('#lg-netlocdropdown').removeClass('has-addons').removeClass('has-addons-centered').addClass('is-grouped').addClass('is-grouped-centered').addClass('is-grouped-multiline');
|
||||
$('#network').css('width', actual_width * 0.85);
|
||||
$('#router').css('width', actual_width * 0.85);
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var defaultasn = $("#network").val();
|
||||
$.ajax({
|
||||
|
|
@ -56,7 +66,7 @@ $('#network').on('change', () => {
|
|||
|
||||
function updateRouters(routers) {
|
||||
routers.forEach(function(r) {
|
||||
$('#router').append($("<option>").attr('value', r.location).attr('type', r.type).text(r.location))
|
||||
$('#router').append($("<option>").attr('value', r.location).attr('type', r.type).text(r.display_name))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue