mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-16 05:48:47 +02:00
poc form SDK (symfony 6)
This commit is contained in:
@@ -514,4 +514,9 @@ class ExecutionKPI
|
||||
{
|
||||
return self::$m_aExecData;
|
||||
}
|
||||
|
||||
static public function getStats()
|
||||
{
|
||||
return self::$m_aStats;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,13 +27,19 @@ class OQLCollector extends AbstractDataCollector
|
||||
public function collect(Request $request, Response $response, \Throwable $exception = null)
|
||||
{
|
||||
$this->data = [
|
||||
'execution' => ExecutionKPI::getExecData()
|
||||
'exec_data' => ExecutionKPI::getExecData(),
|
||||
'stats' => ExecutionKPI::getStats()
|
||||
];
|
||||
}
|
||||
|
||||
public function getRequests()
|
||||
public function getExecData()
|
||||
{
|
||||
return $this->data['execution'];
|
||||
return $this->data['exec_data'];
|
||||
}
|
||||
|
||||
public function getStats()
|
||||
{
|
||||
return $this->data['stats'];
|
||||
}
|
||||
|
||||
public static function getTemplate(): ?string
|
||||
|
||||
@@ -30,13 +30,29 @@
|
||||
{% block panel %}
|
||||
{# Optional, for showing the most details. #}
|
||||
<h2>iTop KPI</h2>
|
||||
|
||||
<h3>Exec data</h3>
|
||||
|
||||
<table>
|
||||
|
||||
{% for request in collector.requests %}
|
||||
{% for execData in collector.execData %}
|
||||
<tr>
|
||||
<td>{{ dump(request) }}</td>
|
||||
<td>{{ dump(execData) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</table>
|
||||
|
||||
<h3>Stats</h3>
|
||||
|
||||
<table>
|
||||
|
||||
{% for stats in collector.stats %}
|
||||
<tr>
|
||||
<td>{{ dump(stats) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</table>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user