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
896a6f7c
Commit
896a6f7c
authored
Jan 31, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added sorting
parent
06b8dc38
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
panels/sort/module.html
+6
-0
panels/sort/module.js
+25
-0
No files found.
panels/sort/module.html
0 → 100644
View file @
896a6f7c
<div
ng-controller=
'sort'
>
<h4
ng-hide=
"_.isUndefined(panel.title)"
>
{{panel.title}}
</h4>
<select
ng-model=
"panel.sort[0]"
ng-options=
"f for f in fields"
></select>
<i
ng-click=
"toggle_sort()"
ng-class=
"{'icon-chevron-up': panel.sort[1] == 'asc','icon-chevron-down': panel.sort[1] == 'desc'}"
></i>
</div>
\ No newline at end of file
panels/sort/module.js
0 → 100644
View file @
896a6f7c
angular
.
module
(
'kibana.sort'
,
[])
.
controller
(
'sort'
,
function
(
$scope
,
$rootScope
)
{
// Set and populate defaults
var
_d
=
{
query
:
"*"
,
size
:
100
,
sort
:
[
config
.
timefield
,
'desc'
],
}
_
.
each
(
_d
,
function
(
v
,
k
)
{
$scope
.
panel
[
k
]
=
_
.
isUndefined
(
$scope
.
panel
[
k
])
?
_d
[
k
]
:
$scope
.
panel
[
k
];
});
$scope
.
toggle_sort
=
function
()
{
$scope
.
panel
.
sort
[
1
]
=
$scope
.
panel
.
sort
[
1
]
==
'asc'
?
'desc'
:
'asc'
;
}
$scope
.
fields
=
[];
$scope
.
$on
(
$scope
.
panel
.
group
+
"-fields"
,
function
(
event
,
fields
)
{
$scope
.
panel
.
sort
=
fields
.
sort
;
$scope
.
fields
=
_
.
union
(
fields
.
all
,
$scope
.
fields
);
});
})
\ No newline at end of file
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