1 $(document).ready(function() {
2 $('ul.nav-resources a').click(function() {
3 $('ul.nav-resources li').removeClass('active');
4 $(this).parent().addClass('active');
6 $('div#'+$(this).data('panel')).show();
8 if ($(this).data('panel') == 'map') {
14 $.get("/rest/network", function(data) {
15 var list = '<div class="list-group-item sl-platfrom"><span class="list-group-item-heading">Testbeds</span></div>';
16 for(i=0; i<data.length;i++) {
17 list += '<a href="#" class="list-group-item sl-platfrom" data-platform="'+data[i].network_hrn+'"><span class="list-group-item-heading">'+data[i].network_longname+'</span><p class="list-group-item-text">'+data[i].network_hrn+'</p></a>';
19 $('#select-platform').html(list);
24 $('button#ApplyPendind').click(function() {
26 // $.each(myslice.pending, function(k, p) {
29 // $.post("/update/slice", {}, function() {
34 //google.maps.event.addDomListener(window, 'load', initialize);
39 $.get("/rest/resource/", {"fields" : ["hostname","latitude","longitude"] }, function(data) {
42 center: new google.maps.LatLng(48.8567, 2.3508),
46 var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);
47 marker = new google.maps.Marker({
48 position: new google.maps.LatLng(48.8567, 2.3508),
50 icon: '/static/img/marker2.png'
53 for (i = 0; i < data.length; i++) {
54 if (!data[i].longitude) continue;
55 marker = new google.maps.Marker({
56 position: new google.maps.LatLng(data[i].latitude, data[i].longitude),
59 var infowindow = new google.maps.InfoWindow();
61 google.maps.event.addListener(marker, 'click', (function(marker, i) {
63 infowindow.setContent(data[i].hostname);
64 infowindow.open(map, marker);