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
5d002e72
Commit
5d002e72
authored
Jan 02, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring target controller
parent
1e7ced2a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
18 deletions
+9
-18
src/app/controllers/graphiteTarget.js
+8
-13
src/vendor/bootstrap/less/grafana.less
+1
-4
src/vendor/bootstrap/less/overrides.less
+0
-1
No files found.
src/app/controllers/graphiteTarget.js
View file @
5d002e72
...
@@ -10,7 +10,7 @@ function (angular, _, config, graphiteFuncs, Parser) {
...
@@ -10,7 +10,7 @@ function (angular, _, config, graphiteFuncs, Parser) {
var
module
=
angular
.
module
(
'kibana.controllers'
);
var
module
=
angular
.
module
(
'kibana.controllers'
);
module
.
controller
(
'GraphiteTargetCtrl'
,
function
(
$scope
,
$http
)
{
module
.
controller
(
'GraphiteTargetCtrl'
,
function
(
$scope
,
$http
,
filterSrv
,
graphiteSrv
)
{
$scope
.
init
=
function
()
{
$scope
.
init
=
function
()
{
$scope
.
funcCategories
=
graphiteFuncs
.
getCategories
();
$scope
.
funcCategories
=
graphiteFuncs
.
getCategories
();
...
@@ -98,7 +98,7 @@ function (angular, _, config, graphiteFuncs, Parser) {
...
@@ -98,7 +98,7 @@ function (angular, _, config, graphiteFuncs, Parser) {
}
}
}
}
function
getSegmentPathUpTo
(
index
)
{
function
getSegmentPathUpTo
(
index
,
interpolateTemplate
)
{
var
arr
=
$scope
.
segments
.
slice
(
0
,
index
);
var
arr
=
$scope
.
segments
.
slice
(
0
,
index
);
return
_
.
reduce
(
arr
,
function
(
result
,
segment
)
{
return
_
.
reduce
(
arr
,
function
(
result
,
segment
)
{
...
@@ -106,26 +106,21 @@ function (angular, _, config, graphiteFuncs, Parser) {
...
@@ -106,26 +106,21 @@ function (angular, _, config, graphiteFuncs, Parser) {
},
""
);
},
""
);
}
}
function
graphiteMetricQuery
(
query
)
{
var
url
=
config
.
graphiteUrl
+
'/metrics/find/?query='
+
query
;
return
$http
.
get
(
url
);
}
function
checkOtherSegments
(
fromIndex
)
{
function
checkOtherSegments
(
fromIndex
)
{
if
(
fromIndex
===
0
)
{
if
(
fromIndex
===
0
)
{
$scope
.
segments
.
push
({
html
:
'select metric'
});
$scope
.
segments
.
push
({
html
:
'select metric'
});
return
;
return
;
}
}
var
path
=
getSegmentPathUpTo
(
fromIndex
+
1
);
var
path
=
getSegmentPathUpTo
(
fromIndex
+
1
,
true
);
return
graphite
Metric
Query
(
path
)
return
graphite
Srv
.
metricFind
Query
(
path
)
.
then
(
function
(
result
)
{
.
then
(
function
(
segments
)
{
if
(
result
.
data
.
length
===
0
)
{
if
(
segments
.
length
===
0
)
{
$scope
.
segments
=
$scope
.
segments
.
splice
(
0
,
fromIndex
);
$scope
.
segments
=
$scope
.
segments
.
splice
(
0
,
fromIndex
);
$scope
.
segments
.
push
({
html
:
'select metric'
});
$scope
.
segments
.
push
({
html
:
'select metric'
});
return
;
return
;
}
}
if
(
result
.
data
[
0
].
expandable
)
{
if
(
segments
[
0
].
expandable
)
{
if
(
$scope
.
segments
.
length
===
fromIndex
)
{
if
(
$scope
.
segments
.
length
===
fromIndex
)
{
$scope
.
segments
.
push
({
html
:
'select metric'
});
$scope
.
segments
.
push
({
html
:
'select metric'
});
}
}
...
@@ -161,7 +156,7 @@ function (angular, _, config, graphiteFuncs, Parser) {
...
@@ -161,7 +156,7 @@ function (angular, _, config, graphiteFuncs, Parser) {
var
query
=
index
===
0
?
var
query
=
index
===
0
?
'*'
:
getSegmentPathUpTo
(
index
)
+
'.*'
;
'*'
:
getSegmentPathUpTo
(
index
)
+
'.*'
;
return
graphite
Metric
Query
(
query
)
return
graphite
Srv
.
metricFind
Query
(
query
)
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
var
altSegments
=
_
.
map
(
result
.
data
,
function
(
altSegment
)
{
var
altSegments
=
_
.
map
(
result
.
data
,
function
(
altSegment
)
{
return
{
return
{
...
...
src/vendor/bootstrap/less/grafana.less
View file @
5d002e72
...
@@ -45,12 +45,9 @@
...
@@ -45,12 +45,9 @@
.top-row-close {
.top-row-close {
border-right: 1px solid #202020;
border-right: 1px solid #202020;
}
}
.top-row-open {
.top-row-open {
float: left;
float: left;
padding: 0px;
padding: 0px;
}
.top-row-open {
background: none;
background: none;
}
}
...
@@ -162,7 +159,7 @@
...
@@ -162,7 +159,7 @@
}
}
.tab-content {
.tab-content {
overflow: visible;
overflow: visible;
padding: 1
0
px;
padding: 1
5
px;
}
}
.nav-tabs > li > a {
.nav-tabs > li > a {
...
...
src/vendor/bootstrap/less/overrides.less
View file @
5d002e72
...
@@ -33,7 +33,6 @@
...
@@ -33,7 +33,6 @@
.bgWarning {
.bgWarning {
background: @btnWarningBackground;
background: @btnWarningBackground;
color: rgba(255,255,255,.90);
color: rgba(255,255,255,.90);
}
}
.bgDanger {
.bgDanger {
...
...
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