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
cd79b73c
Commit
cd79b73c
authored
Aug 15, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved an expensive binding expression into a directive and a groupWatch
parent
21aa1b43
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
8 deletions
+15
-8
src/app/controllers/dash.js
+0
-4
src/app/controllers/grafanaCtrl.js
+5
-2
src/app/controllers/row.js
+9
-1
src/app/partials/dashboard.html
+1
-1
No files found.
src/app/controllers/dash.js
View file @
cd79b73c
...
@@ -84,10 +84,6 @@ function (angular, $, config, _) {
...
@@ -84,10 +84,6 @@ function (angular, $, config, _) {
};
};
};
};
$scope
.
row_style
=
function
(
row
)
{
return
{
'min-height'
:
row
.
collapse
?
'5px'
:
row
.
height
};
};
$scope
.
panel_path
=
function
(
type
)
{
$scope
.
panel_path
=
function
(
type
)
{
if
(
type
)
{
if
(
type
)
{
return
'app/panels/'
+
type
.
replace
(
"."
,
"/"
);
return
'app/panels/'
+
type
.
replace
(
"."
,
"/"
);
...
...
src/app/controllers/grafanaCtrl.js
View file @
cd79b73c
...
@@ -78,10 +78,8 @@ function (angular, config, _, $) {
...
@@ -78,10 +78,8 @@ function (angular, config, _, $) {
$scope
.
initProfiling
=
function
()
{
$scope
.
initProfiling
=
function
()
{
var
count
=
0
;
var
count
=
0
;
console
.
log
(
"registering digest counter"
);
$scope
.
$watch
(
function
digestCounter
()
{
$scope
.
$watch
(
function
digestCounter
()
{
console
.
log
(
1
);
count
++
;
count
++
;
},
function
()
{
},
function
()
{
});
});
...
@@ -96,6 +94,11 @@ function (angular, config, _, $) {
...
@@ -96,6 +94,11 @@ function (angular, config, _, $) {
var
timeTaken
=
$rootScope
.
performance
.
allPanelsInitialized
-
$rootScope
.
performance
.
dashboardLoadStart
;
var
timeTaken
=
$rootScope
.
performance
.
allPanelsInitialized
-
$rootScope
.
performance
.
dashboardLoadStart
;
console
.
log
(
"Dashboard::Performance - All panels initialized in "
+
timeTaken
+
" ms"
);
console
.
log
(
"Dashboard::Performance - All panels initialized in "
+
timeTaken
+
" ms"
);
var
rootDigestStart
=
window
.
performance
.
now
();
$rootScope
.
$apply
();
console
.
log
(
"Dashboard::Performance Root Digest "
+
(
window
.
performance
.
now
()
-
rootDigestStart
));
},
3000
);
},
3000
);
});
});
...
...
src/app/controllers/row.js
View file @
cd79b73c
...
@@ -32,7 +32,7 @@ function (angular, app, _) {
...
@@ -32,7 +32,7 @@ function (angular, app, _) {
}
}
};
};
// This can be overridden by individual panels
// This can be overridden by individual panels
$scope
.
close_edit
=
function
()
{
$scope
.
close_edit
=
function
()
{
$scope
.
$broadcast
(
'render'
);
$scope
.
$broadcast
(
'render'
);
};
};
...
@@ -108,4 +108,12 @@ function (angular, app, _) {
...
@@ -108,4 +108,12 @@ function (angular, app, _) {
});
});
module
.
directive
(
'rowHeight'
,
function
()
{
return
function
(
scope
,
element
)
{
scope
.
$watchGroup
([
'row.collapse'
,
'row.height'
],
function
()
{
element
[
0
].
style
.
minHeight
=
scope
.
row
.
collapse
?
'5px'
:
scope
.
row
.
height
;
});
};
});
});
});
src/app/partials/dashboard.html
View file @
cd79b73c
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<div>
<div>
<div
class=
"grafana-container container"
>
<div
class=
"grafana-container container"
>
<!-- Rows -->
<!-- Rows -->
<div
class=
"grafana-row"
ng-controller=
"RowCtrl"
ng-repeat=
"(row_name, row) in dashboard.rows"
ng-style=
"row_style(row)"
>
<div
class=
"grafana-row"
ng-controller=
"RowCtrl"
ng-repeat=
"(row_name, row) in dashboard.rows"
row-height
>
<div
class=
"row-control"
>
<div
class=
"row-control"
>
<div
class=
"row-control-inner"
style=
"padding:0px;margin:0px;position:relative;"
>
<div
class=
"row-control-inner"
style=
"padding:0px;margin:0px;position:relative;"
>
<div
class=
"row-close"
ng-show=
"row.collapse"
data-placement=
"bottom"
>
<div
class=
"row-close"
ng-show=
"row.collapse"
data-placement=
"bottom"
>
...
...
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