[Alertlist] Set max-height to respect row height (#6454)

* feat(alertlist): max-height to respect row height

closes #6417

* feat(alertlist): use pre calculated panel.height instead

* style(alertlist): rearrange variable order
pull/6460/head
Carl Bergquist 9 years ago committed by GitHub
parent c138b04c5e
commit 61c48aecc2
  1. 8
      public/app/plugins/panel/alertlist/editor.html
  2. 2
      public/app/plugins/panel/alertlist/module.html
  3. 3
      public/app/plugins/panel/alertlist/module.ts
  4. 1
      public/sass/_grafana.scss
  5. 3
      public/sass/components/_panel_alertlist.scss

@ -20,12 +20,4 @@
<gf-form-switch class="gf-form" label="Execution error" label-class="width-10" checked="ctrl.stateFilter['execution_error']" on-change="ctrl.updateStateFilter()"></gf-form-switch>
<gf-form-switch class="gf-form" label="Alerting" label-class="width-10" checked="ctrl.stateFilter['alerting']" on-change="ctrl.updateStateFilter()"></gf-form-switch>
</div>
<div class="section gf-form-group" ng-if="ctrl.panel.show == 'changes'">
<!-- <h5 class="section-heading">Current state</h5> -->
</div>
<div class="section gf-form-group" ng-if="ctrl.panel.show == 'current'">
<!-- <h5 class="section-heading">Current state</h5> -->
</div>
</div>

@ -1,4 +1,4 @@
<div class="panel-alert-list">
<div class="panel-alert-list" style="{{ctrl.contentHeight}}">
<section class="card-section card-list-layout-list" ng-if="ctrl.panel.show === 'current'">
<ol class="card-list">
<li class="card-item-wrapper" ng-repeat="alert in ctrl.currentAlerts">

@ -17,6 +17,7 @@ class AlertListPanel extends PanelCtrl {
{text: 'Recent state changes', value: 'changes'}
];
contentHeight: string;
stateFilter: any = {};
currentAlerts: any = [];
alertHistory: any = [];
@ -27,6 +28,7 @@ class AlertListPanel extends PanelCtrl {
stateFilter: []
};
/** @ngInject */
constructor($scope, $injector, private $location, private backendSrv, private timeSrv, private templateSrv) {
super($scope, $injector);
@ -55,6 +57,7 @@ class AlertListPanel extends PanelCtrl {
}
onRender() {
this.contentHeight = "max-height: " + this.height + "px;";
if (this.panel.show === 'current') {
this.getCurrentAlertState();
}

@ -41,6 +41,7 @@
@import "components/tags";
@import "components/panel_graph";
@import "components/submenu";
@import "components/panel_alertlist";
@import "components/panel_dashlist";
@import "components/panel_pluginlist";
@import "components/panel_singlestat";

@ -0,0 +1,3 @@
.panel-alert-list {
overflow-y: scroll;
}
Loading…
Cancel
Save