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') {
22 $('div.list-resources a').click(function() {
23 $('div.list-resources a').removeClass('active');
24 $(this).addClass('active');
25 $('div.panel').hide();
26 $('div#'+$(this).data('panel')).show();
30 $.get("/rest/network", function(data) {
31 var list = '<div class="list-group-item sl-platform"><span class="list-group-item-heading">Testbeds</span></div>';
32 for(i=0; i<data.length;i++) {
33 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>';
35 $('#select-platform').html(list);
40 $('button#ApplyPendind').click(function() {
42 // $.each(myslice.pending, function(k, p) {
45 // $.post("/update/slice", {}, function() {
50 //google.maps.event.addDomListener(window, 'load', initialize);
55 $.get("/rest/resource/", {"fields" : ["hostname","latitude","longitude"] }, function(data) {
58 center: new google.maps.LatLng(48.8567, 2.3508),
62 var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);
63 marker = new google.maps.Marker({
64 position: new google.maps.LatLng(48.8567, 2.3508),
66 icon: '/static/img/marker2.png'
69 for (i = 0; i < data.length; i++) {
70 if (!data[i].longitude) continue;
71 marker = new google.maps.Marker({
72 position: new google.maps.LatLng(data[i].latitude, data[i].longitude),
75 var infowindow = new google.maps.InfoWindow();
77 google.maps.event.addListener(marker, 'click', (function(marker, i) {
79 infowindow.setContent(data[i].hostname);
80 infowindow.open(map, marker);