Skip to content

Commit

Permalink
webui: use generic class as a timeline item
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergkemper committed Mar 9, 2023
1 parent d616937 commit 8a35be4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
14 changes: 12 additions & 2 deletions webui/module/Client/src/Client/Controller/ClientController.php
Expand Up @@ -437,8 +437,18 @@ public function getDataAction()
$endtime += 1000;
}

$item = '{"x":"' . $job['client'] . '","y":["' . $starttime . '","' . $endtime . '"],"fillColor":"' . $fillcolor . '","name":"' . $job['name'] . '","jobid":"' . $job['jobid'] . '","starttime":"' . $job['starttime'] . '","endtime":"' . $job['endtime'] . '","schedtime":"' . $job['schedtime'] . '","client":"' . $job['client'] . '"}';
array_push($jobs, json_decode($item));
$item = new \stdClass();
$item->x = $job["client"];
$item->y = array($starttime, $endtime);
$item->fillColor = $fillcolor;
$item->name = $job["name"];
$item->jobid = $job["jobid"];
$item->starttime = $job["starttime"];
$item->endtime = $job["endtime"];
$item->schedtime = $job["schedtime"];
$item->client = $job["client"];

array_push($jobs, $item);
}

$result = $jobs;
Expand Down
14 changes: 12 additions & 2 deletions webui/module/Job/src/Job/Controller/JobController.php
Expand Up @@ -789,8 +789,18 @@ public function getDataAction()
$endtime += 1000;
}

$item = '{"x":"' . $job['name'] . '","y":["' . $starttime . '","' . $endtime . '"],"fillColor":"' . $fillcolor . '","name":"' . $job['name'] . '","jobid":"' . $job['jobid'] . '","starttime":"' . $job['starttime'] . '","endtime":"' . $job['endtime'] . '","schedtime":"' . $job['schedtime'] . '","client":"' . $job['client'] . '"}';
array_push($jobs, json_decode($item));
$item = new \stdClass();
$item->x = $job["client"];
$item->y = array($starttime, $endtime);
$item->fillColor = $fillcolor;
$item->name = $job["name"];
$item->jobid = $job["jobid"];
$item->starttime = $job["starttime"];
$item->endtime = $job["endtime"];
$item->schedtime = $job["schedtime"];
$item->client = $job["client"];

array_push($jobs, $item);
}

$result = $jobs;
Expand Down

0 comments on commit 8a35be4

Please sign in to comment.