-
-
Notifications
You must be signed in to change notification settings - Fork 303
Expand file tree
/
Copy pathpipeline_dashboard.html
More file actions
209 lines (191 loc) · 10.5 KB
/
pipeline_dashboard.html
File metadata and controls
209 lines (191 loc) · 10.5 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
{% extends "base.html" %}
{% load utils %}
{% block title %}
Pipeline Dashboard
{% endblock %}
{% block extrahead %}
<style>
thead th {
border-bottom: none !important;
}
tbody tr:hover {
background-color: #e0e0e0 !important;
cursor: pointer;
}
tbody tr:nth-child(even):hover {
background-color: #d3d3d3 !important;
}
.column {
word-break: break-word;
}
.has-text-orange {
color: #ff8c42 !important;
}
.has-tooltip-orange::before {
background-color: #ff8c42 !important;
}
.has-tooltip-orange::after {
border-top-color: #ff8c42 !important;
}
</style>
{% endblock %}
{% block content %}
<div class="columns">
<div class="column">
</div>
<div class="column is-four-fifths">
<div class="content is-normal">
<h1>Pipeline Dashboard</h1>
<hr />
</div>
<form method="get" class="box px-6 mx-0" action="">
<div class="field has-addons">
<div class="control is-expanded">
{{ form.search }}
</div>
<div class="control">
<button type="submit" class="button is-info"><i class="fa fa-search mx-1"></i></button>
</div>
</div>
</form>
<div class="box">
<div class="columns is-multiline is-vcentered mb-0">
<div class="column is-half has-text-left">
{% if load_per_queue %}
<p class="ml-3">
<span class="has-text-weight-bold has-text-black is-size-6 has-tooltip-arrow has-tooltip-multiline"
data-tooltip="Load factor is the ratio of the total compute required to run all active pipelines
in a queue to the available worker capacity for that queue over a 24-hour period.
A value greater than 1 indicates that the number of workers is insufficient to
run all pipelines within the schedule.">
Load Factor:
</span>
{% for queue_name, values in load_per_queue.items %}
<span class="has-text-weight-bold is-size-6 has-tooltip-arrow has-tooltip-multiline"
data-tooltip="{{ queue_name|capfirst }} priority pipeline queue.">
{{ queue_name| capfirst }}
</span>
{% with load_factor=values|get_item:"load_factor" additional=values|get_item:"additional_worker" %}
{% if load_factor == "no_worker" %}
<span class="has-text-weight-bold is-size-6 has-text-danger has-tooltip-arrow has-tooltip-multiline has-tooltip-danger"
data-tooltip="All workers in the {{ queue_name }} queue are down. Please run {{ additional }}
worker{{ additional|pluralize }} for the {{ queue_name }} queue.">
<span class="icon"><i class="fa fa-exclamation-triangle"></i></span>
</span>
{% elif load_factor < 1 %}
<span class="has-text-weight-bold is-size-6 has-text-success has-tooltip-arrow has-tooltip-multiline has-tooltip-success"
data-tooltip="{{ queue_name|capfirst }} queue perfectly balanced.">
{{ load_factor|floatformat:2 }}
<span class="icon"><i class="fa fa-check-circle"></i></span>
</span>
{% elif load_factor < 1.6 %}
<span class="has-text-weight-bold is-size-6 has-text-orange has-tooltip-arrow has-tooltip-multiline has-tooltip-orange"
data-tooltip="Consider adding {{ additional }} additional worker{{ additional|pluralize }} to the {{ queue_name }} queue.">
{{ load_factor|floatformat:2 }}
<span class="icon"><i class="fa fa-info-circle"></i></span>
</span>
{% else %}
<span class="has-text-weight-bold is-size-6 has-text-danger has-tooltip-arrow has-tooltip-multiline has-tooltip-danger"
data-tooltip="Consider adding {{ additional }} additional worker{{ additional|pluralize }} to the {{ queue_name }} queue.">
{{ load_factor|floatformat:2 }}
<span class="icon"><i class="fa fa-exclamation-circle"></i></span>
</span>
{% endif %}
{% endwith %}
{% if not forloop.last %} • {% endif %}
{% endfor %}
</p>
{% endif %}
</div>
<div class="column is-half has-text-right">
<p class="has-text-grey-dark has-text-weight-semibold mr-3">
{{ active_pipeline_count|default:0 }} active pipeline{{ active_pipeline_count|default:0|pluralize }},
{{ disabled_pipeline_count|default:0 }} disabled pipeline{{ disabled_pipeline_count|default:0|pluralize }}
</p>
</div>
</div>
<table class="table is-striped is-hoverable is-fullwidth">
<thead>
<tr>
<th colspan="6">
<div class="box is-small">
<div class="columns is-mobile is-vcentered">
<div class="column is-one-quarter">Pipeline ID</div>
<div class="column is-one-eighth">Active</div>
<div class="column is-one-eighth">Priority</div>
<div class="column is-one-eighth">Interval</div>
<div class="column is-one-eighth">Status</div>
<div class="column is-one-fifth">Last Run End Time</div>
<div class="column is-one-fifth">Next Run Start</div>
</div>
</div>
</th>
</tr>
</thead>
<tbody>
{% for schedule in schedule_list %}
<tr>
<td colspan="6">
<a href="{% url 'runs-list' pipeline_id=schedule.pipeline_id %}" class="has-text-info">
<div class="columns px-1 is-mobile is-vcentered">
<div class="column is-one-quarter">{{ schedule.pipeline_id }}</div>
<div class="column is-one-eighth has-text-grey">{{ schedule.is_active|yesno:"Yes,No" }}</div>
<div class="column is-one-eighth has-text-grey">{{ schedule.get_run_priority_display|capfirst}}</div>
<div class="column is-one-eighth has-text-grey">
{% if schedule.is_run_once %}
Once
{% else %}
{{ schedule.run_interval }} hour{{ schedule.run_interval|pluralize }}
{% endif %}
</div>
<div class="column is-one-eighth">
<span class="is-flex is-align-items-center">
{% include "includes/job_status.html" with status=schedule.status %}
</span>
</div>
<div class="column is-one-fifth has-text-grey">
{% if schedule.latest_run_end_date %}
{{ schedule.latest_run_end_date|date:"Y-m-d h:i a T" }}
{% else %}
N/A
{% endif %}
</div>
<div class="column is-one-fifth has-text-grey">
{% if schedule.next_run_date %}
{{ schedule.next_run_date|date:"Y-m-d" }}
{% else %}
N/A
{% endif %}
</div>
</div>
</a>
</td>
</tr>
{% empty %}
<tr>
<td colspan="6" class="has-text-centered">No pipeline found.</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% if is_paginated %}
<nav class="pagination is-centered px-5" role="navigation" aria-label="pagination">
{% if page_obj.has_previous %}
<a class="pagination-previous" href="?page={{ page_obj.previous_page_number }}">Previous</a>
{% endif %}
{% if page_obj.has_next %}
<a class="pagination-next" href="?page={{ page_obj.next_page_number }}">Next page</a>
{% endif %}
<ul class="pagination-list">
<li><a class="pagination-link" aria-label="Goto page 1" href="?page=1">1</a></li>
<li><span class="pagination-ellipsis">…</span></li>
<li><a class="pagination-link" aria-label="Goto page {{ page_obj.number }}"
href="?page={{ page_obj.paginator.num_pages }}">{{ page_obj.paginator.num_pages }}</a></li>
</ul>
</nav>
{% endif %}
</div>
<div class="column"></div>
</div>
{% endblock %}