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
eb6099a9
Commit
eb6099a9
authored
Aug 07, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Began work on pro modification
parent
02fb2baf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
3 deletions
+52
-3
src/app/components/require.config.js
+1
-1
src/app/services/datasourceSrv.js
+3
-2
src/app/services/grafana/grafanaDatasource.js
+48
-0
No files found.
src/app/components/require.config.js
View file @
eb6099a9
...
...
@@ -2,7 +2,7 @@
* Bootstrap require with the needed config, then load the app.js module.
*/
require
.
config
({
baseUrl
:
'app'
,
baseUrl
:
'
public/
app'
,
paths
:
{
config
:
[
'../config'
,
'../config.sample'
],
...
...
src/app/services/datasourceSrv.js
View file @
eb6099a9
...
...
@@ -3,6 +3,7 @@ define([
'lodash'
,
'config'
,
'./graphite/graphiteDatasource'
,
'./grafana/grafanaDatasource'
,
'./influxdb/influxdbDatasource'
,
'./opentsdb/opentsdbDatasource'
,
'./elasticsearch/es-datasource'
,
...
...
@@ -64,8 +65,8 @@ function (angular, _, config) {
case
'opentsdb'
:
Datasource
=
$injector
.
get
(
'OpenTSDBDatasource'
);
break
;
case
'
elasticsearch
'
:
Datasource
=
$injector
.
get
(
'
Elastic
Datasource'
);
case
'
grafana
'
:
Datasource
=
$injector
.
get
(
'
Grafana
Datasource'
);
break
;
}
return
new
Datasource
(
ds
);
...
...
src/app/services/grafana/grafanaDatasource.js
0 → 100644
View file @
eb6099a9
define
([
'angular'
,
'lodash'
,
'jquery'
,
'config'
,
'kbn'
,
'moment'
],
function
(
angular
,
_
,
$
,
config
,
kbn
,
moment
)
{
'use strict'
;
var
module
=
angular
.
module
(
'grafana.services'
);
module
.
factory
(
'GrafanaDatasource'
,
function
(
$q
,
$http
)
{
function
GrafanaDatasource
(
datasource
)
{
this
.
type
=
'grafana'
;
this
.
grafanaDB
=
true
;
}
GrafanaDatasource
.
prototype
.
getDashboard
=
function
(
id
,
isTemp
)
{
var
url
=
'/dashboard/'
+
id
;
if
(
isTemp
)
{
url
=
'/temp/'
+
id
;
}
return
$http
.
get
(
'/api/dashboards/'
+
id
)
.
then
(
function
(
result
)
{
if
(
result
.
data
)
{
return
angular
.
fromJson
(
result
.
data
);
}
else
{
return
false
;
}
},
function
(
data
)
{
if
(
data
.
status
===
0
)
{
throw
"Could not contact Elasticsearch. Please ensure that Elasticsearch is reachable from your browser."
;
}
else
{
throw
"Could not find dashboard "
+
id
;
}
});
};
return
GrafanaDatasource
;
});
});
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