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
4f6f9742
Commit
4f6f9742
authored
Dec 20, 2013
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
got subsegment selection working
parent
816cc986
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
36 deletions
+56
-36
src/app/controllers/graphiteTarget.js
+51
-33
src/app/panels/graphite/editor.html
+4
-3
src/css/bootstrap.dark.min.css
+0
-0
src/vendor/bootstrap/less/grafana.less
+1
-0
No files found.
src/app/controllers/graphiteTarget.js
View file @
4f6f9742
define
([
define
([
'angular'
,
'angular'
,
'underscore'
'underscore'
,
'config'
],
],
function
(
angular
,
_
)
{
function
(
angular
,
_
,
config
)
{
'use strict'
;
'use strict'
;
var
module
=
angular
.
module
(
'kibana.controllers'
);
var
module
=
angular
.
module
(
'kibana.controllers'
);
module
.
controller
(
'GraphiteTargetCtrl'
,
function
(
$scope
)
{
module
.
controller
(
'GraphiteTargetCtrl'
,
function
(
$scope
,
$http
)
{
$scope
.
init
=
function
()
{
$scope
.
segments
=
[];
var
strSegments
=
$scope
.
target
.
target
.
split
(
'.'
);
_
.
each
(
strSegments
,
function
(
segment
,
index
)
{
if
(
segment
===
'*'
)
{
$scope
.
segments
[
index
]
=
{
val
:
segment
,
html
:
'<i class="icon-asterisk"><i>'
};
return
;
}
$scope
.
segments
[
index
]
=
{
val
:
segment
,
html
:
segment
};
});
};
function
getSegmentPathUpTo
(
index
)
{
var
arr
=
$scope
.
segments
.
slice
(
0
,
index
);
return
_
.
reduce
(
arr
,
function
(
result
,
segment
)
{
return
result
?
(
result
+
"."
+
segment
.
val
)
:
segment
.
val
;
},
null
);
}
$scope
.
getItems
=
function
(
index
)
{
$scope
.
altSegments
=
[];
var
metricPath
=
getSegmentPathUpTo
(
index
)
+
'.*'
;
var
url
=
config
.
graphiteUrl
+
'/metrics/find/?query='
+
metricPath
;
return
$http
.
get
(
url
)
.
then
(
function
(
result
)
{
$scope
.
altSegments
=
result
.
data
;
});
};
$scope
.
init
=
function
()
{
$scope
.
setSegment
=
function
(
altIndex
,
segmentIndex
)
{
$scope
.
segments
=
[];
$scope
.
segments
[
segmentIndex
].
val
=
$scope
.
altSegments
[
altIndex
].
text
;
var
strSegments
=
$scope
.
target
.
target
.
split
(
'.'
);
$scope
.
segments
[
segmentIndex
].
html
=
$scope
.
altSegments
[
altIndex
].
text
;
_
.
each
(
strSegments
,
function
(
segment
,
index
)
{
$scope
.
target
.
target
=
getSegmentPathUpTo
(
$scope
.
segments
.
length
);
if
(
segment
===
'*'
)
{
$scope
.
targetChanged
();
$scope
.
segments
[
index
]
=
{
val
:
segment
,
html
:
'<i class="icon-asterisk"><i>'
};
};
return
;
}
$scope
.
segments
[
index
]
=
{
val
:
segment
,
html
:
segment
};
$scope
.
targetChanged
=
function
()
{
});
$scope
.
$parent
.
get_data
();
};
$scope
.
editMode
=
false
;
};
$scope
.
setSegmentStar
=
function
(
index
)
{
$scope
.
segments
[
index
].
val
=
'*'
;
$scope
.
segments
[
index
].
html
=
'<i class="icon-asterisk"><i>'
;
$scope
.
target
.
target
=
_
.
reduce
(
$scope
.
segments
,
function
(
result
,
segment
)
{
return
result
?
(
result
+
"."
+
segment
.
val
)
:
segment
.
val
;
},
null
);
$scope
.
targetChanged
();
};
$scope
.
targetChanged
=
function
()
{
$scope
.
$parent
.
get_data
();
$scope
.
editMode
=
false
;
};
$scope
.
edit
=
function
()
{
$scope
.
editMode
=
true
;
};
});
$scope
.
edit
=
function
()
{
$scope
.
editMode
=
true
;
};
});
});
});
\ No newline at end of file
src/app/panels/graphite/editor.html
View file @
4f6f9742
...
@@ -46,15 +46,16 @@
...
@@ -46,15 +46,16 @@
<ul
class=
"grafana-segment-list"
>
<ul
class=
"grafana-segment-list"
>
<li
class=
"dropdown"
ng-repeat=
"segment in segments"
>
<li
class=
"dropdown"
ng-repeat=
"segment in segments"
>
<a
class=
"grafana-target-segment dropdown-toggle"
<a
class=
"grafana-target-segment dropdown-toggle"
data-toggle=
"dropdown"
data-toggle=
"dropdown"
ng-click=
"getItems($index)"
data-placement=
"bottom"
ng-bind-html-unsafe=
"segment.html"
></a>
data-placement=
"bottom"
ng-bind-html-unsafe=
"segment.html"
></a>
<ul
class=
"dropdown-menu"
>
<ul
class=
"dropdown-menu"
>
<li>
<li
ng-repeat=
"altSegment in altSegments"
>
<a
ng-click=
"setSegment
Star($index)"
>
All
<i
class=
"icon-star"
/>
</a>
<a
ng-click=
"setSegment
($index, $parent.$index)"
>
{{altSegment.text}}
</a>
</li>
</li>
</ul>
</ul>
</li>
</li>
<ul>
<ul>
</td>
</td>
<td>
<td>
<i
class=
"icon-remove"
></i>
<i
class=
"icon-remove"
></i>
...
...
src/css/bootstrap.dark.min.css
View file @
4f6f9742
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/vendor/bootstrap/less/grafana.less
View file @
4f6f9742
...
@@ -81,6 +81,7 @@
...
@@ -81,6 +81,7 @@
padding: 0 10px 10px 10px;
padding: 0 10px 10px 10px;
background: #202328;
background: #202328;
overflow-y: auto;
overflow-y: auto;
overflow-x: hidden;
height: 600px;
height: 600px;
}
}
...
...
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