1 $(document).ready(function() {
2 $('li#GoogleMap').click(function (e) {
3 $('.'+this.id).trigger('show');
6 $('a.sl-platform').click(function (e) {
7 $('.'+this.id).trigger('show');
11 $('ul.nav-resources a').click(function() {
12 $('ul.nav-resources li').removeClass('active');
13 $(this).parent().addClass('active');
14 $('div.panel').hide();
15 $('div#'+$(this).data('panel')).show();
17 if ($(this).data('panel') == 'map') {
23 $.get("/rest/network", function(data) {
24 var list = '<div class="list-group-item sl-platform"><span class="list-group-item-heading">Testbeds</span></div>';
25 for(i=0; i<data.length;i++) {
26 list += '<a href="#" class="list-group-item sl-platform" 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>';
28 $('#select-platform').html(list);
33 $('button#ApplyPendind').click(function() {
35 // $.each(myslice.pending, function(k, p) {
38 // $.post("/update/slice", {}, function() {
43 //google.maps.event.addDomListener(window, 'load', initialize);
48 $.get("/rest/resource/", {"fields" : ["hostname","latitude","longitude"] }, function(data) {
51 center: new google.maps.LatLng(48.8567, 2.3508),
55 var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);
56 marker = new google.maps.Marker({
57 position: new google.maps.LatLng(48.8567, 2.3508),
59 icon: '/static/img/marker2.png'
62 for (i = 0; i < data.length; i++) {
63 if (!data[i].longitude) continue;
64 marker = new google.maps.Marker({
65 position: new google.maps.LatLng(data[i].latitude, data[i].longitude),
68 var infowindow = new google.maps.InfoWindow();
70 google.maps.event.addListener(marker, 'click', (function(marker, i) {
72 infowindow.setContent(data[i].hostname);
73 infowindow.open(map, marker);