diff --git a/src/Repository/Job.php b/src/Repository/Job.php index b6ae084..3f2c7c7 100644 --- a/src/Repository/Job.php +++ b/src/Repository/Job.php @@ -14,12 +14,16 @@ class Job extends Repository { public function getAllJobs() { - $jobsSql = "SELECT * FROM job"; + $jobsSql = "SELECT * FROM job ORDER by name"; $jobsStmt = $this->dbcon->prepare($jobsSql); $jobsRslt = $jobsStmt->executeQuery(); $jobs = $jobsRslt->fetchAllAssociative(); foreach ($jobs as $key=>&$job) { $job['data'] = json_decode($job['data'], true); + $job['host-displayname'] = $job['data']['host']; + if(!empty($job['data']['containertype']) && $job['data']['containertype'] != 'none') { + $job['host-displayname'] = $job['data']['service'] . ' on ' . $job['data']['host']; + } } return $jobs; } @@ -332,7 +336,7 @@ class Job extends Repository switch($values['data']['containertype']) { default: - if($values['data']['crontype'] == 'http') break; + if($values['data']['crontype'] == 'http' || $values['data']['crontype'] == 'reboot' ) break; $values['data']['containertype'] = 'none'; case 'none': // No options for no container diff --git a/templates/job/index.html.twig b/templates/job/index.html.twig index 9427eb8..267b1d0 100644 --- a/templates/job/index.html.twig +++ b/templates/job/index.html.twig @@ -17,7 +17,7 @@ {% for job in jobs %} {{ job.name }} - {{ job.data.host }} + {{ attribute(job, 'host-displayname') }} {{ job.interval | interval }} {{ job.nextrun | date("d/m/Y H:i:s") }}