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
c60d7379
Commit
c60d7379
authored
May 23, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v3.0.x'
Conflicts: package.json
parents
1d27a7f9
1da149d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
24 deletions
+31
-24
pkg/api/pluginproxy/pluginproxy.go
+1
-1
public/app/core/services/datasource_srv.js
+29
-22
public/app/features/annotations/editor_ctrl.js
+1
-1
No files found.
pkg/api/pluginproxy/pluginproxy.go
View file @
c60d7379
...
@@ -88,7 +88,7 @@ func NewApiPluginProxy(ctx *middleware.Context, proxyPath string, route *plugins
...
@@ -88,7 +88,7 @@ func NewApiPluginProxy(ctx *middleware.Context, proxyPath string, route *plugins
}
}
for
key
,
value
:=
range
headers
{
for
key
,
value
:=
range
headers
{
log
.
Info
(
"setting key %v value %v"
,
key
,
value
[
0
])
log
.
Trace
(
"setting key %v value %v"
,
key
,
value
[
0
])
req
.
Header
.
Set
(
key
,
value
[
0
])
req
.
Header
.
Set
(
key
,
value
[
0
])
}
}
}
}
...
...
public/app/core/services/datasource_srv.js
View file @
c60d7379
...
@@ -66,14 +66,17 @@ function (angular, _, coreModule, config) {
...
@@ -66,14 +66,17 @@ function (angular, _, coreModule, config) {
};
};
this
.
getAnnotationSources
=
function
()
{
this
.
getAnnotationSources
=
function
()
{
return
_
.
reduce
(
config
.
datasources
,
function
(
memo
,
value
)
{
var
sources
=
[];
this
.
addDataSourceVariables
(
sources
);
_
.
each
(
config
.
datasources
,
function
(
value
)
{
if
(
value
.
meta
&&
value
.
meta
.
annotations
)
{
if
(
value
.
meta
&&
value
.
meta
.
annotations
)
{
memo
.
push
(
value
);
sources
.
push
(
value
);
}
}
});
return
memo
;
return
sources
;
},
[]);
};
};
this
.
getMetricSources
=
function
(
options
)
{
this
.
getMetricSources
=
function
(
options
)
{
...
@@ -90,24 +93,7 @@ function (angular, _, coreModule, config) {
...
@@ -90,24 +93,7 @@ function (angular, _, coreModule, config) {
});
});
if
(
!
options
||
!
options
.
skipVariables
)
{
if
(
!
options
||
!
options
.
skipVariables
)
{
// look for data source variables
this
.
addDataSourceVariables
(
metricSources
);
for
(
var
i
=
0
;
i
<
templateSrv
.
variables
.
length
;
i
++
)
{
var
variable
=
templateSrv
.
variables
[
i
];
if
(
variable
.
type
!==
'datasource'
)
{
continue
;
}
var
first
=
variable
.
current
.
value
;
var
ds
=
config
.
datasources
[
first
];
if
(
ds
)
{
metricSources
.
push
({
name
:
'$'
+
variable
.
name
,
value
:
'$'
+
variable
.
name
,
meta
:
ds
.
meta
,
});
}
}
}
}
metricSources
.
sort
(
function
(
a
,
b
)
{
metricSources
.
sort
(
function
(
a
,
b
)
{
...
@@ -123,6 +109,27 @@ function (angular, _, coreModule, config) {
...
@@ -123,6 +109,27 @@ function (angular, _, coreModule, config) {
return
metricSources
;
return
metricSources
;
};
};
this
.
addDataSourceVariables
=
function
(
list
)
{
// look for data source variables
for
(
var
i
=
0
;
i
<
templateSrv
.
variables
.
length
;
i
++
)
{
var
variable
=
templateSrv
.
variables
[
i
];
if
(
variable
.
type
!==
'datasource'
)
{
continue
;
}
var
first
=
variable
.
current
.
value
;
var
ds
=
config
.
datasources
[
first
];
if
(
ds
)
{
list
.
push
({
name
:
'$'
+
variable
.
name
,
value
:
'$'
+
variable
.
name
,
meta
:
ds
.
meta
,
});
}
}
};
this
.
init
();
this
.
init
();
});
});
});
});
public/app/features/annotations/editor_ctrl.js
View file @
c60d7379
...
@@ -30,7 +30,7 @@ function (angular, _, $) {
...
@@ -30,7 +30,7 @@ function (angular, _, $) {
$scope
.
datasourceChanged
=
function
()
{
$scope
.
datasourceChanged
=
function
()
{
return
datasourceSrv
.
get
(
$scope
.
currentAnnotation
.
datasource
).
then
(
function
(
ds
)
{
return
datasourceSrv
.
get
(
$scope
.
currentAnnotation
.
datasource
).
then
(
function
(
ds
)
{
$scope
.
currentDatasource
=
ds
;
$scope
.
currentDatasource
=
ds
;
$scope
.
currentAnnotation
.
datasource
=
ds
.
nam
e
;
$scope
.
currentAnnotation
.
datasource
=
$scope
.
currentAnnotation
.
datasourc
e
;
});
});
};
};
...
...
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