-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathbusiness_process_view.html
More file actions
108 lines (84 loc) · 4.4 KB
/
business_process_view.html
File metadata and controls
108 lines (84 loc) · 4.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{% extends "base_status.html" %}
{% load url from future %}
{% load i18n %}
{% load static %}
{% block title %}{% trans "Business Process" %}{% endblock %}
{% block smallheader %}{% trans "view" %}{% endblock %}
{% block largeheader %}{% trans "Business Process" %}{% endblock %}
{% block nav1 %}{{ block.super }}{% endblock %}
{% block nav2 %}<a href="{% url "bi.views.index" %}">{% trans "Business Process" %}</a>{% endblock %}
{% load adagiostags %}
{% block header %}
{{ block.super }}
<link href="{% url "media" path="css/bi.css" %}" rel="stylesheet">
{% endblock %}
{% block content %}
{% include "snippets/business_process_view_snippet.html" %}
{% endblock %}
{% block view_buttons %}{% endblock %}
{% block action_buttons %}{% endblock %}
{% block toolbar %}{% endblock %}
{% block footer %}
{{ block.super }}
<script src="{% url "home" %}rest/status.js"></script>
<script>
// When graphs link is clicked, simulate a click on 25hours tab as well
$(document).ready(function() {
$('#25hours').click();
//
function querystring(key) {
var re=new RegExp('(?:\\?|&)'+key+'=(.*?)(?=&|$)','gi');
var r=[], m;
while ((m=re.exec(document.location.search)) != null) r.push(m[1]);
return r;
}
});
// Load graphs when you click a new timeperiod under graphs tab
$('#graphs_ul').click(function(event){
var anchor = event.target.href.split('#')[1];
var title = event.target.text;
var my_element = document.getElementById(anchor);
if (my_element.childElementCount == 0) {
var spinner = document.createElement( 'img');
spinner.setAttribute("src", "{% url "media" path="external/select2/select2-spinner.gif" %}");
my_element.appendChild( spinner );
var url = '{{ graphs_url }}';
$.getJSON(url)
.done( function(data) {
var graph_row, div_notes, div_last_value, new_img;
$.each(data, function(i, item) {
if (item['title'] == title) {
graph_row = document.createElement( 'div');
graph_row.setAttribute("class", "graph_row");
div_notes = document.createElement('div');
div_notes.setAttribute("class", "graph_notes");
div_notes.textContent = item['notes'];
graph_row.appendChild( div_notes );
div_last_value = document.createElement('div');
div_last_value.setAttribute("class", "graph_last_value");
div_last_value.textContent = item['last_value'];
div_notes.appendChild( div_last_value );
new_img = document.createElement( 'img');
new_img.setAttribute("title", item['notes']);
new_img.setAttribute("class", 'graph_image');
{% if static %}
new_img.setAttribute("src", item['image_url']);
{% else %}
new_img.setAttribute("src", "{% url "pnp.views.pnp" 'image' %}?" + item['image_url'] + "&graph_width=350&graph_height=30");
{% endif %}
graph_row.appendChild( new_img );
my_element.appendChild( graph_row );
}
}
)
})
.fail( function() {
console.log('failed to fetch info from pnp4nagios');
})
.always( function() {
spinner.setAttribute('class', 'hide');
});
}
});
</script>
{% endblock %}