1 {% extends
"base.html" %}
10 <!-- Codemirror core CSS -->
11 <link rel=
"stylesheet" href=
"/static/node_modules/codemirror/lib/codemirror.css">
12 <link rel=
"stylesheet" href=
"/static/node_modules/codemirror/addon/fold/foldgutter.css" />
13 <link rel=
"stylesheet" href=
"/static/node_modules/codemirror/theme/neat.css">
14 <link rel=
"stylesheet" href=
"/static/node_modules/codemirror/addon/dialog/dialog.css">
15 <link rel=
"stylesheet" href=
"/static/node_modules/codemirror/addon/display/fullscreen.css">
16 <link rel=
"stylesheet" href=
"/static/node_modules/select2/dist/css/select2.min.css">
17 <link rel=
"stylesheet" href=
"/static/node_modules/datatables.net-bs/css/dataTables.bootstrap.min.css">
20 {% block title_header_big %}
23 {% block left_sidebar %}
24 {% include 'osm/osm_project_left_sidebar.html' %}
28 {% block breadcrumb_body %}
30 <li><a href=
"{% url 'instances:list' type=type %}">Instances
</a></li>
31 <li><a href=
"#">History of Operations
</a></li>
34 {% block content_body %}
36 {% include 'modal/instance_create.html' %}
39 <div class=
"col-md-12">
42 <div class=
"box-header with-border">
43 <h3 class=
"box-title">History of operations
</h3>
46 <div class=
"box-body">
47 <table id=
"operations_table" class=
"table table-bordered table-striped">
52 <th>Operation State
</th>
54 <th>Status Entered Time
</th>
67 {% include 'modal/operation_show.html' %}
70 {% block resource_block %}
73 <script src=
"/static/node_modules/select2/dist/js/select2.js"></script>
74 <script src=
"/static/node_modules/codemirror/lib/codemirror.js"></script>
75 <script src=
"/static/node_modules/codemirror/addon/fold/foldcode.js"></script>
76 <script src=
"/static/node_modules/codemirror/addon/fold/foldgutter.js"></script>
77 <script src=
"/static/node_modules/codemirror/addon/fold/brace-fold.js"></script>
78 <script src=
"/static/node_modules/codemirror/mode/javascript/javascript.js"></script>
79 <script src=
"/static/node_modules/codemirror/addon/search/searchcursor.js"></script>
80 <script src=
"/static/node_modules/codemirror/addon/search/search.js"></script>
81 <script src=
"/static/node_modules/codemirror/addon/dialog/dialog.js"></script>
82 <script src=
"/static/node_modules/codemirror/addon/display/autorefresh.js"></script>
83 <script src=
"/static/node_modules/codemirror/addon/edit/matchbrackets.js"></script>
84 <script src=
"/static/node_modules/codemirror/addon/edit/closebrackets.js"></script>
85 <script src=
"/static/node_modules/codemirror/addon/display/fullscreen.js"></script>
86 <script src=
"/static/node_modules/codemirror/keymap/sublime.js"></script>
87 <script src=
"/static/node_modules/datatables.net/js/jquery.dataTables.min.js"></script>
88 <script src=
"/static/node_modules/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
89 <script src=
"/static/src/instancehandler/instance_operations_list.js"></script>
92 var instance_type = '{{ type }}';
93 var instance_id = '{{ instance_id }}';
94 $(document).ready(function () {
95 var table = $('#operations_table').DataTable({
98 "url":
"/instances/" + instance_type +
"/" +instance_id +
"/operation",
99 "dataSrc": function (json) {
100 return json['operations'];
104 console.log(
"no auth");
105 moveToLogin(window.location.pathname);
108 "error": function(hxr, error, thrown){
115 "render": function (data, type, row) {
121 "render": function (data, type, row) {
122 return row['lcmOperationType'];
127 "render": function (data, type, row) {
129 if(row[
"operationState"] === 'FAILED')
130 return '
<span class=
"label label-danger">'+ row[
"operationState"] +'
</span>';
131 else if(row[
"operationState"] === 'PROCESSING')
132 return '
<span class=
"label label-warning">'+ row[
"operationState"] +'
</span>';
133 else if(row[
"operationState"] === 'COMPLETED')
134 return '
<span class=
"label label-success">'+ row[
"operationState"] +'
</span>';
136 return row[
"operationState"];
141 "render": function (data, type, row) {
142 return moment.unix(row['startTime']).format('YYYY-MM-DD hh:mm:ss a')
147 "render": function (data, type, row) {
148 return moment.unix(row['statusEnteredTime']).format('YYYY-MM-DD hh:mm:ss a')
153 "render": function (data, type, row) {
154 return '
<div class=
"btn-group">\n' +
155 '
<button type=
"button" class=
"btn btn-default"\n' +
156 '
onclick=
"javascript:showOperationDetails(\''+instance_type+'\', \''+instance_id+'\', \''+row["_id
"]+'\')"\n' +
157 '
data-toggle=
"tooltip" data-placement=
"top" data-container=
"body" title=
"Show Info">\n' +
158 '
<i class=
"fa fa-info"></i>\n' +
166 "order": [[
3,
"asc" ]]
170 setInterval(function () {
180 {% include
"footer.html" %}