Skip to content

Commit

Permalink
DashboardFactory: Added sharedCrosshair option
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Meggle committed Oct 18, 2017
1 parent f66f11f commit 8787ca2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion histou/grafana/dashboard/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ abstract class Dashboard
@param string $title name of the dashboard.
@return null
**/
public function __construct($title)
public function __construct($title, $sharedCrosshair)
{
$this->data['title'] = $title;
$this->data['sharedCrosshair'] = $sharedCrosshair;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions histou/grafana/dashboard/dashboardelasticsearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class DashboardElasticsearch extends Dashboard
@param string $title name of the dashboard.
@return null
**/
public function __construct($title)
public function __construct($title, $sharedCrosshair)
{
parent::__construct($title);
parent::__construct($title,$sharedCrosshair);
}

public function addAnnotation($name, $query, $title, $text, $tags, $iconColor = '#751975', $lineColor = '#751975', $datasource = ELASTICSEARCH_INDEX, $enabled = SHOW_ANNOTATION, $iconSize = 13)
Expand Down
8 changes: 4 additions & 4 deletions histou/grafana/dashboard/dashboardfactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ class DashboardFactory
Returns depending on the Database_Type a dashboard.
@returns a dashboard
**/
public static function generateDashboard($title)
public static function generateDashboard($title, $sharedCrosshair=false)
{
if (DATABASE_TYPE == INFLUXDB) {
return new \histou\grafana\dashboard\DashboardInfluxDB($title);
return new \histou\grafana\dashboard\DashboardInfluxDB($title, $sharedCrosshair);
} elseif (DATABASE_TYPE == ELASTICSEARCH) {
return new \histou\grafana\dashboard\DashboardElasticsearch($title);
return new \histou\grafana\dashboard\DashboardElasticsearch($title, $sharedCrosshair);
} else {
throw new \InvalidArgumentException("The given Database is unkown:".DATABASE_TYPE);
}
}
}
}
4 changes: 2 additions & 2 deletions histou/grafana/dashboard/dashboardinfluxdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class DashboardInfluxDB extends Dashboard
@param string $title name of the dashboard.
@return null
**/
public function __construct($title)
public function __construct($title, $sharedCrosshair)
{
parent::__construct($title);
parent::__construct($title,$sharedCrosshair);
}

public function addAnnotation($name, $query, $title, $text, $tags, $iconColor = '#751975', $lineColor = '#751975', $datasource = INFLUXDB_DB, $enabled = SHOW_ANNOTATION, $iconSize = 13)
Expand Down

0 comments on commit 8787ca2

Please sign in to comment.