mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
parent
71f4b6960b
commit
0a5c2c5bd7
@ -80,6 +80,13 @@ class Query extends BaseQuery
|
|||||||
$this->baseQuery = $this->db->select();
|
$this->baseQuery = $this->db->select();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function __clone()
|
||||||
|
{
|
||||||
|
if ($this->baseQuery !== null) {
|
||||||
|
$this->baseQuery = clone $this->baseQuery;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the raw base query
|
* Return the raw base query
|
||||||
*
|
*
|
||||||
|
@ -9,10 +9,25 @@ use Icinga\Data\BaseQuery;
|
|||||||
|
|
||||||
class PivotTable
|
class PivotTable
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* The query to fetch as pivot table
|
||||||
|
*
|
||||||
|
* @var BaseQuery
|
||||||
|
*/
|
||||||
protected $query;
|
protected $query;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The column to use for the x axis
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
protected $xAxisColumn;
|
protected $xAxisColumn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The column to use for the y axis
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
protected $yAxisColumn;
|
protected $yAxisColumn;
|
||||||
|
|
||||||
protected $limit;
|
protected $limit;
|
||||||
@ -101,8 +116,8 @@ class PivotTable
|
|||||||
*/
|
*/
|
||||||
protected function fetchXAxis()
|
protected function fetchXAxis()
|
||||||
{
|
{
|
||||||
$queryClass = get_class($this->query);
|
$query = clone $this->query;
|
||||||
$query = new $queryClass($this->query->getDatasource(), array($this->xAxisColumn));
|
$query->setColumns(array($this->xAxisColumn));
|
||||||
return $query->fetchColumn();
|
return $query->fetchColumn();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,8 +126,8 @@ class PivotTable
|
|||||||
*/
|
*/
|
||||||
protected function fetchYAxis()
|
protected function fetchYAxis()
|
||||||
{
|
{
|
||||||
$queryClass = get_class($this->query);
|
$query = clone $this->query;
|
||||||
$query = new $queryClass($this->query->getDatasource(), array($this->yAxisColumn));
|
$query->setColumns(array($this->yAxisColumn));
|
||||||
return $query->fetchColumn();
|
return $query->fetchColumn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -476,9 +476,8 @@ class Monitoring_ListController extends Controller
|
|||||||
$this->setupFilterControl($dataview, 'servicematrix');
|
$this->setupFilterControl($dataview, 'servicematrix');
|
||||||
$this->setupSortControl(
|
$this->setupSortControl(
|
||||||
array(
|
array(
|
||||||
'service_state' => 'Service status',
|
'host_name' => 'Hostname',
|
||||||
'service_description' => 'Service description',
|
'service_description' => 'Service description'
|
||||||
'host_name' => 'Hostname'
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user