Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
1ecdf349
Commit
1ecdf349
authored
Mar 29, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sql: wip mysql stuff
parent
6965064e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
97 additions
and
0 deletions
+97
-0
public/app/plugins/datasource/mysql/README.md
+3
-0
public/app/plugins/datasource/mysql/datasource.ts
+43
-0
public/app/plugins/datasource/mysql/module.ts
+16
-0
public/app/plugins/datasource/mysql/partials/annotations.editor.html
+20
-0
public/app/plugins/datasource/mysql/partials/query.editor.html
+7
-0
public/app/plugins/datasource/mysql/plugin.json
+8
-0
No files found.
public/app/plugins/datasource/mysql/README.md
0 → 100644
View file @
1ecdf349
# Grafana Fake Data Datasource - Native Plugin
This is the built in Fake Data Datasource that is used before any datasources are set up in your Grafana installation. It means you can create a graph without any data and still get an idea of what it would look like.
public/app/plugins/datasource/mysql/datasource.ts
0 → 100644
View file @
1ecdf349
///<reference path="../../../headers/common.d.ts" />
import
_
from
'lodash'
;
export
class
MysqlDatasource
{
/** @ngInject */
constructor
(
private
instanceSettings
,
private
backendSrv
)
{
}
query
(
options
)
{
console
.
log
(
'test'
);
console
.
log
(
this
.
instanceSettings
);
return
this
.
backendSrv
.
post
(
'/api/tsdb/query'
,
{
from
:
options
.
range
.
from
.
valueOf
().
toString
(),
to
:
options
.
range
.
to
.
valueOf
().
toString
(),
queries
:
[
{
"refId"
:
"A"
,
"scenarioId"
:
"random_walk"
,
"intervalMs"
:
options
.
intervalMs
,
"maxDataPoints"
:
options
.
maxDataPoints
,
}
]
}).
then
(
res
=>
{
var
data
=
[];
if
(
res
.
results
)
{
_
.
forEach
(
res
.
results
,
queryRes
=>
{
for
(
let
series
of
queryRes
.
series
)
{
data
.
push
({
target
:
series
.
name
,
datapoints
:
series
.
points
});
}
});
}
return
{
data
:
data
};
});
}
}
public/app/plugins/datasource/mysql/module.ts
0 → 100644
View file @
1ecdf349
///<reference path="../../../headers/common.d.ts" />
import
angular
from
'angular'
;
import
{
MysqlDatasource
}
from
'./datasource'
;
import
{
QueryCtrl
}
from
'app/plugins/sdk'
;
class
MysqlQueryCtrl
extends
QueryCtrl
{
static
templateUrl
=
'partials/query.editor.html'
;
}
export
{
MysqlDatasource
,
MysqlDatasource
as
Datasource
,
MysqlQueryCtrl
as
QueryCtrl
,
};
public/app/plugins/datasource/mysql/partials/annotations.editor.html
0 → 100644
View file @
1ecdf349
<div
class=
"gf-form-group"
>
<h6>
Filters
</h6>
<div
class=
"gf-form-inline"
>
<div
class=
"gf-form"
>
<span
class=
"gf-form-label width-7"
>
Type
</span>
<div
class=
"gf-form-select-wrapper"
>
<select
class=
"gf-form-input"
ng-model=
"ctrl.annotation.type"
ng-options=
"f.value as f.text for f in [{text: 'Alert', value: 'alert'}]"
>
</select>
</div>
</div>
<div
class=
"gf-form"
>
<span
class=
"gf-form-label width-7"
>
Max limit
</span>
<div
class=
"gf-form-select-wrapper"
>
<select
class=
"gf-form-input"
ng-model=
"ctrl.annotation.limit"
ng-options=
"f for f in [10,50,100,200,300,500,1000,2000]"
>
</select>
</div>
</div>
</div>
</div>
public/app/plugins/datasource/mysql/partials/query.editor.html
0 → 100644
View file @
1ecdf349
<query-editor-row
query-ctrl=
"ctrl"
can-collapse=
"false"
>
<div
class=
"gf-form-inline"
>
<div
class=
"gf-form"
>
<label
class=
"gf-form-label"
>
Test metric (fake data source)
</label>
</div>
</div>
</query-editor-row>
public/app/plugins/datasource/mysql/plugin.json
0 → 100644
View file @
1ecdf349
{
"type"
:
"datasource"
,
"name"
:
"MySQL"
,
"id"
:
"mysql"
,
"annotations"
:
true
,
"metrics"
:
true
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment