mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
- restore task interfaces
- remove task "phraseanet-indexer" todo : task "recordmover"
This commit is contained in:
@@ -1 +0,0 @@
|
||||
{% extends 'admin/task-manager/task-editor/task.html.twig' %}
|
@@ -1,162 +0,0 @@
|
||||
{% extends 'admin/task-manager/task-editor/task.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ 'MySQL Host' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="host" value="">
|
||||
</div>
|
||||
<label class="control-label">{{ 'MySQL Port' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="port" value="">
|
||||
</div>
|
||||
<label class="control-label">{{ 'MySQL Database' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="base" value="">
|
||||
</div>
|
||||
<label class="control-label">{{ 'MySQL Login' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="user" value="">
|
||||
</div>
|
||||
<label class="control-label">{{ 'MySQL password' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="password" name="password" value="">
|
||||
</div>
|
||||
<label class="control-label">{{ 'MySQL connection charset' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="charset" class="input-small" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ 'Socket port' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="socket" class="input-small" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ 'Debug binary mask' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="debugmask" class="input-small" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ 'Default language for thesaurus candidates' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="clng" class="input-small" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ 'Enable stemming languages' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="stem" class="input-small" value="">
|
||||
<span class="help-inline">{{ 'example : fr,en' | trans }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ 'Sort records with an empty field' | trans }}</label>
|
||||
<div class="controls">
|
||||
<select name="sortempty">
|
||||
<option value="">{{ 'Hide records' | trans }}</option>
|
||||
<option value="A">{{ 'At the beginning' | trans }}</option>
|
||||
<option value="Z">{{ 'At the end' | trans }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="nolog">
|
||||
{{ 'Do not log, output to console' | trans }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="winsvc_run">
|
||||
{{ 'Run as application, not as service' | trans }}
|
||||
<span class="help-inline">({{ 'Windows specific' | trans }})</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<center>
|
||||
<div style="margin:10px; padding:5px; border:1px #000000 solid; font-family:monospace; font-size:14px; text-align:left; color:#00e000; background-color:#404040" id="cmd">cmd</div>
|
||||
</center>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block javascript %}
|
||||
function taskFillGraphic(xml)
|
||||
{
|
||||
if (xml) {
|
||||
xml = $.parseXML(xml);
|
||||
xml = $(xml);
|
||||
|
||||
var isyes = function(v) {
|
||||
v = v.toUpperCase().trim();
|
||||
|
||||
return v=='O' || v=='Y' || v=='OUI' || v=='YES' || v=='1';
|
||||
}
|
||||
|
||||
with(document.forms['graphicForm'])
|
||||
{
|
||||
host.value = xml.find("host").text();
|
||||
port.value = xml.find("port").text();
|
||||
base.value = xml.find("base").text();
|
||||
user.value = xml.find("user").text();
|
||||
socket.value = xml.find("socket").text();
|
||||
password.value = xml.find("password").text();
|
||||
clng.value = xml.find("clng").text();
|
||||
nolog.checked = isyes(xml.find("nolog").text());
|
||||
winsvc_run.checked = isyes(xml.find("winsvc_run").text());
|
||||
charset.value = xml.find("charset").text();
|
||||
stem.value = xml.find("stem").text();
|
||||
sortempty.value = xml.find("sortempty").text();
|
||||
debugmask.value = 0|xml.find("debugmask").text();
|
||||
}
|
||||
|
||||
|
||||
var cmd = '';
|
||||
with(document.forms['graphicForm'])
|
||||
{
|
||||
cmd += "/path/to/indexer";
|
||||
if(host.value)
|
||||
cmd += " -h=" + host.value;
|
||||
if(port.value)
|
||||
cmd += " -P=" + port.value;
|
||||
if(base.value)
|
||||
cmd += " -b=" + base.value;
|
||||
if(user.value)
|
||||
cmd += " -u=" + user.value;
|
||||
if(password.value)
|
||||
cmd += " -p=xxxxxx"; // + password.value;
|
||||
if(socket.value)
|
||||
cmd += " --socket=" + socket.value;
|
||||
if(charset.value)
|
||||
cmd += " --default-character-set=" + charset.value;
|
||||
|
||||
cmd += " -o";
|
||||
|
||||
if(nolog.checked)
|
||||
cmd += " -n";
|
||||
if(clng.value)
|
||||
cmd += " -c=" + clng.value;
|
||||
if(stem.value)
|
||||
cmd += " --stem=" + stem.value;
|
||||
if(sortempty.value)
|
||||
cmd += " --sort-empty=" + sortempty.value;
|
||||
if(debugmask.value)
|
||||
cmd += " -d=" + debugmask.value;
|
||||
if(winsvc_run.checked)
|
||||
cmd += " --run";
|
||||
}
|
||||
$('#cmd').html(cmd);
|
||||
}
|
||||
}
|
||||
$(document).ready(function(){
|
||||
$("#graphicForm *").change(function(){
|
||||
taskFillGraphic(null);
|
||||
});
|
||||
});
|
||||
{% endblock %}
|
@@ -1,6 +1,62 @@
|
||||
{% extends 'admin/task-manager/task-editor/task.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<div class="control-group">
|
||||
<label class="control-label"> {{ 'Databox' | trans }}</label>
|
||||
<div class="controls">
|
||||
<select name="sbas">
|
||||
<option value="">{{ 'All' | trans }}</option>
|
||||
{% for databox in app['phraseanet.appbox'].get_databoxes() %}
|
||||
<option value="{{ databox.get_sbas_id() }}">
|
||||
{{ databox.get_viewname() }}
|
||||
({{ databox.get_sbas_id() }})
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"> {{ 'recordtype' | trans }}</label>
|
||||
<div class="controls">
|
||||
<label class="checkbox inline">
|
||||
<input type="checkbox" name="type_image" value="image"> {{ 'image' | trans }}
|
||||
</label>
|
||||
<label class="checkbox inline">
|
||||
<input type="checkbox" name="type_video" value="video"> {{ 'video' | trans }}
|
||||
</label>
|
||||
<label class="checkbox inline">
|
||||
<input type="checkbox" name="type_audio" value="audio"> {{ 'audio' | trans }}
|
||||
</label>
|
||||
<label class="checkbox inline">
|
||||
<input type="checkbox" name="type_document" value="document"> {{ 'document' | trans }}
|
||||
</label>
|
||||
<label class="checkbox inline">
|
||||
<input type="checkbox" name="type_flash" value="flash"> {{ 'flash' | trans }}
|
||||
</label>
|
||||
<label class="checkbox inline">
|
||||
<input type="checkbox" name="type_unknown" value="unknown"> {{ 'unknown' | trans }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"> {{ 'Number of records to process per batch' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input class="formElem input-mini" type="text" name="flush" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ 'Restart the task every X records' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input class="formElem input-mini" type="text" name="maxrecs" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ 'Restart the task if memory reaches' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input class="formElem input-mini" type="text" name="maxmegs" value="">
|
||||
<span class="help-inline">Mo</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
@@ -13,6 +69,18 @@
|
||||
|
||||
|
||||
{% block javascript %}
|
||||
function minmax(v, _min, _max)
|
||||
{
|
||||
if(v == NaN || v < _min)
|
||||
{
|
||||
v = _min;
|
||||
}
|
||||
else if(v > _max)
|
||||
{
|
||||
v = _max;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
function taskFillGraphic(xml)
|
||||
{
|
||||
if (xml) {
|
||||
@@ -22,6 +90,26 @@
|
||||
with(document.forms['graphicForm'])
|
||||
{
|
||||
embedded.checked = !!parseInt(xml.find("embedded").text());
|
||||
type_image.checked = !!parseInt(xml.find("type_image").text());
|
||||
type_video.checked = !!parseInt(xml.find("type_video").text());
|
||||
type_audio.checked = !!parseInt(xml.find("type_audio").text());
|
||||
type_document.checked = !!parseInt(xml.find("type_document").text());
|
||||
type_flash.checked = !!parseInt(xml.find("type_flash").text());
|
||||
type_unknown.checked = !!parseInt(xml.find("type_unknown").text());
|
||||
flush.value = minmax(parseInt(xml.find("flush").text()), 1, 100);
|
||||
maxrecs.value = minmax(parseInt(xml.find("maxrecs").text()), 10, 100);
|
||||
maxmegs.value = minmax(parseInt(xml.find("maxmegs").text()), 64, 512);
|
||||
for(i in sbas.options)
|
||||
{
|
||||
if(sbas.options[i].value == parseInt(xml.find("sbas").text()) )
|
||||
{
|
||||
sbas.options[i].selected = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
sbas.options[i].selected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user