Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab
authorLoic Baron <loic.baron@lip6.fr>
Tue, 21 Apr 2015 09:52:35 +0000 (11:52 +0200)
committerLoic Baron <loic.baron@lip6.fr>
Tue, 21 Apr 2015 09:52:35 +0000 (11:52 +0200)
portal/templates/_widget-monitor.html
portal/templates/onelab/onelab_account-view.html

index cb7af4f..6a7ab7a 100644 (file)
        $(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);
                        }
                });
index 985974f..e062949 100644 (file)
                                        <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>