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
2328c60d
Commit
2328c60d
authored
Jun 08, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small refactoring progress
parent
61cd5cf4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
10 deletions
+20
-10
src/app/controllers/dash.js
+10
-5
src/app/partials/roweditor.html
+1
-1
src/app/services/dashboard.js
+9
-4
No files found.
src/app/controllers/dash.js
View file @
2328c60d
...
...
@@ -31,21 +31,24 @@ function (angular, $, config, _) {
var
module
=
angular
.
module
(
'kibana.controllers'
);
module
.
controller
(
'DashCtrl'
,
function
(
$scope
,
$rootScope
,
dashboardKeybindings
,
filterSrv
,
dashboard
,
panelMoveSrv
,
alertSrv
)
{
$scope
,
$rootScope
,
dashboardKeybindings
,
filterSrv
,
dashboard
,
panelMoveSrv
,
alertSrv
,
timer
)
{
$scope
.
editor
=
{
index
:
0
};
$scope
.
init
=
function
()
{
$scope
.
reset_row
();
dashboardKeybindings
.
shortcuts
();
$scope
.
availablePanels
=
config
.
panels
;
// Clear existing alerts
alertSrv
.
clearAll
();
dashboardKeybindings
.
shortcuts
();
$scope
.
onAppEvent
(
'setup-dashboard'
,
$scope
.
setupDashboard
,
$scope
);
};
$scope
.
setupDashboard
=
function
(
event
,
dashboardData
)
{
timer
.
cancel_all
();
alertSrv
.
clearAll
();
$rootScope
.
fullscreen
=
false
;
$scope
.
dashboard
=
dashboard
.
create
(
dashboardData
);
$scope
.
filter
=
filterSrv
;
$scope
.
filter
.
init
(
$scope
.
dashboard
);
...
...
@@ -58,6 +61,8 @@ function (angular, $, config, _) {
$scope
.
panelMoveOver
=
panelMove
.
onOver
;
$scope
.
panelMoveOut
=
panelMove
.
onOut
;
window
.
document
.
title
=
'Grafana - '
+
$scope
.
dashboard
.
title
;
$scope
.
emitAppEvent
(
"dashboard-loaded"
,
$scope
.
dashboard
);
};
...
...
src/app/partials/roweditor.html
View file @
2328c60d
...
...
@@ -48,7 +48,7 @@
<div
class=
"row-fluid"
ng-if=
"editor.index == 2"
>
<h4>
Select Panel Type
</h4>
<form
class=
"form-inline"
>
<select
class=
"input-medium"
ng-model=
"panel.type"
ng-options=
"panelType for panelType in
dashboard.
availablePanels|stringSort"
></select>
<select
class=
"input-medium"
ng-model=
"panel.type"
ng-options=
"panelType for panelType in availablePanels|stringSort"
></select>
<small
ng-show=
"rowSpan(row) > 11"
>
Note: This row is full, new panels will wrap to a new line. You should add another row.
</small>
...
...
src/app/services/dashboard.js
View file @
2328c60d
...
...
@@ -16,6 +16,7 @@ function (angular, $, kbn, _) {
module
.
service
(
'dashboard'
,
function
(
timer
,
$rootScope
,
$timeout
)
{
function
DashboardModel
(
data
)
{
if
(
!
data
)
{
data
=
{};
}
...
...
@@ -77,18 +78,22 @@ function (angular, $, kbn, _) {
if
(
interval
)
{
var
_i
=
kbn
.
interval_to_ms
(
interval
);
timer
.
cancel
(
this
.
refresh_timer
);
var
dashboard_reference
=
this
;
var
self
=
this
;
this
.
refresh_timer
=
timer
.
register
(
$timeout
(
function
()
{
dashboard_reference
.
set_interval
(
interval
);
dashboard_reference
.
full
_refresh
();
self
.
set_interval
(
interval
);
self
.
emit
_refresh
();
},
_i
));
this
.
full
_refresh
();
this
.
emit
_refresh
();
}
else
{
timer
.
cancel
(
this
.
refresh_timer
);
}
};
// An elasticJS client to use
/*var ejs = ejsResource(config.elasticsearch, config.elasticsearchBasicAuth);
var gist_pattern = /(^\d{5,}$)|(^[a-z0-9]{10,}$)|(gist.github.com(\/*.*)\/[a-z0-9]{5,}\/*$)/;
*/
return
{
create
:
function
(
dashboard
)
{
return
new
DashboardModel
(
dashboard
);
...
...
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