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
03057e54
Commit
03057e54
authored
Aug 14, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #373 from rashidkpc/master
Fixed bug in sorting
parents
0e38828a
5fa49c62
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
9 deletions
+33
-9
js/services.js
+5
-0
panels/table/module.html
+6
-5
panels/table/module.js
+19
-4
partials/dasheditor.html
+3
-0
No files found.
js/services.js
View file @
03057e54
...
...
@@ -449,6 +449,11 @@ angular.module('kibana.services', [])
return
_
.
pluck
(
_
.
where
(
self
.
list
,
_require
),
'id'
);
};
// TOFIX: Error handling when there is more than one field
this
.
timeField
=
function
()
{
return
self
.
getByType
(
'time'
)[
0
].
field
;
};
// This special function looks for all time filters, and returns a time range according to the mode
// No idea when max would actually be used
this
.
timeRange
=
function
(
mode
)
{
...
...
panels/table/module.html
View file @
03057e54
...
...
@@ -55,11 +55,12 @@
</th>
</thead>
<tbody
ng-repeat=
"row in data | slice:panel.offset:panel.offset+panel.size"
ng-class-odd=
"'odd'"
>
<tr
ng-click=
"toggle_details(row)"
class=
"pointer"
>
<td
ng-repeat=
"field in panel.fields"
ng-bind-html-unsafe=
"(row.highlight[field]||row._source[field]) | tableHighlight | tableTruncate:panel.trimFactor:panel.fields.length"
></td>
<tbody
ng-repeat=
"event in data | slice:panel.offset:panel.offset+panel.size"
ng-class-odd=
"'odd'"
>
<tr
ng-click=
"toggle_details(event)"
class=
"pointer"
>
<!--<td ng-repeat="field in panel.fields" ng-bind-html-unsafe="(event.highlight[field]||event._source[field]) | tableFieldFormat:field:event:this |tableHighlight | tableTruncate:panel.trimFactor:panel.fields.length"></td>-->
<td
ng-repeat=
"field in panel.fields"
ng-bind-html-unsafe=
"(event.highlight[field]||event._source[field]) |tableHighlight | tableTruncate:panel.trimFactor:panel.fields.length"
></td>
</tr>
<tr
ng-show=
"
row
.kibana.details"
>
<tr
ng-show=
"
event
.kibana.details"
>
<td
colspan=
1000
>
<table
class=
'table table-bordered table-condensed'
>
<thead>
...
...
@@ -67,7 +68,7 @@
<th>
Action
</th>
<th>
Value
</th>
</thead>
<tr
ng-repeat=
"(key,value) in
row
.kibana.details._source"
ng-class-odd=
"'odd'"
>
<tr
ng-repeat=
"(key,value) in
event
.kibana.details._source"
ng-class-odd=
"'odd'"
>
<td>
{{key}}
</td>
<td>
<i
class=
'icon-search pointer'
ng-click=
"build_search(key,value)"
></i>
...
...
panels/table/module.js
View file @
03057e54
...
...
@@ -52,6 +52,7 @@ angular.module('kibana.table', [])
paging
:
true
,
field_list
:
true
,
trimFactor
:
300
,
normTimes
:
true
,
spyable
:
true
};
_
.
defaults
(
$scope
.
panel
,
_d
);
...
...
@@ -219,10 +220,9 @@ angular.module('kibana.table', [])
// If we're not sorting in reverse chrono order, query every index for
// size*pages results
// Otherwise, only get size*pages results then stop querying
//($scope.data.length < $scope.panel.size*$scope.panel.pages
// || !(($scope.panel.sort[0] === $scope.time.field) && $scope.panel.sort[1] === 'desc'))
if
(
$scope
.
data
.
length
<
$scope
.
panel
.
size
*
$scope
.
panel
.
pages
&&
_segment
+
1
<
dashboard
.
indices
.
length
)
{
if
((
$scope
.
data
.
length
<
$scope
.
panel
.
size
*
$scope
.
panel
.
pages
||
!
((
$scope
.
panel
.
sort
[
0
]
===
filterSrv
.
timeField
())
&&
$scope
.
panel
.
sort
[
1
]
===
'desc'
))
&&
_segment
+
1
<
dashboard
.
indices
.
length
)
{
$scope
.
get_data
(
_segment
+
1
,
$scope
.
query_id
);
}
...
...
@@ -274,4 +274,19 @@ angular.module('kibana.table', [])
}
return
''
;
};
// WIP
}).
filter
(
'tableFieldFormat'
,
function
(
fields
){
return
function
(
text
,
field
,
event
,
scope
)
{
var
type
;
if
(
!
_
.
isUndefined
(
fields
.
mapping
[
event
.
_index
])
&&
!
_
.
isUndefined
(
fields
.
mapping
[
event
.
_index
][
event
.
_type
])
)
{
type
=
fields
.
mapping
[
event
.
_index
][
event
.
_type
][
field
][
'type'
];
if
(
type
===
'date'
&&
scope
.
panel
.
normTimes
)
{
return
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
}
}
return
text
;
};
});
partials/dasheditor.html
View file @
03057e54
...
...
@@ -30,6 +30,7 @@
<code>
[logstash-]YYYY.MM.DD
</code>
. The [] in "[logstash-]" are
important as they instruct Kibana not to treat those letters as a
pattern.
Please also note that indices should rollover at midnight
<strong>
UTC
</strong>
.
</p>
<p
class=
"small"
>
See
<a
href=
"http://momentjs.com/docs/#/displaying/format/"
>
http://momentjs.com/docs/#/displaying/format/
</a>
...
...
@@ -85,6 +86,8 @@
</div>
</form>
</div>
<div
class=
"row-fluid"
ng-show=
"editor.index == 3"
>
</div>
</div>
<div
class=
"modal-footer"
>
<button
ng-click=
"add_row(dashboard.current,row); reset_row();"
class=
"btn btn-success"
ng-show=
"editor.index == 2"
>
Create Row
</button>
...
...
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