mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
make delayed queue connfigurable
This commit is contained in:
@@ -1,77 +1,85 @@
|
||||
<h1>Worker</h1>
|
||||
|
||||
<div>
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" id="configurationTabs">
|
||||
{% if isConnected %}
|
||||
<div>
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" id="configurationTabs">
|
||||
|
||||
<li class="worker-configuration" role="presentation">
|
||||
<a href="#worker-configuration" aria-controls="worker-configuration" role="tab" data-toggle="tab" data-url="/admin/worker-manager/configuration">
|
||||
{{ "Configuration" | trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="worker-searchengine" role="presentation">
|
||||
<a href="#worker-searchengine" aria-controls="worker-searchengine" role="tab" data-toggle="tab" data-url="/admin/worker-manager/searchengine">
|
||||
{{ "Searchengine" | trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="worker-pull-assets" role="presentation">
|
||||
<a href="#worker-pull-assets" aria-controls="worker-pull-assets" role="tab" data-toggle="tab" data-url="/admin/worker-manager/pull-assets">
|
||||
{{ "Pull Assets" | trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="worker-subview active" role="presentation">
|
||||
<a href="#worker-subview" aria-controls="worker-subview" role="tab" data-toggle="tab" data-url="/admin/worker-manager/subview">
|
||||
{{ "Subview" | trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="worker-metadata" role="presentation">
|
||||
<a href="#worker-metadata" aria-controls="worker-metadata" role="tab" data-toggle="tab" data-url="/admin/worker-manager/metadata">
|
||||
{{ "Metadata" | trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="worker-configuration" role="presentation">
|
||||
<a href="#worker-configuration" aria-controls="worker-configuration" role="tab" data-toggle="tab" data-url="/admin/worker-manager/configuration">
|
||||
{{ "Configuration" | trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="worker-searchengine" role="presentation">
|
||||
<a href="#worker-searchengine" aria-controls="worker-searchengine" role="tab" data-toggle="tab" data-url="/admin/worker-manager/searchengine">
|
||||
{{ "Searchengine" | trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="worker-pull-assets" role="presentation">
|
||||
<a href="#worker-pull-assets" aria-controls="worker-pull-assets" role="tab" data-toggle="tab" data-url="/admin/worker-manager/pull-assets">
|
||||
{{ "Pull Assets" | trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="worker-subview active" role="presentation">
|
||||
<a href="#worker-subview" aria-controls="worker-subview" role="tab" data-toggle="tab" data-url="/admin/worker-manager/subview">
|
||||
{{ "Subview" | trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="worker-metadata" role="presentation">
|
||||
<a href="#worker-metadata" aria-controls="worker-metadata" role="tab" data-toggle="tab" data-url="/admin/worker-manager/metadata">
|
||||
{{ "Metadata" | trans }}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<!-- Tab panes -->
|
||||
<div class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane fade" id="worker-configuration"></div>
|
||||
<div role="tabpanel" class="tab-pane fade" id="worker-searchengine"></div>
|
||||
<div role="tabpanel" class="tab-pane fade" id="worker-pull-assets"></div>
|
||||
<div role="tabpanel" class="tab-pane fade in active" id="worker-subview"></div>
|
||||
<div role="tabpanel" class="tab-pane fade" id="worker-metadata"></div>
|
||||
<!-- Tab panes -->
|
||||
<div class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane fade" id="worker-configuration"></div>
|
||||
<div role="tabpanel" class="tab-pane fade" id="worker-searchengine"></div>
|
||||
<div role="tabpanel" class="tab-pane fade" id="worker-pull-assets"></div>
|
||||
<div role="tabpanel" class="tab-pane fade in active" id="worker-subview"></div>
|
||||
<div role="tabpanel" class="tab-pane fade" id="worker-metadata"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var contentsDownloaded = {};
|
||||
var remoteContent = function(url) {
|
||||
return $.get(url);
|
||||
};
|
||||
<script type="text/javascript">
|
||||
var contentsDownloaded = {};
|
||||
var remoteContent = function(url) {
|
||||
return $.get(url);
|
||||
};
|
||||
|
||||
var tabs = $('#configurationTabs a[data-toggle="tab"]');
|
||||
var tabs = $('#configurationTabs a[data-toggle="tab"]');
|
||||
|
||||
tabs.on('click', function(){
|
||||
$(this).tab('show');
|
||||
});
|
||||
tabs.on('click', function(){
|
||||
$(this).tab('show');
|
||||
});
|
||||
|
||||
$('.nav-tabs li').on('show.bs.tab', function (e) {
|
||||
if (contentsDownloaded[e.target.hash] === undefined) {
|
||||
$(e.target.hash).empty().html('<img src="/assets/common/images/icons/main-loader.gif" alt="loading"/>');
|
||||
}
|
||||
});
|
||||
$('.nav-tabs li').on('show.bs.tab', function (e) {
|
||||
if (contentsDownloaded[e.target.hash] === undefined) {
|
||||
$(e.target.hash).empty().html('<img src="/assets/common/images/icons/main-loader.gif" alt="loading"/>');
|
||||
}
|
||||
});
|
||||
|
||||
$('.nav-tabs').on('shown.bs.tab', function (e) {
|
||||
$('.nav-tabs').on('shown.bs.tab', function (e) {
|
||||
|
||||
if (contentsDownloaded[e.target.hash] === undefined) {
|
||||
var targetDiv = $(e.target.hash);
|
||||
|
||||
remoteContent($(e.target).attr('data-url')).then(function(response) {
|
||||
targetDiv.empty().html(response);
|
||||
contentsDownloaded[e.target.hash] = true;
|
||||
}, function(error) {
|
||||
console.log(error);
|
||||
targetDiv.empty().html('<i class="icon-fire">{{ 'admin:worker Retrieve configuration error'|trans }}</i>');
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% else %}
|
||||
<h1 class="alert alert-danger">
|
||||
Error! Check rabbit config to use worker.
|
||||
</h1>
|
||||
{% endif %}
|
||||
|
||||
if (contentsDownloaded[e.target.hash] === undefined) {
|
||||
var targetDiv = $(e.target.hash);
|
||||
|
||||
remoteContent($(e.target).attr('data-url')).then(function(response) {
|
||||
targetDiv.empty().html(response);
|
||||
contentsDownloaded[e.target.hash] = true;
|
||||
}, function(error) {
|
||||
console.log(error);
|
||||
targetDiv.empty().html('<i class="icon-fire">{{ 'admin:worker Retrieve configuration error'|trans }}</i>');
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
@@ -1,6 +1,10 @@
|
||||
<h3> Config Worker queue retry</h3>
|
||||
<p class="alert alert-danger">
|
||||
<strong>Warning!</strong>
|
||||
When applied, it's re-initialize and purge "retry" and "delayed" queue!
|
||||
</p>
|
||||
|
||||
<p>Set up the delay between two attempts per queue!</p>
|
||||
<p>Set up the delay between two attempts per queue! (if not set, default 10000 millisecond)</p>
|
||||
{{ form_start(form, {'action': path('worker_admin_configuration')}) }}
|
||||
|
||||
<div class="control-group">
|
||||
@@ -31,8 +35,20 @@
|
||||
{{ form_row(form.populateIndex) }}
|
||||
</div>
|
||||
|
||||
<h3> Config Worker queue delayed</h3>
|
||||
<p>if not set ,default 5000 millisecond</p>
|
||||
|
||||
<div class="control-group">
|
||||
<input type="submit" class="btn btn-primary" value={{ "Apply retry delay"|trans }} />
|
||||
{{ form_row(form.delayedSubdef) }}
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
{{ form_row(form.delayedWriteMeta) }}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="control-group">
|
||||
<input type="submit" class="btn btn-primary" value={{ "Apply in queue"|trans }} />
|
||||
</div>
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user