Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small JS fixes #6

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
platforms='any',
install_requires=[
'django-suit >=0.2.15, <0.3.0',
'django-rq >=0.8.0, <0.9.0',
'django-rq >=2.0.2, <3.0.0',
],
classifiers=[
'Development Status :: 5 - Production/Stable',
Expand Down
2 changes: 1 addition & 1 deletion suit_rq/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '1.0.1'
__version__ = '2.0.0'
default_app_config = 'suit_rq.apps.SuitRQConfig'
18 changes: 17 additions & 1 deletion suit_rq/templates/django_rq/job_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</ul>
{% endblock %}

{% block content_title %}<h1>Job Info</h1>{% endblock %}
{% block content_title %}<h1>Job {{ job.id }}</h1>{% endblock %}

{% block content %}

Expand Down Expand Up @@ -63,6 +63,16 @@
<th>Callable:</th>
<td>{{ job.func_name }}</td>
</tr>
<tr>
<th>Depends On:</th>
<td>
{% if job.dependency %}
<a href = "{% url 'rq_job_detail' queue_index job.dependency.id %}">
{{ job.dependency.id }}
</a>
{% endif %}
</td>
</tr>
{% if job.args %}
<tr>
<th>Args:</th>
Expand Down Expand Up @@ -105,6 +115,12 @@
{% endif %}
<a href="delete/" class="btn btn-danger">Delete</a>
</form>
{% if job.is_queued and not job.is_failed %}
<form method = 'POST' action = "{% url 'rq_enqueue_job' queue_index job.id %}">
{% csrf_token %}
<input type="submit" value="Enqueue" class="default" name="Enqueue">
</form>
{% endif %}
</div>

</div>
Expand Down
9 changes: 3 additions & 6 deletions suit_rq/templates/django_rq/jobs.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{% extends "admin/base_site.html" %}

{% load admin_static %}
{% load static %}

{% block extrahead %}
{{ block.super }}
<script type="text/javascript" src="{% static 'admin/js/jquery.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/jquery.init.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/actions.js' %}"></script>
<script type="text/javascript">
(function($) {
$(document).ready(function($) {
Expand All @@ -28,7 +25,7 @@
<span class="divider">»</span>
</li>
<li class="active">
<a href="{% url 'rq_jobs' queue_index %}">{{ queue.name }}</a>
<a href="{% url 'rq_jobs' queue_index %}">Jobs in {{ queue.name }}</a>
</li>
</ul>
{% endblock %}
Expand All @@ -50,7 +47,7 @@
<select name="action">
<option value="" selected="selected">---------</option>
<option value="delete">Delete</option>
{% if queue.name == 'failed' %}
{% if job_status == 'failed' %}
<option value="requeue">Requeue</option>
{% endif %}
</select>
Expand Down
36 changes: 15 additions & 21 deletions suit_rq/templates/django_rq/stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<th scope="col" class="text-center">Active Jobs</th>
<th scope="col" class="text-center">Deferred Jobs</th>
<th scope="col" class="text-center">Finished Jobs</th>
<th scope="col" class="text-center">Failed Jobs</th>
<th scope="col" class="text-center">Number of Workers</th>
<th scope="col" class="text-center">Host</th>
<th scope="col" class="text-center">Port</th>
Expand All @@ -45,31 +46,24 @@
</th>
<td class="text-center">{{ queue.jobs }}</td>
<td class="text-center">
{% if queue.name != 'failed' %}
<a href="{% url 'rq_started_jobs' queue.index %}">
{{ queue.started_jobs }}
</a>
{% else %}
-
{% endif %}
<a href="{% url 'rq_started_jobs' queue.index %}">
{{ queue.started_jobs }}
</a>
</td>
<td class="text-center">
<a href="{% url 'rq_deferred_jobs' queue.index %}">
{{ queue.deferred_jobs }}
</a>
</td>
<td class="text-center">
{% if queue.name != 'failed' %}
<a href="{% url 'rq_deferred_jobs' queue.index %}">
{{ queue.deferred_jobs }}
</a>
{% else %}
-
{% endif %}
<a href="{% url 'rq_finished_jobs' queue.index %}">
{{ queue.finished_jobs }}
</a>
</td>
<td class="text-center">
{% if queue.name != 'failed' %}
<a href="{% url 'rq_finished_jobs' queue.index %}">
{{ queue.finished_jobs }}
</a>
{% else %}
-
{% endif %}
<a href="{% url 'rq_failed_jobs' queue.index %}">
{{ queue.failed_jobs }}
</a>
</td>
<td class="text-center">{{ queue.workers }}</td>
<td class="text-center">{{ queue.connection_kwargs.host }}</td>
Expand Down