$(document).ready(function() {
$.get('/monitor/services', function(result) {
for (var r in result) {
- html = '<div class="col-xs-6 col-sm-4 col-md-3 s-monitor"><div class="row">';
- html += '<div class="col-md-2"><img src="{{ STATIC_URL }}icons/'+result[r].status+'.png"></div>';
- html += '<div class="col-md-8">';
- html += '<h4>'+result[r].name+'<h4>';
- html += '<span class="subtitle">'+result[r].type+'</span>';
- if (typeof(result[r].version) != 'undefined')
- html += ' <span class="version">version '+result[r].version+'</span>';
- html += '</div></div></div>';
+ if(r == 'error'){
+ html = '<div style="padding-left:20px;">no monitoring available</div>'
+ }else{
+ html = '<div class="col-xs-6 col-sm-4 col-md-3 s-monitor"><div class="row">';
+ html += '<div class="col-md-2"><img src="{{ STATIC_URL }}icons/'+result[r].status+'.png"></div>';
+ html += '<div class="col-md-8">';
+ html += '<h4>'+result[r].name+'<h4>';
+ html += '<span class="subtitle">'+result[r].type+'</span>';
+ if (typeof(result[r].version) != 'undefined')
+ html += ' <span class="version">version '+result[r].version+'</span>';
+ html += '</div></div></div>';
+ }
$('div#monitor-services').append(html);
}
});
<th>Slice Name</th>
<th>Expiration Date</th>
<th>Download</th>
+ <th>Delete</th>
</tr>
{% for row in my_slices %}
<tr class="border_bottom">
<span class="glyphicon glyphicon-download"></span> Download
</button>
</td>
+ <td class="odd">
+ <button class="btn btn-danger btn-xs" name= "del_{{row.slice_name}}" type="submit" title="Download Slice Credentials" onclick="return confirm('Are you sure? If you do so, the slice will be permanently deleted.'); javascript:document.getElementById('button_value').value='del_{{row.slice_name}}';">
+ <span class="glyphicon glyphicon-remove"></span> Delete
+ </button>
+ </td>
</tr>
{%endfor%}
</table>