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
68a45608
Commit
68a45608
authored
Jun 29, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:grafana/grafana
parents
0838f432
6e8505ae
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
5 deletions
+15
-5
pkg/bus/bus.go
+2
-2
public/app/components/kbn.js
+5
-0
public/app/features/templating/templateSrv.js
+1
-1
public/app/features/templating/templateValuesSrv.js
+4
-0
public/test/specs/templateValuesSrv-specs.js
+3
-2
No files found.
pkg/bus/bus.go
View file @
68a45608
package
bus
import
(
"
errors
"
"
fmt
"
"reflect"
)
...
...
@@ -39,7 +39,7 @@ func (b *InProcBus) Dispatch(msg Msg) error {
var
handler
=
b
.
handlers
[
msgName
]
if
handler
==
nil
{
return
errors
.
New
(
"handler not found"
)
return
fmt
.
Errorf
(
"handler not found for %s"
,
msgName
)
}
var
params
=
make
([]
reflect
.
Value
,
1
)
...
...
public/app/components/kbn.js
View file @
68a45608
...
...
@@ -399,6 +399,8 @@ function($, _, moment) {
kbn
.
valueFormats
.
celsius
=
function
(
value
,
decimals
)
{
return
kbn
.
toFixed
(
value
,
decimals
)
+
' °C'
;
};
kbn
.
valueFormats
.
farenheit
=
function
(
value
,
decimals
)
{
return
kbn
.
toFixed
(
value
,
decimals
)
+
' °F'
;
};
kbn
.
valueFormats
.
humidity
=
function
(
value
,
decimals
)
{
return
kbn
.
toFixed
(
value
,
decimals
)
+
' %H'
;
};
kbn
.
valueFormats
.
pressurembar
=
function
(
value
,
decimals
)
{
return
kbn
.
toFixed
(
value
,
decimals
)
+
' mbar'
;
};
kbn
.
valueFormats
.
pressurehpa
=
function
(
value
,
decimals
)
{
return
kbn
.
toFixed
(
value
,
decimals
)
+
' hPa'
;
};
kbn
.
valueFormats
.
ppm
=
function
(
value
,
decimals
)
{
return
kbn
.
toFixed
(
value
,
decimals
)
+
' ppm'
;
};
kbn
.
valueFormats
.
velocityms
=
function
(
value
,
decimals
)
{
return
kbn
.
toFixed
(
value
,
decimals
)
+
' m/s'
;
};
kbn
.
valueFormats
.
velocitykmh
=
function
(
value
,
decimals
)
{
return
kbn
.
toFixed
(
value
,
decimals
)
+
' km/h'
;
};
...
...
@@ -541,6 +543,7 @@ function($, _, moment) {
{
text
:
'short'
,
value
:
'short'
},
{
text
:
'percent'
,
value
:
'percent'
},
{
text
:
'ppm'
,
value
:
'ppm'
},
{
text
:
'dB'
,
value
:
'dB'
},
]
},
{
...
...
@@ -590,6 +593,8 @@ function($, _, moment) {
{
text
:
'Celcius (°C)'
,
value
:
'celsius'
},
{
text
:
'Farenheit (°F)'
,
value
:
'farenheit'
},
{
text
:
'Humidity (%H)'
,
value
:
'humidity'
},
{
text
:
'Pressure (mbar)'
,
value
:
'pressurembar'
},
{
text
:
'Pressure (hPa)'
,
value
:
'pressurehpa'
},
]
},
{
...
...
public/app/features/templating/templateSrv.js
View file @
68a45608
...
...
@@ -27,7 +27,7 @@ function (angular, _) {
this
.
_texts
=
{};
_
.
each
(
this
.
variables
,
function
(
variable
)
{
if
(
!
variable
.
current
||
!
variable
.
current
.
value
)
{
return
;
}
if
(
!
variable
.
current
||
!
variable
.
current
.
isNone
&&
!
variable
.
current
.
value
)
{
return
;
}
this
.
_values
[
variable
.
name
]
=
this
.
renderVariableValue
(
variable
);
this
.
_texts
[
variable
.
name
]
=
variable
.
current
.
text
;
...
...
public/app/features/templating/templateValuesSrv.js
View file @
68a45608
...
...
@@ -10,6 +10,7 @@ function (angular, _, kbn) {
module
.
service
(
'templateValuesSrv'
,
function
(
$q
,
$rootScope
,
datasourceSrv
,
$location
,
templateSrv
,
timeSrv
)
{
var
self
=
this
;
function
getNoneOption
()
{
return
{
text
:
'None'
,
value
:
''
,
isNone
:
true
};
}
$rootScope
.
onAppEvent
(
'time-range-changed'
,
function
()
{
var
variable
=
_
.
findWhere
(
self
.
variables
,
{
type
:
'interval'
});
...
...
@@ -175,6 +176,9 @@ function (angular, _, kbn) {
if
(
variable
.
includeAll
)
{
self
.
addAllOption
(
variable
);
}
if
(
!
variable
.
options
.
length
)
{
variable
.
options
.
push
(
getNoneOption
());
}
return
datasource
;
});
};
...
...
public/test/specs/templateValuesSrv-specs.js
View file @
68a45608
...
...
@@ -224,8 +224,9 @@ define([
scenario
.
queryResult
=
[{
text
:
'apps.backend.backend_01.counters.req'
},
{
text
:
'apps.backend.backend_02.counters.req'
}];
});
it
(
'should not add non matching items'
,
function
()
{
expect
(
scenario
.
variable
.
options
.
length
).
to
.
be
(
0
);
it
(
'should not add non matching items, None option should be added instead'
,
function
()
{
expect
(
scenario
.
variable
.
options
.
length
).
to
.
be
(
1
);
expect
(
scenario
.
variable
.
options
[
0
].
isNone
).
to
.
be
(
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