mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
added chekbox and other tweaks
This commit is contained in:
@@ -44,8 +44,8 @@ const panelTemplate = `
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<button class="panel-editor-tabs__close" ng-click="ctrl.exitFullscreen();">
|
||||
<i class="fa fa-reply"></i>
|
||||
<button class="tabbed-view-close-btn" ng-click="ctrl.exitFullscreen();">
|
||||
<i class="fa fa-remove"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -80,6 +80,16 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => {
|
||||
let lastAlertState;
|
||||
let hasAlertRule;
|
||||
|
||||
function mouseEnter() {
|
||||
panelContainer.toggleClass('panel-hover-highlight', true);
|
||||
ctrl.dashboard.setPanelFocus(ctrl.panel.id);
|
||||
}
|
||||
|
||||
function mouseLeave() {
|
||||
panelContainer.toggleClass('panel-hover-highlight', false);
|
||||
ctrl.dashboard.setPanelFocus(0);
|
||||
}
|
||||
|
||||
function resizeScrollableContent() {
|
||||
if (panelScrollbar) {
|
||||
panelScrollbar.update();
|
||||
@@ -130,6 +140,19 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => {
|
||||
});
|
||||
});
|
||||
|
||||
ctrl.events.on('view-mode-changed', () => {
|
||||
// first wait one pass for dashboard fullscreen view mode to take effect (classses being applied)
|
||||
setTimeout(() => {
|
||||
// then recalc style
|
||||
ctrl.calculatePanelHeight();
|
||||
// then wait another cycle (this might not be needed)
|
||||
$timeout(() => {
|
||||
ctrl.render();
|
||||
resizeScrollableContent();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// set initial height
|
||||
ctrl.calculatePanelHeight();
|
||||
|
||||
@@ -151,7 +174,11 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => {
|
||||
panelContainer.removeClass('panel-alert-state--' + lastAlertState);
|
||||
}
|
||||
|
||||
if (ctrl.alertState.state === 'ok' || ctrl.alertState.state === 'alerting') {
|
||||
if (
|
||||
ctrl.alertState.state === 'ok' ||
|
||||
ctrl.alertState.state === 'alerting' ||
|
||||
ctrl.alertState.state === 'pending'
|
||||
) {
|
||||
panelContainer.addClass('panel-alert-state--' + ctrl.alertState.state);
|
||||
}
|
||||
|
||||
@@ -202,6 +229,9 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => {
|
||||
scope.$apply(ctrl.openInspector.bind(ctrl));
|
||||
});
|
||||
|
||||
elem.on('mouseenter', mouseEnter);
|
||||
elem.on('mouseleave', mouseLeave);
|
||||
|
||||
scope.$on('$destroy', () => {
|
||||
elem.off();
|
||||
cornerInfoElem.off();
|
||||
|
||||
Reference in New Issue
Block a user