-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inital work on SQL metric/annotation data source, #1542
- Loading branch information
Showing
9 changed files
with
136 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
define([ | ||
'angular', | ||
'lodash', | ||
'kbn', | ||
], | ||
function (angular) { | ||
'use strict'; | ||
|
||
var module = angular.module('grafana.services'); | ||
|
||
module.factory('SqlDatasource', function() { | ||
|
||
function SqlDatasource() { | ||
} | ||
|
||
return SqlDatasource; | ||
|
||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<h2>SQL Options</h2> | ||
|
||
<div class="tight-form"> | ||
<ul class="tight-form-list"> | ||
<li class="tight-form-item" style="width: 80px"> | ||
DB Type | ||
</li> | ||
<li> | ||
<select class="input-medium tight-form-input" ng-model="current.jsonData.dbType" ng-options="f for f in ['sqlite3','mysql','postgres']"></select> | ||
</li> | ||
<li class="tight-form-item" style="width: 80px"> | ||
Host | ||
</li> | ||
<li> | ||
<input type="text" class="tight-form-input input-medium" ng-model='current.jsonData.host' placeholder="localhost:3306"> | ||
</li> | ||
<li class="tight-form-item" ng-if="current.jsonData.dbType === 'postgres'"> | ||
SSL | ||
<input class="cr1" id="jsonData.ssl" type="checkbox" ng-model="current.jsonData.ssl" ng-checked="current.jsonData.ssl"> | ||
<label for="jsonData.ssl" class="cr1"></label> | ||
</li> | ||
</ul> | ||
<div class="clearfix"></div> | ||
</div> | ||
<div class="tight-form"> | ||
<ul class="tight-form-list"> | ||
<li class="tight-form-item" style="width: 80px"> | ||
Database | ||
</li> | ||
<li> | ||
<input type="text" class="tight-form-input input-medium" ng-model='current.database' placeholder=""> | ||
</li> | ||
</ul> | ||
<div class="clearfix"></div> | ||
</div> | ||
<div class="tight-form"> | ||
<ul class="tight-form-list"> | ||
<li class="tight-form-item" style="width: 80px"> | ||
User | ||
</li> | ||
<li> | ||
<input type="text" class="tight-form-input input-medium" ng-model='current.user' placeholder=""> | ||
</li> | ||
<li class="tight-form-item" style="width: 80px"> | ||
Password | ||
</li> | ||
<li> | ||
<input type="password" class="tight-form-input input-medium" ng-model='current.password' placeholder=""> | ||
</li> | ||
</ul> | ||
<div class="clearfix"></div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
<div class="fluid-row" style="margin-top: 20px"> | ||
<div class="span2"></div> | ||
<div class="grafana-info-box span8"> | ||
<h5>Test graph</h5> | ||
|
||
<p> | ||
This is just a test data source that generates random walk series. If this is your only data source | ||
open the left side menu and navigate to the data sources admin screen and add your data sources. You can change | ||
data source using the button to the left of the <strong>Add query</strong> button. | ||
</p> | ||
</div> | ||
<div class="span2"></div> | ||
|
||
<div class="clearfix"></div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"pluginType": "datasource", | ||
"name": "Generic SQL (prototype)", | ||
|
||
"type": "generic_sql", | ||
"serviceName": "SqlDatasource", | ||
|
||
"module": "plugins/datasource/sql/datasource", | ||
|
||
"partials": { | ||
"config": "app/plugins/datasource/sql/partials/config.html", | ||
"query": "app/plugins/datasource/sql/partials/query.editor.html" | ||
}, | ||
|
||
"metrics": true | ||
} |