File tree Expand file tree Collapse file tree
views/themes/admin/ezdataflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,6 +55,26 @@ public function displayDetails(int $id): Response
5555 ]);
5656 }
5757
58+ /**
59+ * @Route("/details/log/{id}", name="coderhapsodie.ezdataflow.job.log")
60+ *
61+ * @param int $id
62+ *
63+ * @return Response
64+ */
65+ public function displayLog (int $ id ): Response
66+ {
67+ $ this ->denyAccessUnlessGranted (new Attribute ('ezdataflow ' , 'view ' ));
68+ $ item = $ this ->jobGateway ->find ($ id );
69+ $ log = array_map (function ($ line ) {
70+ return preg_replace ('~#\d+~ ' , "\n$0 " , $ line );
71+ }, $ item ->getExceptions ());
72+
73+ return $ this ->render ('@ezdesign/ezdataflow/Item/log.html.twig ' , [
74+ 'log ' => $ log ,
75+ ]);
76+ }
77+
5878 /**
5979 * @Route("/create", name="coderhapsodie.ezdataflow.job.create", methods={"POST"})
6080 *
Original file line number Diff line number Diff line change @@ -36,16 +36,18 @@ coderhapsodie.ezdataflow.history.details.request: 'Requested on'
3636coderhapsodie.ezdataflow.history.details.status : Status
3737coderhapsodie.ezdataflow.history.details.start : ' Started on'
3838coderhapsodie.ezdataflow.history.details.end : ' Finished on'
39- coderhapsodie.ezdataflow.history.details.count : ' Items count '
39+ coderhapsodie.ezdataflow.history.details.count : ' Items successfully processed '
4040coderhapsodie.ezdataflow.history.details.options : ' Run options'
4141coderhapsodie.ezdataflow.history.details.errors : Errors
4242coderhapsodie.ezdataflow.history.details.type : ' Name of the dataflow executed'
43+ coderhapsodie.ezdataflow.history.details.log : ' View log'
4344coderhapsodie.ezdataflow.workflow.repeating.new.title : ' Add a new repeating dataflow'
4445coderhapsodie.ezdataflow.workflow.new.cancel : Cancel
4546coderhapsodie.ezdataflow.workflow.new.submit : Create
4647coderhapsodie.ezdataflow.history.list.empty : ' No execution yet.'
4748coderhapsodie.ezdataflow.workflow.list.empty : ' No repeating workflow configured yet'
4849coderhapsodie.ezdataflow.workflow.history.title : ' Execution history'
50+ coderhapsodie.ezdataflow.workflow.log.title : ' Execution log'
4951coderhapsodie.ezdataflow.workflow.list.delete : Delete
5052coderhapsodie.ezdataflow.workflow.delete : ' Are you sure you want to delete this dataflow schedule?'
5153coderhapsodie.ezdataflow.workflow.create.success : ' Dataflow schedule successfully added.'
Original file line number Diff line number Diff line change @@ -40,12 +40,14 @@ coderhapsodie.ezdataflow.history.details.count: 'Nombre d''objets mis à jour'
4040coderhapsodie.ezdataflow.history.details.options : ' Options de lancement'
4141coderhapsodie.ezdataflow.history.details.errors : Erreurs
4242coderhapsodie.ezdataflow.history.details.type : ' Nom du dataflow exécuté'
43+ coderhapsodie.ezdataflow.history.details.log : ' Voir le log'
4344coderhapsodie.ezdataflow.workflow.repeating.new.title : ' Nouvel programmation d'' un dataflow récurrent'
4445coderhapsodie.ezdataflow.workflow.new.cancel : Annuler
4546coderhapsodie.ezdataflow.workflow.new.submit : Créer
4647coderhapsodie.ezdataflow.history.list.empty : ' Aucune exécution pour le moment.'
4748coderhapsodie.ezdataflow.workflow.list.empty : ' Aucun dataflow n'' a été programmé.'
4849coderhapsodie.ezdataflow.workflow.history.title : ' Historique des exécutions'
50+ coderhapsodie.ezdataflow.workflow.log.title : ' Log de l'' exécution'
4951coderhapsodie.ezdataflow.workflow.list.delete : Supprimer
5052coderhapsodie.ezdataflow.workflow.delete : ' Êtes-vous sûr de vouloir supprimer ce dataflow ?'
5153coderhapsodie.ezdataflow.workflow.create.success : ' La programmation du dataflow a bien été ajoutée.'
Original file line number Diff line number Diff line change 4242 $ (' .history-details-aware' ).delegate (' .modal-history-details' , ' click' , function (e ) {
4343 e .preventDefault ();
4444 $ (' #modal_content-details' ).html (' ' );
45+ $ (' #ez-modal--history-details h3' ).html (" {{ 'coderhapsodie.ezdataflow.workflow.history.title'|trans }}" );
46+ if ($ (this ).hasClass (' modal-history-log' )) {
47+ $ (' #ez-modal--history-details h3' ).html (" {{ 'coderhapsodie.ezdataflow.workflow.log.title'|trans }}" );
48+ }
4549 $ (' #ez-modal--history-details' ).modal (' show' );
4650 $ .ajax (this .href , {
4751 success : function (result ) {
Original file line number Diff line number Diff line change 11{% import ' @ezdesign/ezdataflow/macros.twig' as macros %}
22
33{% block content %}
4-
5- <div class =" container ez-main-container" >
4+ <div class =" container ez-main-container history-details-aware" >
65 {% if item is not null %}
76 <h2 >{{ ' coderhapsodie.ezdataflow.history.job.title' | trans }} n°{{ item .id }}</h2 >
87
Original file line number Diff line number Diff line change 1+ {% for line in log %}
2+ <p >{{ line | nl2br }}</p >
3+ {% endfor %}
Original file line number Diff line number Diff line change 4141 xlink:href =" /bundles/ezplatformadminui/img/ez-icons.svg#about-info" ></use >
4242 </svg >
4343 </a >
44+ <a href =" {{ path(' coderhapsodie.ezdataflow.job.log' , {id : job .id }) }}"
45+ class =" btn btn-icon mx-2 modal-history-details modal-history-log"
46+ title =" {{ ' coderhapsodie.ezdataflow.history.details.log' | trans }}" >
47+ <svg class =" ez-icon ez-icon--small-medium" >
48+ <use xmlns:xlink =" http://www.w3.org/1999/xlink"
49+ xlink:href =" /bundles/ezplatformadminui/img/ez-icons.svg#article" ></use >
50+ </svg >
51+ </a >
4452 </td >
4553 </tr >
4654 {% endfor %}
You can’t perform that action at this time.
0 commit comments