var platformParameters = {};
- $.get("/rest/platform", function(data) {
- var list = '<div class="list-group-item sl-platfrom"><span class="list-group-item-heading">Testbeds</span></div>';
- for(i=0; i<data.length;i++) {
- list += '<a href="#" class="list-group-item sl-platfrom" data-platform="'+data[i].platform+'"><span class="list-group-item-heading">'+data[i].platform_longname+'</span><p class="list-group-item-text">'+data[i].platform+'</p></a>';
- }
- $('#select-platform').html(list);
- }).done(function() {
-
- });
+
/* Testbeds list */
$("div#testbed-list").ready(function() {
$('div.panel').hide();
$('div#'+$(this).data('panel')).show();
});
+
+ $.get("/rest/platform", function(data) {
+ var list = '<div class="list-group-item sl-platfrom"><span class="list-group-item-heading">Testbeds</span></div>';
+ for(i=0; i<data.length;i++) {
+ list += '<a href="#" class="list-group-item sl-platfrom" data-platform="'+data[i].platform+'"><span class="list-group-item-heading">'+data[i].platform_longname+'</span><p class="list-group-item-text">'+data[i].platform+'</p></a>';
+ }
+ $('#select-platform').html(list);
+ }).done(function() {
+
+ });
+
+ $.get("/rest/resource/", {"fields" : ["hostname","latitude","longitude"] }, function(data) {
+
+ var mapOptions = {
+ center: new google.maps.LatLng(48.8567, 2.3508),
+ zoom: 4,
+ scrollwheel: false
+ };
+ var map = new google.maps.Map(document.getElementById("map"), mapOptions);
+ marker = new google.maps.Marker({
+ position: new google.maps.LatLng(48.8567, 2.3508),
+ map: map,
+ icon: '/static/img/marker2.png'
+ });
+ for (i = 0; i < data.length; i++) {
+ if (!data[i].longitude) continue;
+ marker = new google.maps.Marker({
+ position: new google.maps.LatLng(data[i].latitude, data[i].longitude),
+ map: map
+ });
+
+ google.maps.event.addListener(marker, 'click', (function(marker, i) {
+ return function() {
+ infowindow.setContent(data[i].hostname);
+ infowindow.open(map, marker);
+ };
+ })(marker, i));
+ }
+ });
+ //google.maps.event.addDomListener(window, 'load', initialize);
});
\ No newline at end of file
{% extends "layout_wide.html" %}
{% block head %}
+<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyC1RUj824JAiHRVqgc2CSIg4CpKHhh84Lw&sensor=false"></script>
<script src="{{ STATIC_URL }}js/onelab_slice-resource-view.js"></script>
{% endblock %}
</ul>
</div>
- <div class="col-md-10">
+ <div class="col-md-10" style="height:100%;">
<div class="row">
{% include theme|add:"_widget-slice-sections.html" %}
</div>
<li><a href="#"></a></li>
</ul>
</div>
- <div id="resources" class="panel">
- <table cellpadding="0" cellspacing="0" border="0" class="table" id="objectList"></table>
- </div>
- <div id="map" class="panel" style="display:none;">
- Map
+ <div class="row" style="height:100%;">
+ <div id="resources" class="panel">
+ <table cellpadding="0" cellspacing="0" border="0" class="table" id="objectList"></table>
+ </div>
+ <div id="map" class="panel" style="height:370px;" style="display:none;"></div>
</div>
</div>
{% endblock %}
\ No newline at end of file