1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

#11558: Disable sync button if RQ worker not running

This commit is contained in:
jeremystretch
2023-03-20 15:12:11 -04:00
parent 13d604d44e
commit 08bdb54cb4
6 changed files with 43 additions and 12 deletions

View File

@@ -6,7 +6,7 @@
{% block extra_controls %}
{% if perms.core.sync_datasource %}
{% if object.ready_for_sync %}
{% if sync_enabled and object.ready_for_sync %}
<form action="{% url 'core:datasource_sync' pk=object.pk %}" method="post">
{% csrf_token %}
<button type="submit" class="btn btn-sm btn-primary">
@@ -14,9 +14,11 @@
</button>
</form>
{% else %}
<button class="btn btn-sm btn-primary" disabled>
<i class="mdi mdi-sync" aria-hidden="true"></i> Sync
</button>
<span class="inline-block" tabindex="0" data-bs-toggle="tooltip" data-bs-delay="100" data-bs-placement="bottom" title="Unable to sync: No RQ worker running">
<button class="btn btn-sm btn-primary" disabled>
<i class="mdi mdi-sync" aria-hidden="true"></i> Sync
</button>
</span>
{% endif %}
{% endif %}
{% endblock %}