| lombardof | fb37bca | 2018-05-03 16:20:04 +0200 | [diff] [blame^] | 1 | {% extends "base.html" %} |
| 2 | {% load get %} |
| 3 | {% load staticfiles %} |
| 4 | |
| 5 | |
| 6 | |
| 7 | {% block head_block %} |
| 8 | {{ block.super }} |
| 9 | <!-- Codemirror core CSS --> |
| 10 | <link rel="stylesheet" href="/static/bower_components/codemirror/lib/codemirror.css"> |
| 11 | <link rel="stylesheet" href="/static/bower_components/codemirror/addon/fold/foldgutter.css" /> |
| 12 | <link rel="stylesheet" href="/static/bower_components/codemirror/theme/neat.css"> |
| 13 | <link rel="stylesheet" href="/static/bower_components/codemirror/addon/dialog/dialog.css"> |
| 14 | <link rel="stylesheet" href="/static/bower_components/codemirror/addon/display/fullscreen.css"> |
| 15 | {% endblock %} |
| 16 | {% block title_header_big %} |
| 17 | {{ block.super }} |
| 18 | {% endblock %} |
| 19 | {% block left_sidebar %} |
| 20 | {% include 'osm/osm_project_left_sidebar.html' %} |
| 21 | {% endblock %} |
| 22 | |
| 23 | |
| 24 | {% block breadcrumb_body %} |
| 25 | {{ block.super }} |
| 26 | <li><a href="{% url 'projects:instances:list' project_id=project_id type=type %}">Instances</a></li> |
| 27 | {% endblock %} |
| 28 | |
| 29 | {% block content_body %} |
| 30 | {{ block.super }} |
| 31 | {% include 'modal/instance_create.html' %} |
| 32 | {% csrf_token %} |
| 33 | <div class="row"> |
| 34 | <div class="col-md-12"> |
| 35 | |
| 36 | <div class="box"> |
| 37 | <div class="box-header with-border"> |
| 38 | <h3 class="box-title">Instances</h3> |
| 39 | <!-- |
| 40 | <div class="box-tools"> |
| 41 | <a href="javascript:newVimModal()" class="btn btn-block btn-primary btn-sm"><i |
| 42 | class="fa fa-plus"></i><span> New VIM</span></a> |
| 43 | </div> |
| 44 | --> |
| 45 | </div> |
| 46 | <div class="box-body"> |
| 47 | <table id="instances_table" class="table table-bordered table-striped"> |
| 48 | <thead> |
| 49 | <tr> |
| 50 | <th>Id</th> |
| 51 | <th>Name</th> |
| 52 | <th>Nsd name</th> |
| 53 | <th style="width:5%">Operational Status</th> |
| 54 | <th style="width:5%">Config Status</th> |
| 55 | <th>Detailed Status</th> |
| 56 | <th >Actions</th> |
| 57 | </tr> |
| 58 | </thead> |
| 59 | <tbody> |
| 60 | {% for i in instances %} |
| 61 | <tr> |
| 62 | |
| 63 | <td>{{ i|get:"_id" }}</td> |
| 64 | <td>{{ i|get:"short-name" }}</td> |
| 65 | <td>{{ i|get:"nsd-name-ref" }}</td> |
| 66 | |
| 67 | {% if i|get:"operational-status" == 'failed' %} |
| 68 | <td><span class="label label-danger">{{ i|get:"operational-status" }}</span> </td> |
| 69 | {% elif i|get:"operational-status" == 'init' %} |
| 70 | <td><span class="label label-warning">{{ i|get:"operational-status" }}</span> </td> |
| 71 | {% elif i|get:"operational-status" == 'running' %} |
| 72 | <td><span class="label label-success">{{ i|get:"operational-status" }}</span> </td> |
| 73 | {% else %} |
| 74 | <td>{{ i|get:"operational-status" }}</td> |
| 75 | {% endif %} |
| 76 | {% if i|get:"config-status" == 'failed' %} |
| 77 | <td><span class="label label-danger">{{ i|get:"config-status" }}</span> </td> |
| 78 | {% elif i|get:"config-status" == 'init' %} |
| 79 | <td><span class="label label-warning">{{ i|get:"config-status" }}</span> </td> |
| 80 | {% elif i|get:"config-status" == 'running' %} |
| 81 | <td><span class="label label-success">{{ i|get:"config-status" }}</span> </td> |
| 82 | {% elif i|get:"config-status" == 'configured' %} |
| 83 | <td><span class="label label-success">{{ i|get:"config-status" }}</span> </td> |
| 84 | {% else %} |
| 85 | <td>{{ i|get:"config-status" }}</td> |
| 86 | {% endif %} |
| 87 | <td style=" max-width:1px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">{{ i|get:"detailed-status" }}</td> |
| 88 | <td> |
| 89 | <div class="btn-group"> |
| 90 | <button type="button" class="btn btn-default" |
| 91 | onclick="javascript:showInstanceDetails('{% url 'projects:instances:show' instance_id=i|get:'_id' project_id=project_id type=type %}')" |
| 92 | data-toggle="tooltip" data-placement="top" data-container="body" title="Show Info"><i |
| 93 | class="fa fa-info"></i> |
| 94 | </button> |
| 95 | |
| 96 | <button type="button" class="btn btn-default" |
| 97 | onclick="javascript:deleteNs('{% url 'projects:instances:delete' instance_id=i|get:'_id' project_id=project_id type=type %}')" |
| 98 | data-toggle="tooltip" data-placement="top" data-container="body" title="Delete"><i |
| 99 | class="fa fa-trash-o"></i></button> |
| 100 | |
| 101 | <button type="button" class="btn btn-default dropdown-toggle" |
| 102 | data-toggle="dropdown" aria-expanded="false">Actions |
| 103 | <span class="fa fa-caret-down"></span></button> |
| 104 | <ul class="dropdown-menu"> |
| 105 | <li><a href="#" onclick="javascript:performAction('{% url 'projects:instances:action' instance_id=i|get:'_id' project_id=project_id type=type %}')"> |
| 106 | <i class="fa fa-magic"></i>Exec NS Primitive</a></li> |
| 107 | <li><a href="#"> <i class="fa fa-list"></i>Active operations</a></li> |
| 108 | </ul> |
| 109 | |
| 110 | |
| 111 | </div> |
| 112 | |
| 113 | </td> |
| 114 | |
| 115 | |
| 116 | </tr> |
| 117 | {% endfor %} |
| 118 | </tbody> |
| 119 | </table> |
| 120 | </div> |
| 121 | </div> |
| 122 | </div> |
| 123 | |
| 124 | </div> |
| 125 | {% include 'modal/instance_show.html' %} |
| 126 | {% include 'modal/instance_new_action.html' %} |
| 127 | {% endblock %} |
| 128 | |
| 129 | {% block resource_block %} |
| 130 | {{ block.super }} |
| 131 | <!-- Utility JS --> |
| 132 | |
| 133 | <script src="/static/bower_components/codemirror/lib/codemirror.js"></script> |
| 134 | <script src="/static/bower_components/codemirror/addon/fold/foldcode.js"></script> |
| 135 | <script src="/static/bower_components/codemirror/addon/fold/foldgutter.js"></script> |
| 136 | <script src="/static/bower_components/codemirror/addon/fold/brace-fold.js"></script> |
| 137 | <script src="/static/bower_components/codemirror/mode/javascript/javascript.js"></script> |
| 138 | <script src="/static/bower_components/codemirror/addon/search/searchcursor.js"></script> |
| 139 | <script src="/static/bower_components/codemirror/addon/search/search.js"></script> |
| 140 | <script src="/static/bower_components/codemirror/addon/dialog/dialog.js"></script> |
| 141 | <script src="/static/bower_components/codemirror/addon/display/autorefresh.js"></script> |
| 142 | <script src="/static/bower_components/codemirror/addon/edit/matchbrackets.js"></script> |
| 143 | <script src="/static/bower_components/codemirror/addon/edit/closebrackets.js"></script> |
| 144 | <script src="/static/bower_components/codemirror/addon/display/fullscreen.js"></script> |
| 145 | <script src="/static/bower_components/codemirror/keymap/sublime.js"></script> |
| 146 | <script src="/static/src/instancehandler/instance_list.js"></script> |
| 147 | |
| 148 | {% endblock %} |
| 149 | |
| 150 | {% block footer %} |
| 151 | {% include "footer.html" %} |
| 152 | {% endblock %} |