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
4a72c37f
Commit
4a72c37f
authored
Feb 28, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes to edit view switching, and to templateValuesSrv
parent
dcfad7d6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
24 deletions
+27
-24
src/app/directives/dashEditLink.js
+3
-1
src/app/features/annotations/annotationsSrv.js
+8
-7
src/app/features/templating/templateValuesSrv.js
+16
-16
No files found.
src/app/directives/dashEditLink.js
View file @
4a72c37f
...
@@ -107,7 +107,9 @@ function (angular, $) {
...
@@ -107,7 +107,9 @@ function (angular, $) {
showEditorPane
(
null
,
{},
newValue
);
showEditorPane
(
null
,
{},
newValue
);
}
else
if
(
oldValue
)
{
}
else
if
(
oldValue
)
{
scope
.
contextSrv
.
editview
=
null
;
scope
.
contextSrv
.
editview
=
null
;
hideEditorPane
();
if
(
lastEditor
===
editViewMap
[
oldValue
])
{
hideEditorPane
();
}
}
}
});
});
...
...
src/app/features/annotations/annotationsSrv.js
View file @
4a72c37f
...
@@ -12,6 +12,7 @@ define([
...
@@ -12,6 +12,7 @@ define([
var
promiseCached
;
var
promiseCached
;
var
list
=
[];
var
list
=
[];
var
timezone
;
var
timezone
;
var
self
=
this
;
this
.
init
=
function
()
{
this
.
init
=
function
()
{
$rootScope
.
onAppEvent
(
'refresh'
,
this
.
clearCache
);
$rootScope
.
onAppEvent
(
'refresh'
,
this
.
clearCache
);
...
@@ -33,15 +34,15 @@ define([
...
@@ -33,15 +34,15 @@ define([
}
}
timezone
=
dashboard
.
timezone
;
timezone
=
dashboard
.
timezone
;
var
annotations
=
_
.
where
(
dashboard
.
annotations
.
list
,
{
enable
:
true
});
var
annotations
=
_
.
where
(
dashboard
.
annotations
.
list
,
{
enable
:
true
});
var
promises
=
_
.
map
(
annotations
,
function
(
annotation
)
{
var
promises
=
_
.
map
(
annotations
,
function
(
annotation
)
{
var
datasource
=
datasourceSrv
.
get
(
annotation
.
datasource
);
return
datasourceSrv
.
get
(
annotation
.
datasource
).
then
(
function
(
datasource
)
{
return
datasource
.
annotationQuery
(
annotation
,
rangeUnparsed
)
return
datasource
.
annotationQuery
(
annotation
,
rangeUnparsed
)
.
then
(
self
.
receiveAnnotationResults
)
.
then
(
this
.
receiveAnnotationResults
)
.
then
(
null
,
errorHandler
);
.
then
(
null
,
errorHandler
);
},
this
);
}
,
this
);
});
promiseCached
=
$q
.
all
(
promises
)
promiseCached
=
$q
.
all
(
promises
)
.
then
(
function
()
{
.
then
(
function
()
{
...
...
src/app/features/templating/templateValuesSrv.js
View file @
4a72c37f
...
@@ -97,9 +97,8 @@ function (angular, _, kbn) {
...
@@ -97,9 +97,8 @@ function (angular, _, kbn) {
return
$q
.
when
([]);
return
$q
.
when
([]);
}
}
var
datasource
=
datasourceSrv
.
get
(
variable
.
datasource
);
return
datasourceSrv
.
get
(
variable
.
datasource
).
then
(
function
(
datasource
)
{
return
datasource
.
metricFindQuery
(
variable
.
query
)
return
datasource
.
metricFindQuery
(
variable
.
query
).
then
(
function
(
results
)
{
.
then
(
function
(
results
)
{
variable
.
options
=
self
.
metricNamesToVariableValues
(
variable
,
results
);
variable
.
options
=
self
.
metricNamesToVariableValues
(
variable
,
results
);
if
(
variable
.
includeAll
)
{
if
(
variable
.
includeAll
)
{
...
@@ -117,6 +116,7 @@ function (angular, _, kbn) {
...
@@ -117,6 +116,7 @@ function (angular, _, kbn) {
return
self
.
setVariableValue
(
variable
,
variable
.
options
[
0
],
true
);
return
self
.
setVariableValue
(
variable
,
variable
.
options
[
0
],
true
);
});
});
});
};
};
this
.
metricNamesToVariableValues
=
function
(
variable
,
metricNames
)
{
this
.
metricNamesToVariableValues
=
function
(
variable
,
metricNames
)
{
...
@@ -149,19 +149,19 @@ function (angular, _, kbn) {
...
@@ -149,19 +149,19 @@ function (angular, _, kbn) {
this
.
addAllOption
=
function
(
variable
)
{
this
.
addAllOption
=
function
(
variable
)
{
var
allValue
=
''
;
var
allValue
=
''
;
switch
(
variable
.
allFormat
)
{
switch
(
variable
.
allFormat
)
{
case
'wildcard'
:
case
'wildcard'
:
allValue
=
'*'
;
allValue
=
'*'
;
break
;
break
;
case
'regex wildcard'
:
case
'regex wildcard'
:
allValue
=
'.*'
;
allValue
=
'.*'
;
break
;
break
;
case
'regex values'
:
case
'regex values'
:
allValue
=
'('
+
_
.
pluck
(
variable
.
options
,
'text'
).
join
(
'|'
)
+
')'
;
allValue
=
'('
+
_
.
pluck
(
variable
.
options
,
'text'
).
join
(
'|'
)
+
')'
;
break
;
break
;
default
:
default
:
allValue
=
'{'
;
allValue
=
'{'
;
allValue
+=
_
.
pluck
(
variable
.
options
,
'text'
).
join
(
','
);
allValue
+=
_
.
pluck
(
variable
.
options
,
'text'
).
join
(
','
);
allValue
+=
'}'
;
allValue
+=
'}'
;
}
}
variable
.
options
.
unshift
({
text
:
'All'
,
value
:
allValue
});
variable
.
options
.
unshift
({
text
:
'All'
,
value
:
allValue
});
...
...
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