Skip to content
Snippets Groups Projects
Commit ebdfbe6a authored by Georgi's avatar Georgi
Browse files

added a function to the MarkController for the heatchart blade

parent ae8d113c
No related branches found
No related tags found
No related merge requests found
......@@ -99,18 +99,6 @@ class MarkController extends Controller
;
}
public function timeline()
{
//get the timeline data
$default_period = 3600;
$data = $this->timelineData($default_period);
return view(
"app.timeline",
$data
);
}
public function pause()
{
$this->server()->pause();
......@@ -184,6 +172,51 @@ class MarkController extends Controller
return view('app.radar', ["label" => $label]);
}
public function timeline()
{
//get the timeline data
$default_period = 3600;
$data = $this->timelineData($default_period);
return view(
"app.timeline",
$data
);
}
public function heatchart(string $label)
{
//get the data for the corresponding detector label
$data = $this->server()->findEvidence($label);
foreach ($data as $evidence) {
$references = $evidence->references;
$temp = [];
foreach ($references as $key => $value) {
$ref_evidence = $this->server()->findEvidenceById($value);;
array_push($temp, $ref_evidence);
}
$evidence->references = $temp;
};
//get the detectors
$detectors = [];
$detector_profiles = $this->server()->activation();
// detectors
foreach ($detector_profiles as $detector) {
//$evidences = $this->rankingJSON($detector->label);
// add the name of the agents and the evidences linked to it
$detectors[] = ["name" => $detector->label];
}
return view(
"app.heatchart",
["data" => $data,
"detectors" => $detectors,
"label" => $label]
);
}
public function rankingCSV(string $label)
{
$evidences = $this->server()->findEvidence($label);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment