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
68bd17bd
Commit
68bd17bd
authored
Nov 22, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
work on scrollable panels
parent
18ca7a53
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
43 deletions
+32
-43
public/app/features/panel/panel_ctrl.ts
+13
-6
public/app/features/panel/panel_directive.ts
+16
-24
public/app/features/plugins/plugin_component.ts
+1
-0
public/app/plugins/panel/dashlist/module.ts
+0
-2
public/app/plugins/panel/pluginlist/module.ts
+2
-2
public/app/plugins/panel/singlestat/module.ts
+0
-9
public/img/tgr288gear_line6.pdf
+0
-0
No files found.
public/app/features/panel/panel_ctrl.ts
View file @
68bd17bd
...
...
@@ -45,16 +45,24 @@ export class PanelCtrl {
}
$scope
.
$on
(
"refresh"
,
()
=>
this
.
refresh
());
$scope
.
$on
(
"component-did-mount"
,
()
=>
this
.
panelDidMount
());
$scope
.
$on
(
"$destroy"
,
()
=>
{
this
.
events
.
emit
(
'panel-teardown'
);
this
.
events
.
removeAllListeners
();
});
this
.
calculatePanelHeight
();
}
init
()
{
this
.
events
.
on
(
'panel-size-changed'
,
this
.
onSizeChanged
.
bind
(
this
));
this
.
publishAppEvent
(
'panel-initialized'
,
{
scope
:
this
.
$scope
});
this
.
events
.
emit
(
'panel-initialized'
);
this
.
publishAppEvent
(
'panel-initialized'
,
{
scope
:
this
.
$scope
});
}
panelDidMount
()
{
this
.
events
.
emit
(
'component-did-mount'
);
}
renderingCompleted
()
{
...
...
@@ -62,7 +70,6 @@ export class PanelCtrl {
}
refresh
()
{
this
.
setPanelHeight
();
this
.
events
.
emit
(
'refresh'
,
null
);
}
...
...
@@ -171,14 +178,14 @@ export class PanelCtrl {
}
setPanelHeight
()
{
if
(
this
.
$scope
.
setPanelHeight
)
{
this
.
$scope
.
setPanelHeight
();
}
// console.log('setPanelHeight');
// if (this.$scope.setPanelHeight) {
// this.$scope.setPanelHeight();
// }
}
render
(
payload
?)
{
this
.
timing
.
renderStart
=
new
Date
().
getTime
();
this
.
setPanelHeight
();
this
.
events
.
emit
(
'render'
,
payload
);
}
...
...
public/app/features/panel/panel_directive.ts
View file @
68bd17bd
...
...
@@ -73,7 +73,7 @@ module.directive('grafanaPanel', function($rootScope, $document) {
var
lastHasAlertRule
=
false
;
var
lastAlertState
;
var
hasAlertRule
;
//
var lastHeight = 0;
var
lastHeight
=
0
;
function
mouseEnter
()
{
panelContainer
.
toggleClass
(
'panel-hover-highlight'
,
true
);
...
...
@@ -85,28 +85,11 @@ module.directive('grafanaPanel', function($rootScope, $document) {
ctrl
.
dashboard
.
setPanelFocus
(
0
);
}
// set initial height
if
(
!
ctrl
.
height
)
{
ctrl
.
calculatePanelHeight
();
if
(
ctrl
.
__proto__
.
constructor
.
scrollable
)
{
panelContent
.
addClass
(
'panel-content--scrollable'
);
panelScrollbar
=
new
GeminiScrollbar
({
autoshow
:
false
,
element
:
panelContent
[
0
]
}).
create
();
}
}
function
setPanelHeight
()
{
panelContent
.
height
(
ctrl
.
height
);
function
panelHeightUpdated
()
{
if
(
panelScrollbar
)
{
panelScrollbar
.
update
();
}
}
if
(
ctrl
.
__proto__
.
constructor
.
scrollable
)
{
ctrl
.
$scope
.
setPanelHeight
=
setPanelHeight
;
lastHeight
=
ctrl
.
height
;
}
// set initial transparency
...
...
@@ -115,11 +98,20 @@ module.directive('grafanaPanel', function($rootScope, $document) {
panelContainer
.
addClass
(
'panel-transparent'
,
true
);
}
if
(
ctrl
.
__proto__
.
constructor
.
scrollable
)
{
panelContent
.
addClass
(
'panel-content--scrollable'
);
panelScrollbar
=
new
GeminiScrollbar
({
autoshow
:
false
,
element
:
panelContent
[
0
]
}).
create
();
}
// update scrollbar after mounting
ctrl
.
events
.
on
(
'component-did-mount'
,
()
=>
{
panelHeightUpdated
();
});
ctrl
.
events
.
on
(
'render'
,
()
=>
{
// if (lastHeight !== ctrl.height) {
// panelContent.css({'height': ctrl.height + 'px'});
// lastHeight = ctrl.height;
// }
if
(
lastHeight
!==
ctrl
.
height
)
{
panelHeightUpdated
();
}
if
(
transparentLastState
!==
ctrl
.
panel
.
transparent
)
{
panelContainer
.
toggleClass
(
'panel-transparent'
,
ctrl
.
panel
.
transparent
===
true
);
...
...
public/app/features/plugins/plugin_component.ts
View file @
68bd17bd
...
...
@@ -221,6 +221,7 @@ function pluginDirectiveLoader($compile, datasourceSrv, $rootScope, $q, $http, $
setTimeout
(
function
()
{
elem
.
append
(
child
);
scope
.
$applyAsync
(
function
()
{
scope
.
$broadcast
(
'component-did-mount'
);
scope
.
$broadcast
(
'refresh'
);
});
});
...
...
public/app/plugins/panel/dashlist/module.ts
View file @
68bd17bd
///<reference path="../../../headers/common.d.ts" />
import
_
from
'lodash'
;
import
{
PanelCtrl
}
from
'app/plugins/sdk'
;
import
{
impressions
}
from
'app/features/dashboard/impression_store'
;
...
...
public/app/plugins/panel/pluginlist/module.ts
View file @
68bd17bd
///<reference path="../../../headers/common.d.ts" />
import
_
from
'lodash'
;
import
{
PanelCtrl
}
from
'../../../features/panel/panel_ctrl'
;
class
PluginListCtrl
extends
PanelCtrl
{
static
templateUrl
=
'module.html'
;
static
scrollable
=
true
;
pluginList
:
any
[];
viewModel
:
any
;
...
...
@@ -15,6 +14,7 @@ class PluginListCtrl extends PanelCtrl {
/** @ngInject */
constructor
(
$scope
,
$injector
,
private
backendSrv
,
private
$location
)
{
super
(
$scope
,
$injector
);
_
.
defaults
(
this
.
panel
,
this
.
panelDefaults
);
this
.
events
.
on
(
'init-edit-mode'
,
this
.
onInitEditMode
.
bind
(
this
));
...
...
public/app/plugins/panel/singlestat/module.ts
View file @
68bd17bd
...
...
@@ -395,11 +395,6 @@ class SingleStatCtrl extends MetricsPanelCtrl {
var
data
,
linkInfo
;
var
$panelContainer
=
elem
.
find
(
'.panel-container'
);
elem
=
elem
.
find
(
'.singlestat-panel'
);
console
.
log
(
'singlestat element'
,
elem
.
length
);
function
setElementHeight
()
{
/// elem.css('height', ctrl.height + 'px');
}
function
applyColoringThresholds
(
value
,
valueString
)
{
if
(
!
panel
.
colorValue
)
{
...
...
@@ -561,8 +556,6 @@ class SingleStatCtrl extends MetricsPanelCtrl {
plotCss
.
height
=
Math
.
floor
(
height
*
0.25
)
+
"px"
;
}
console
.
log
(
'singlestat height'
,
ctrl
.
height
);
console
.
log
(
'singlestat plotCss'
,
plotCss
.
height
);
plotCanvas
.
css
(
plotCss
);
var
options
=
{
...
...
@@ -607,8 +600,6 @@ class SingleStatCtrl extends MetricsPanelCtrl {
});
data
.
colorMap
=
panel
.
colors
;
setElementHeight
();
var
body
=
panel
.
gauge
.
show
?
''
:
getBigValueHtml
();
if
(
panel
.
colorBackground
)
{
...
...
public/img/tgr288gear_line6.pdf
0 → 100644
View file @
68bd17bd
File added
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