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