2 Copyright 2019 EveryUP srl
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
17 {% extends
"base.html" %}
20 {% load staticfiles %}
24 {% block head_block %}
26 <!-- Codemirror core CSS -->
27 <link rel=
"stylesheet" href=
"/static/node_modules/codemirror/lib/codemirror.css">
28 <link rel=
"stylesheet" href=
"/static/node_modules/codemirror/addon/fold/foldgutter.css" />
29 <link rel=
"stylesheet" href=
"/static/node_modules/codemirror/theme/neat.css">
30 <link rel=
"stylesheet" href=
"/static/node_modules/codemirror/addon/dialog/dialog.css">
31 <link rel=
"stylesheet" href=
"/static/node_modules/codemirror/addon/display/fullscreen.css">
32 <link rel=
"stylesheet" href=
"/static/node_modules/select2/dist/css/select2.min.css">
33 <link rel=
"stylesheet" href=
"/static/node_modules/datatables.net-bs/css/dataTables.bootstrap.min.css">
36 {% block title_header_big %}
39 {% block left_sidebar %}
40 {% include 'osm/osm_project_left_sidebar.html' %}
44 {% block breadcrumb_body %}
46 <li><a href=
"{% url 'instances:list' type=type %}">Instances
</a></li>
47 <li><a href=
"#">History of Operations
</a></li>
50 {% block content_body %}
52 {% include 'modal/instance_create.html' %}
55 <div class=
"col-md-12">
58 <div class=
"box-header with-border">
59 <h3 class=
"box-title">History of operations
</h3>
62 <div class=
"box-body">
63 <table id=
"operations_table" class=
"table table-bordered table-striped">
68 <th>Operation State
</th>
70 <th>Status Entered Time
</th>
83 {% include 'modal/operation_show.html' %}
86 {% block resource_block %}
89 <script src=
"/static/node_modules/select2/dist/js/select2.js"></script>
90 <script src=
"/static/node_modules/codemirror/lib/codemirror.js"></script>
91 <script src=
"/static/node_modules/codemirror/addon/fold/foldcode.js"></script>
92 <script src=
"/static/node_modules/codemirror/addon/fold/foldgutter.js"></script>
93 <script src=
"/static/node_modules/codemirror/addon/fold/brace-fold.js"></script>
94 <script src=
"/static/node_modules/codemirror/mode/javascript/javascript.js"></script>
95 <script src=
"/static/node_modules/codemirror/addon/search/searchcursor.js"></script>
96 <script src=
"/static/node_modules/codemirror/addon/search/search.js"></script>
97 <script src=
"/static/node_modules/codemirror/addon/dialog/dialog.js"></script>
98 <script src=
"/static/node_modules/codemirror/addon/display/autorefresh.js"></script>
99 <script src=
"/static/node_modules/codemirror/addon/edit/matchbrackets.js"></script>
100 <script src=
"/static/node_modules/codemirror/addon/edit/closebrackets.js"></script>
101 <script src=
"/static/node_modules/codemirror/addon/display/fullscreen.js"></script>
102 <script src=
"/static/node_modules/codemirror/keymap/sublime.js"></script>
103 <script src=
"/static/node_modules/datatables.net/js/jquery.dataTables.min.js"></script>
104 <script src=
"/static/node_modules/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
105 <script src=
"/static/src/instancehandler/instance_operations_list.js"></script>
108 var instance_type = '{{ type }}';
109 var instance_id = '{{ instance_id }}';
110 $(document).ready(function () {
111 var table = $('#operations_table').DataTable({
114 "url":
"/instances/" + instance_type +
"/" +instance_id +
"/operation",
115 "dataSrc": function (json) {
116 return json['operations'];
120 console.log(
"no auth");
121 moveToLogin(window.location.pathname);
124 "error": function(hxr, error, thrown){
131 "render": function (data, type, row) {
137 "render": function (data, type, row) {
138 return row['lcmOperationType'];
143 "render": function (data, type, row) {
145 if(row[
"operationState"] === 'FAILED')
146 return '
<span class=
"label label-danger">'+ row[
"operationState"] +'
</span>';
147 else if(row[
"operationState"] === 'PROCESSING')
148 return '
<span class=
"label label-warning">'+ row[
"operationState"] +'
</span>';
149 else if(row[
"operationState"] === 'COMPLETED')
150 return '
<span class=
"label label-success">'+ row[
"operationState"] +'
</span>';
152 return row[
"operationState"];
157 "render": function (data, type, row) {
158 return moment.unix(row['startTime']).format('YYYY-MM-DD hh:mm:ss a')
163 "render": function (data, type, row) {
164 return moment.unix(row['statusEnteredTime']).format('YYYY-MM-DD hh:mm:ss a')
169 "render": function (data, type, row) {
170 return '
<div class=
"btn-group">\n' +
171 '
<button type=
"button" class=
"btn btn-default"\n' +
172 '
onclick=
"javascript:showOperationDetails(\''+instance_type+'\', \''+instance_id+'\', \''+row["_id
"]+'\')"\n' +
173 '
data-toggle=
"tooltip" data-placement=
"top" data-container=
"body" title=
"Show Info">\n' +
174 '
<i class=
"fa fa-info"></i>\n' +
182 "order": [[
3,
"asc" ]]
186 setInterval(function () {
196 {% include
"footer.html" %}