Permalink
Browse files

Update scheduler plugin

  • Loading branch information...
1 parent e42bbf2 commit f4a6fde298667312fd0ebf8c20e1ae5a60b9a40a @cdujeu cdujeu committed Jul 20, 2016
@@ -58,4 +58,6 @@
"22" => "Aufgabenplanung, um bestimmte Aufgaben regelmäßig zu starten. Benötigt die PHP-Kommandozeile und Crontab oder ein ähnliches System.",
"23" => "Grundeinstellungen",
"24" => "Parameter",
+ "25" => "Stop Job",
+ "26" => "Stop running job",
);
@@ -58,4 +58,6 @@
"22" => "Generic scheduler to perform tasks on a regular basis. Requires CLI activation and a CRONTAB or similar system.",
"23" => "Execution Context",
"24" => "Parameters",
+ "25" => "Stop Job",
+ "26" => "Stop running job",
);
@@ -57,4 +57,6 @@
"22" => "Planificateur permettant l'exécution récurrente de tâches. Nécessite l'activation de la ligne de commande et un système type CRONTAB.",
"23" => "Execution Context",
"24" => "Parameters",
+ "25" => "Stop Job",
+ "26" => "Stop running job",
);
@@ -58,4 +58,6 @@
"22" => "Schedulatore generico per eseguire azioni su basi regolari. Richiede l'attivazione della CLI e del CRONTAB (o equivalente).",
"23" => "Execution Context",
"24" => "Parameters",
+ "25" => "Stop Job",
+ "26" => "Stop running job",
);
@@ -58,4 +58,6 @@
"22" => "Agendamento Genérico para correr tarefas de forma regular. Requer a activação de CLI e de uma Tabela Cronológica ou de um sistema semelhante.",
"23" => "Execution Context",
"24" => "Parameters",
+ "25" => "Stop Job",
+ "26" => "Stop running job",
);
@@ -4,19 +4,9 @@
<resources>
<i18n namespace="action.scheduler" path="plugins/action.scheduler/i18n"/>
<img_library alias="scheduler" path="plugins/action.scheduler/icons"/>
- <js className="Scheduler" file="plugins/action.scheduler/build/Scheduler.js" depends="React"/>
</resources>
</client_settings>
<registry_contributions>
- <client_configs>
- <template element="ajxp_desktop" name="scheduler_style" position="after"><![CDATA[
- <style>
- .scheduler-list .mui-toolbar-group.mui-left {
- width: 88% !important;
- }
- </style>
- ]]></template>
- </client_configs>
<actions>
<action name="scheduler_menu">
<gui text="action.scheduler.18" iconClass="icon-time" title="action.scheduler.18d" src="scheduler/ICON_SIZE/player_time.png" hasAccessKey="false">
@@ -263,7 +253,7 @@
<context selection="true" dir="" recycle="hidden" allowedMimes="scheduler_zone"
actionBar="true" contextMenu="true" infoPanel="true"
actionBarGroup="get"/>
- <selectionContext dir="false" file="true" behaviour="hidden" recycle="false" unique="true" allowedMimes="scheduler_task"/>
+ <selectionContext dir="false" file="true" behaviour="hidden" recycle="false" unique="true" allowedMimes="scheduler_task,scheduler_error_task"/>
</gui>
<processing>
<clientCallback><![CDATA[
@@ -286,6 +276,27 @@
</serverCallback>
</processing>
</action>
+ <action name="scheduler_stopRunningTask">
+ <gui text="action.scheduler.25" title="action.scheduler.26" iconClass="icon-stop" src="scheduler/ICON_SIZE/task.png" hasAccessKey="false">
+ <context selection="true" dir="" recycle="hidden" allowedMimes="scheduler_zone"
+ actionBar="true" contextMenu="true" infoPanel="true"
+ actionBarGroup="get"/>
+ <selectionContext dir="false" file="true" behaviour="hidden" recycle="false" unique="true" allowedMimes="scheduler_running_task"/>
+ </gui>
+ <processing>
+ <clientCallback><![CDATA[
+ var userSelection;
+ if(window.actionArguments && window.actionArguments.length){
+ userSelection = window.actionArguments[0];
+ }else{
+ userSelection = pydio.getUserSelection();
+ }
+ var taskId = userSelection.getUniqueNode().getMetadata().get("task_id");
+ var task = new PydioTasks.Task({id:taskId});
+ task.stop();
+ ]]></clientCallback>
+ </processing>
+ </action>
<action name="scheduler_fakeLongTask">
<processing>
<serverCallback methodName="fakeLongTask" developerComment="Launch a fake long task."/>
@@ -494,11 +494,12 @@ public function listTasks($httpVars, $rootPath, $relativePath, $paginationHash =
protected function taskToNode(Task $task, $basePath, $dateFormat, $isChild = false){
if($isChild){
- $label = ($task->getStatus() === Task::STATUS_FAILED ? " --- ERROR" : " --- JOB RUNNING");
+ $label = ($task->getStatus() === Task::STATUS_FAILED ? "JOB ERROR" : "JOB RUNNING");
+ $mime = ($task->getStatus() === Task::STATUS_FAILED ? "scheduler_error_task" : "scheduler_running_task");
$meta = [
"task_id" => $task->getId(),
"icon" => "scheduler/ICON_SIZE/task.png",
- "ajxp_mime" => "scheduler_task", // TODO: introduce a different mime for jobs?
+ "ajxp_mime" => $mime,
"text" => $label,
"label" => $label,
"schedule" => $task->getStatusMessage(),

0 comments on commit f4a6fde

Please sign in to comment.