[60ada4]: / Allura / allura / templates / site_admin_task_view.html  Maximize  Restore  History

Download this file

181 lines (176 with data), 6.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
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
{#-
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-#}
{% set page = 'task_manager' %}
{% set sidebar_rel = '../../' %}
{% extends 'allura:templates/site_admin.html' %}
{% block extra_css %}
<style type="text/css">
#task_details {
table-layout: fixed;
word-wrap: break-word;
border-collapse: separate;
border-spacing: 4px;
}
#task_details th,
#task_details td {
border: 0;
}
#task_details .first-column-headers {
width: 50px;
}
#task_details .first-column {
width: 225px;
}
#task_details .spacer {
width: 1px;
}
#task_details .second-column-headers {
width: 100px;
}
#task_details th {
background: #e5e5e5;
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #e5e5e5));
background-image: -webkit-linear-gradient(#ffffff, #e5e5e5);
background-image: -moz-linear-gradient(#ffffff, #e5e5e5);
background-image: -o-linear-gradient(#ffffff, #e5e5e5);
background-image: -ms-linear-gradient(#ffffff, #e5e5e5);
background-image: linear-gradient(#ffffff, #e5e5e5);
text-shadow: #fff 0 1px 0;
border: 1px solid #aaa;
border-radius: 3px;
}
#task_details th.side-header {
text-align: right;
vertical-align: top;
padding: 4px 10px;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
#task_details td.second-column {
border: 0;
}
#resubmit-task-form {
float: right;
}
</style>
{% endblock %}
{% block content %}
{% if not task %}
Task not found
{% else %}
{% if task.state in ['error', 'complete'] %}
<form id="resubmit-task-form" action="../resubmit/{{task._id}}" method="POST">
<input type="submit" value="Re-Submit Task" />
{{lib.csrf_token()}}
</form>
{% endif %}
<h2>Task Details</h2>
<table id="task_details">
<tr>
<td class="first-column-headers"></td>
<th class="first-column">Name</th>
<td class="spacer"></td>
<td class="second-column-headers"></td>
<th class="second-column">State</th>
</tr>
<tr>
<td class="first-column-headers"></td>
<td>{{ task.task_name }}</td>
<td class="spacer"></td>
<td class="second-column-headers"></td>
<td>{{ task.state }}</td>
</tr>
<tr>
<td class="first-column-headers"></td>
<th class="first-column">ID</th>
<td class="spacer"></td>
<td class="second-column-headers"></td>
<th class="second-column">Process</th>
</tr>
<tr>
<td class="first-column-headers"></td>
<td>{{ task._id }}</td>
<td class="spacer"></td>
<td class="second-column-headers"></td>
<td>{{ task.process if task.process }}</td>
</tr>
<tr>
<td class="first-column-headers"></td>
<th>Context</th>
<td class="spacer"></td>
<td class="second-column-headers"></td>
<th>Time</th>
</tr>
<tr>
<th class="side-header">Project</th>
<td>{{ task.project.shortname if task.project }}</td>
<td class="spacer"></td>
<th class="second-column-headers side-header">Queued</th>
<td>{{ task.time_queue.strftime('%Y/%m/%d %H:%M:%S') if task.time_queue }}</td>
</tr>
<tr>
<th class="side-header">Mount</th>
<td>{{ task.app_config.options.mount_point if task.app_config }}</td>
<td class="spacer"></td>
<th class="second-column-headers side-header">Started</th>
<td>{{ task.time_start.strftime('%Y/%m/%d %H:%M:%S') if task.time_start }}</td>
</tr>
<tr>
<th class="side-header">User</th>
<td>{{ task.user.username if task.user }}</td>
<td class="spacer"></td>
<th class="second-column-headers side-header">Stopped</th>
<td>{{ task.time_stop.strftime('%Y/%m/%d %H:%M:%S') if task.time_stop }}</td>
</tr>
<tr>
<td class="first-column-headers"></td>
<th>Args</th>
<td class="spacer"></td>
<td class="second-column-headers"></td>
<th>Keyword Args</th>
</tr>
{% if task.args|length > task.kwargs|length %}
{% set indexes = range(task.args|length) %}
{% else %}
{% set indexes = range(task.kwargs|length) %}
{% endif %}
{% set kwargs = task.kwargs.items()|list %}
{% for i in indexes %}
<tr>
<td class="first-column-headers"></td>
<td>{{ task.args[i] }}</td>
<td class="spacer"></td>
{% if kwargs[i] %}
<th class="second-column-headers side-header">{{ kwargs[i][0] }}</th>
<td>{{ kwargs[i][1] }}</td>
{% else %}
<td class="second-column-headers"></td>
<td></td>
{% endif %}
</tr>
{% endfor %}
<tr>
<td class="first-column-headers"></td>
<th colspan="4">Result</th>
</tr>
<tr>
<td class="first-column-headers"></td>
<td colspan="4"><pre>{{ task.result }}</pre></td>
</tr>
</table>
{% endif %}
{% endblock %}