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
089b1f53
Commit
089b1f53
authored
Dec 20, 2013
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
func editor work
parent
35bdc1dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
29 deletions
+79
-29
src/app/controllers/graphiteTarget.js
+52
-2
src/app/panels/graphite/editor.html
+27
-27
No files found.
src/app/controllers/graphiteTarget.js
View file @
089b1f53
...
@@ -7,6 +7,20 @@ function (angular, _, config) {
...
@@ -7,6 +7,20 @@ function (angular, _, config) {
'use strict'
;
'use strict'
;
var
module
=
angular
.
module
(
'kibana.controllers'
);
var
module
=
angular
.
module
(
'kibana.controllers'
);
var
graphiteFunctions
=
[
{
name
:
"scaleToSeconds"
,
params
:
[
{
name
:
"seconds"
,
type
:
"int"
}
]
},
{
name
:
"sumSeries"
,
params
:
[]
},
{
name
:
"groupByNode"
,
params
:
[
{
name
:
"node"
,
type
:
"node"
},
{
name
:
"function"
,
type
:
"function"
}]
}
];
module
.
controller
(
'GraphiteTargetCtrl'
,
function
(
$scope
,
$http
)
{
module
.
controller
(
'GraphiteTargetCtrl'
,
function
(
$scope
,
$http
)
{
...
@@ -17,6 +31,23 @@ function (angular, _, config) {
...
@@ -17,6 +31,23 @@ function (angular, _, config) {
html
:
segmentStr
===
'*'
?
'<i class="icon-asterisk"><i>'
:
segmentStr
html
:
segmentStr
===
'*'
?
'<i class="icon-asterisk"><i>'
:
segmentStr
};
};
});
});
$scope
.
functions
=
[
{
text
:
"scaleToSeconds(1)"
,
def
:
graphiteFunctions
[
0
],
params
:
{
seconds
:
1
}
},
{
text
:
"groupByNode"
,
def
:
graphiteFunctions
[
2
],
params
:
{
}
}
];
};
};
function
getSegmentPathUpTo
(
index
)
{
function
getSegmentPathUpTo
(
index
)
{
...
@@ -97,6 +128,25 @@ function (angular, _, config) {
...
@@ -97,6 +128,25 @@ function (angular, _, config) {
$scope
.
$parent
.
get_data
();
$scope
.
$parent
.
get_data
();
};
};
$scope
.
removeFunction
=
function
(
func
)
{
$scope
.
functions
=
_
.
without
(
$scope
.
functions
,
func
);
};
$scope
.
functionParmsChanged
=
function
(
func
)
{
func
.
text
=
func
.
name
+
'('
;
_
.
each
(
func
.
def
.
params
,
function
(
param
)
{
func
.
text
+=
func
.
params
[
param
.
name
];
});
};
$scope
.
addFunction
=
function
()
{
console
.
log
(
$scope
.
functions
);
};
$scope
.
editFunction
=
function
(
func
)
{
//func.edit = true;
};
});
});
module
.
directive
(
'focusMe'
,
function
(
$timeout
,
$parse
)
{
module
.
directive
(
'focusMe'
,
function
(
$timeout
,
$parse
)
{
...
@@ -112,12 +162,12 @@ function (angular, _, config) {
...
@@ -112,12 +162,12 @@ function (angular, _, config) {
});
});
}
}
});
});
// to address @blesh's comment, set attribute value to 'false'
/*
// to address @blesh's comment, set attribute value to 'false'
// on blur event:
// on blur event:
element.bind('blur', function() {
element.bind('blur', function() {
console.log('blur');
console.log('blur');
scope.$apply(model.assign(scope, false));
scope.$apply(model.assign(scope, false));
});
});
*/
}
}
};
};
});
});
...
...
src/app/panels/graphite/editor.html
View file @
089b1f53
...
@@ -31,31 +31,37 @@
...
@@ -31,31 +31,37 @@
border-left
:
1px
solid
#050505
;
border-left
:
1px
solid
#050505
;
color
:
#c8c8c8
;
color
:
#c8c8c8
;
}
}
.grafana-target-controls
{
.grafana-target-controls
{
float
:
right
;
float
:
right
;
padding
:
5px
7px
;
}
}
.grafana-target
.dropdown
{
.grafana-target
.dropdown
{
padding
:
0
;
margin
:
0
;
padding
:
0
;
margin
:
0
;
}
}
.grafana-target-segment
:hover
{
.grafana-target-segment
:hover
{
text-decoration
:
none
;
text-decoration
:
none
;
}
}
a
.grafana-target-segment
:focus
{
a
.grafana-target-segment
:focus
{
outline
:
0
;
outline
:
0
;
text-decoration
:
none
;
text-decoration
:
none
;
}
}
.grafana-target-fun-panel
ul
{
.grafana-target-fun
c
-panel
ul
{
list-style
:
none
;
list-style
:
none
;
margin
:
0
;
}
}
.grafana-target-fun-panel
ul
>
li
{
.grafana-target-fun
c
-panel
ul
>
li
{
float
:
left
;
float
:
left
;
padding
:
5
px
7px
;
padding
:
1
px
7px
;
}
}
.grafana-target-fun-panel-icon
{
.grafana-target-fun
c
-panel-icon
{
float
:
left
;
float
:
left
;
padding
:
5
px
7px
;
padding
:
1
px
7px
;
}
}
</style>
</style>
...
@@ -82,28 +88,22 @@
...
@@ -82,28 +88,22 @@
</span>
</span>
<div
class=
"clearfix"
></div>
<div
class=
"clearfix"
></div>
</div>
</div>
<div
class=
"grafana-target-fun-panel"
>
</div>
<span
class=
"grafana-target-fun-panel-icon"
>
<i
class=
"icon-share-alt"
></i>
<div
class=
"grafana-target-func-panel"
>
</span>
<span
class=
"grafana-target-func-panel-icon"
>
<ul>
<i
class=
"icon-long-arrow-right"
></i>
<li>
</span>
<a
href=
"asd"
>
sumSeries
</a>
<ul>
</li>
<li
ng-repeat=
"func in functions"
>
<li>
<a
bs-popover=
"'app/panels/graphite/funcEditor.html'"
data-placement=
"top"
>
{{func.text}}
</a>
<a
href=
"asd"
>
avgSeries
</a>
<i
class=
"icon-long-arrow-right"
></i>
</li>
</li>
<li>
<li>
<a
href=
"asd"
>
scaleToSeconds
</a>
<a
ng-click=
"addFunction"
>
add function
</a>
</li>
</li>
<li>
</ul>
<a
href=
"asd"
>
alias
</a>
<div
class=
"clearfix"
></div>
</li>
<li>
<a
href=
"asd"
>
other
</a>
</li>
</ul>
</div>
</div>
</div>
<!-- <div class="row-fluid">
<!-- <div class="row-fluid">
...
...
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