Исходный код вики Job Progress Macro
Скрыть последних авторов
| author | version | line-number | content |
|---|---|---|---|
| |
1.1 | 1 | {{template name="job_macros.vm"/}} |
| 2 | |||
| 3 | {{velocity output="false"}} | ||
| 4 | #macro(jobMessage $jobStatus) | ||
| 5 | #set($finished = $jobStatus.state.name() == 'FINISHED') | ||
| 6 | #if ($finished) | ||
| 7 | #if ($jobStatus.log.getLogs('ERROR').isEmpty()) | ||
| 8 | <div class="box successmessage"> | ||
| 9 | $services.localization.render('jobmacro.log.message.success') | ||
| 10 | </div> | ||
| 11 | #else | ||
| 12 | <div class="box errormessage"> | ||
| 13 | $services.localization.render('jobmacro.log.message.errors') | ||
| 14 | </div> | ||
| 15 | #end | ||
| 16 | #end | ||
| 17 | #end | ||
| 18 | {{/velocity}} | ||
| 19 | |||
| 20 | {{velocity wiki="false"}} | ||
| 21 | #if ($xcontext.action == 'get') | ||
| 22 | #set($jobStatus = $services.job.getJobStatus($request.jobid.split('/'))) | ||
| 23 | #getJobStatusJSON($jobStatus $json) | ||
| 24 | #set ($json.message = "#jobMessage($jobStatus)") | ||
| 25 | $response.setContentType('application/json') | ||
| 26 | $jsontool.serialize($json) | ||
| 27 | #end | ||
| 28 | {{/velocity}} | ||
| 29 | |||
| 30 | {{velocity}} | ||
| 31 | #if ($xcontext.action != 'get') | ||
| 32 | {{info}}This is a helper macro for displaying log progress used by the Job Macro.{{/info}} | ||
| 33 | #end | ||
| 34 | {{/velocity}} | ||
| 35 |