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
22d3fdac
Commit
22d3fdac
authored
Feb 13, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved portability of exported JSON files, updated underscore.js
parent
42b415cf
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
39 additions
and
31 deletions
+39
-31
common/lib/underscore.min.js
+0
-0
index.html
+1
-1
js/controllers.js
+11
-3
panels/histogram/module.js
+8
-8
panels/hits/module.js
+4
-4
panels/map/module.js
+4
-4
panels/pie/module.js
+6
-6
panels/table/module.js
+4
-4
partials/dasheditor.html
+1
-1
No files found.
common/lib/underscore.min.js
View file @
22d3fdac
This diff is collapsed.
Click to expand it.
index.html
View file @
22d3fdac
...
...
@@ -34,7 +34,7 @@
<div
class=
"container-fluid"
>
<span
class=
"brand"
><small>
Kibana Preview
</small></span>
<span
class=
"brand"
>
{{dashboards.title}}
</span>
<div
class=
"brand"
><i
class=
'icon-edit pointer'
bs-modal=
"'partials/dasheditor.html'"
bs-tooltip=
"'Edit Dashboard'"
data-placement=
"bottom
"
></i></div>
<div
class=
"brand"
><i
class=
'icon-edit pointer'
ng-show=
'dashboards.editable'
bs-modal=
"'partials/dasheditor.html'
"
></i></div>
<div
class=
"brand"
><i
class=
'icon-download pointer'
ng-click=
"export()"
bs-tooltip=
"'Export this dashboard'"
data-placement=
"bottom"
></i></div>
<div
class=
"brand"
><i
class=
'icon-bookmark pointer'
ng-click=
"default()"
bs-tooltip=
"'Set as default dashboard'"
data-placement=
"bottom"
></i></div>
<div
class=
"brand"
><i
class=
'icon-ban-circle pointer'
ng-click=
"purge()"
bs-tooltip=
"'Clear default dashboard settings'"
data-placement=
"bottom"
></i></div>
...
...
js/controllers.js
View file @
22d3fdac
...
...
@@ -3,8 +3,13 @@
'use strict'
;
angular
.
module
(
'kibana.controllers'
,
[])
.
controller
(
'DashCtrl'
,
function
(
$scope
,
$rootScope
,
ejsResource
,
timer
)
{
.
controller
(
'DashCtrl'
,
function
(
$scope
,
$rootScope
,
$http
,
ejsResource
,
timer
)
{
var
_d
=
{
title
:
""
,
editable
:
true
,
rows
:
[],
}
$scope
.
init
=
function
()
{
$scope
.
config
=
config
;
...
...
@@ -18,14 +23,17 @@ angular.module('kibana.controllers', [])
)
{
$scope
.
dashboards
=
JSON
.
parse
(
localStorage
[
'dashboard'
]);
}
else
{
$scope
.
dashboards
=
dashboards
;
$scope
.
dashboards
=
dashboards
}
_
.
defaults
(
$scope
.
dashboards
,
_d
)
var
ejs
=
$scope
.
ejs
=
ejsResource
(
config
.
elasticsearch
);
}
$scope
.
export
=
function
()
{
var
blob
=
new
Blob
([
angular
.
toJson
(
$scope
.
dashboards
)],
{
type
:
"application/json;charset=utf-8"
});
var
blob
=
new
Blob
([
angular
.
toJson
(
$scope
.
dashboards
,
true
)],
{
type
:
"application/json;charset=utf-8"
});
saveAs
(
blob
,
$scope
.
dashboards
.
title
+
"-"
+
new
Date
().
getTime
());
}
...
...
panels/histogram/module.js
View file @
22d3fdac
...
...
@@ -42,7 +42,7 @@ angular.module('kibana.histogram', [])
$scope
.
get_data
=
function
()
{
// Make sure we have everything for the request to complete
if
(
_
.
isUndefined
(
$scope
.
panel
.
index
)
||
_
.
isUndefined
(
$scope
.
panel
.
time
))
if
(
_
.
isUndefined
(
$scope
.
panel
.
index
)
||
_
.
isUndefined
(
$scope
.
time
))
return
var
request
=
$scope
.
ejs
.
Request
().
indices
(
$scope
.
panel
.
index
);
...
...
@@ -52,9 +52,9 @@ angular.module('kibana.histogram', [])
_
.
each
(
$scope
.
panel
.
query
,
function
(
v
)
{
queries
.
push
(
$scope
.
ejs
.
FilteredQuery
(
ejs
.
QueryStringQuery
(
v
.
query
||
'*'
),
ejs
.
RangeFilter
(
$scope
.
panel
.
time
.
field
)
.
from
(
$scope
.
panel
.
time
.
from
)
.
to
(
$scope
.
panel
.
time
.
to
))
ejs
.
RangeFilter
(
$scope
.
time
.
field
)
.
from
(
$scope
.
time
.
from
)
.
to
(
$scope
.
time
.
to
))
)
});
...
...
@@ -62,7 +62,7 @@ angular.module('kibana.histogram', [])
_
.
each
(
queries
,
function
(
v
)
{
request
=
request
.
facet
(
$scope
.
ejs
.
DateHistogramFacet
(
_
.
indexOf
(
queries
,
v
))
.
field
(
$scope
.
panel
.
time
.
field
)
.
field
(
$scope
.
time
.
field
)
.
interval
(
$scope
.
panel
.
interval
)
.
facetFilter
(
$scope
.
ejs
.
QueryFilter
(
v
))
).
size
(
0
)
...
...
@@ -77,11 +77,11 @@ angular.module('kibana.histogram', [])
$scope
.
data
=
[];
_
.
each
(
results
.
facets
,
function
(
v
,
k
)
{
// Null values at each end of the time range ensure we see entire range
var
data
=
[[
$scope
.
panel
.
time
.
from
.
getTime
(),
null
]];
var
data
=
[[
$scope
.
time
.
from
.
getTime
(),
null
]];
_
.
each
(
v
.
entries
,
function
(
v
,
k
)
{
data
.
push
([
v
[
'time'
],
v
[
'count'
]])
});
data
.
push
([
$scope
.
panel
.
time
.
to
.
getTime
(),
null
])
data
.
push
([
$scope
.
time
.
to
.
getTime
(),
null
])
var
series
=
{
data
:
{
label
:
$scope
.
panel
.
query
[
k
].
label
||
k
,
...
...
@@ -97,7 +97,7 @@ angular.module('kibana.histogram', [])
}
function
set_time
(
time
)
{
$scope
.
panel
.
time
=
time
;
$scope
.
time
=
time
;
$scope
.
panel
.
index
=
_
.
isUndefined
(
time
.
index
)
?
$scope
.
panel
.
index
:
time
.
index
$scope
.
panel
.
interval
=
secondsToHms
(
calculate_interval
(
time
.
from
,
time
.
to
,
50
,
0
)
/
1000
),
...
...
panels/hits/module.js
View file @
22d3fdac
...
...
@@ -23,7 +23,7 @@ angular.module('kibana.hits', [])
$scope
.
get_data
=
function
()
{
// Make sure we have everything for the request to complete
if
(
_
.
isUndefined
(
$scope
.
panel
.
index
)
||
_
.
isUndefined
(
$scope
.
panel
.
time
))
if
(
_
.
isUndefined
(
$scope
.
panel
.
index
)
||
_
.
isUndefined
(
$scope
.
time
))
return
var
request
=
$scope
.
ejs
.
Request
().
indices
(
$scope
.
panel
.
index
);
...
...
@@ -32,8 +32,8 @@ angular.module('kibana.hits', [])
.
query
(
ejs
.
FilteredQuery
(
ejs
.
QueryStringQuery
(
$scope
.
panel
.
query
||
'*'
),
ejs
.
RangeFilter
(
config
.
timefield
)
.
from
(
$scope
.
panel
.
time
.
from
)
.
to
(
$scope
.
panel
.
time
.
to
)
.
from
(
$scope
.
time
.
from
)
.
to
(
$scope
.
time
.
to
)
)
)
.
size
(
0
)
...
...
@@ -51,7 +51,7 @@ angular.module('kibana.hits', [])
}
function
set_time
(
time
)
{
$scope
.
panel
.
time
=
time
;
$scope
.
time
=
time
;
$scope
.
panel
.
index
=
_
.
isUndefined
(
time
.
index
)
?
$scope
.
panel
.
index
:
time
.
index
$scope
.
get_data
();
}
...
...
panels/map/module.js
View file @
22d3fdac
...
...
@@ -26,7 +26,7 @@ angular.module('kibana.map', [])
$scope
.
get_data
=
function
()
{
// Make sure we have everything for the request to complete
if
(
_
.
isUndefined
(
$scope
.
panel
.
index
)
||
_
.
isUndefined
(
$scope
.
panel
.
time
))
if
(
_
.
isUndefined
(
$scope
.
panel
.
index
)
||
_
.
isUndefined
(
$scope
.
time
))
return
var
request
=
$scope
.
ejs
.
Request
().
indices
(
$scope
.
panel
.
index
);
...
...
@@ -41,8 +41,8 @@ angular.module('kibana.map', [])
ejs
.
FilteredQuery
(
ejs
.
QueryStringQuery
(
$scope
.
panel
.
query
||
'*'
),
ejs
.
RangeFilter
(
config
.
timefield
)
.
from
(
$scope
.
panel
.
time
.
from
)
.
to
(
$scope
.
panel
.
time
.
to
)
.
from
(
$scope
.
time
.
from
)
.
to
(
$scope
.
time
.
to
)
)))).
size
(
0
)
.
doSearch
();
...
...
@@ -58,7 +58,7 @@ angular.module('kibana.map', [])
}
function
set_time
(
time
)
{
$scope
.
panel
.
time
=
time
;
$scope
.
time
=
time
;
$scope
.
panel
.
index
=
_
.
isUndefined
(
time
.
index
)
?
$scope
.
panel
.
index
:
time
.
index
$scope
.
get_data
();
}
...
...
panels/pie/module.js
View file @
22d3fdac
...
...
@@ -50,7 +50,7 @@ angular.module('kibana.pie', [])
$scope
.
get_data
=
function
()
{
// Make sure we have everything for the request to complete
if
(
_
.
isUndefined
(
$scope
.
panel
.
index
)
||
_
.
isUndefined
(
$scope
.
panel
.
time
))
if
(
_
.
isUndefined
(
$scope
.
panel
.
index
)
||
_
.
isUndefined
(
$scope
.
time
))
return
var
request
=
$scope
.
ejs
.
Request
().
indices
(
$scope
.
panel
.
index
);
...
...
@@ -65,8 +65,8 @@ angular.module('kibana.pie', [])
queries
.
push
(
ejs
.
FilteredQuery
(
ejs
.
QueryStringQuery
(
v
.
query
||
'*'
),
ejs
.
RangeFilter
(
config
.
timefield
)
.
from
(
$scope
.
panel
.
time
.
from
)
.
to
(
$scope
.
panel
.
time
.
to
))
.
from
(
$scope
.
time
.
from
)
.
to
(
$scope
.
time
.
to
))
)
});
...
...
@@ -105,8 +105,8 @@ angular.module('kibana.pie', [])
ejs
.
FilteredQuery
(
ejs
.
QueryStringQuery
(
$scope
.
panel
.
query
.
query
||
'*'
),
ejs
.
RangeFilter
(
config
.
timefield
)
.
from
(
$scope
.
panel
.
time
.
from
)
.
to
(
$scope
.
panel
.
time
.
to
)
.
from
(
$scope
.
time
.
from
)
.
to
(
$scope
.
time
.
to
)
.
cache
(
false
)
)))).
size
(
0
)
.
doSearch
();
...
...
@@ -133,7 +133,7 @@ angular.module('kibana.pie', [])
}
function
set_time
(
time
)
{
$scope
.
panel
.
time
=
time
;
$scope
.
time
=
time
;
$scope
.
panel
.
index
=
_
.
isUndefined
(
time
.
index
)
?
$scope
.
panel
.
index
:
time
.
index
$scope
.
get_data
();
}
...
...
panels/table/module.js
View file @
22d3fdac
...
...
@@ -56,7 +56,7 @@ angular.module('kibana.table', [])
$scope
.
get_data
=
function
()
{
// Make sure we have everything for the request to complete
if
(
_
.
isUndefined
(
$scope
.
panel
.
index
)
||
_
.
isUndefined
(
$scope
.
panel
.
time
))
if
(
_
.
isUndefined
(
$scope
.
panel
.
index
)
||
_
.
isUndefined
(
$scope
.
time
))
return
var
request
=
$scope
.
ejs
.
Request
().
indices
(
$scope
.
panel
.
index
);
...
...
@@ -65,8 +65,8 @@ angular.module('kibana.table', [])
.
query
(
ejs
.
FilteredQuery
(
ejs
.
QueryStringQuery
(
$scope
.
panel
.
query
||
'*'
),
ejs
.
RangeFilter
(
config
.
timefield
)
.
from
(
$scope
.
panel
.
time
.
from
)
.
to
(
$scope
.
panel
.
time
.
to
)
.
from
(
$scope
.
time
.
from
)
.
to
(
$scope
.
time
.
to
)
)
)
.
size
(
$scope
.
panel
.
size
)
...
...
@@ -100,7 +100,7 @@ angular.module('kibana.table', [])
}
function
set_time
(
time
)
{
$scope
.
panel
.
time
=
time
;
$scope
.
time
=
time
;
$scope
.
panel
.
index
=
_
.
isUndefined
(
time
.
index
)
?
$scope
.
panel
.
index
:
time
.
index
$scope
.
get_data
();
}
...
...
partials/dasheditor.html
View file @
22d3fdac
...
...
@@ -9,7 +9,7 @@
<label
class=
"small"
>
Title
</label><input
type=
"text"
class=
"input-large"
ng-model=
'dashboards.title'
></input>
</div>
<div
class=
"span1"
>
<label
class=
"small"
>
Editable
</label><input
type=
"checkbox"
ng-model=
"
row
.editable"
ng-checked=
"dashboards.editable"
/>
<label
class=
"small"
>
Editable
</label><input
type=
"checkbox"
ng-model=
"
dashboards
.editable"
ng-checked=
"dashboards.editable"
/>
</div>
</div>
<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