Browse Source

fix(alerting): various alerting fixes

Torkel Ödegaard 9 years ago
parent
commit
2d19af601a

+ 22 - 0
docs/sources/installation/configuration.md

@@ -579,3 +579,25 @@ Enabled to automatically remove expired snapshots
 
 ### remove snapshots after 90 days
 Time to live for snapshots.
+
+## [external_image_storage]
+These options control how images should be made public so they can be shared on services like slack.
+
+### provider
+You can choose between (s3, webdav)
+
+## [external_image_storage.s3]
+
+### bucket_url
+
+### access_key
+
+### secret_key
+
+## [external_image_storage.webdav]
+
+### url
+
+### username
+
+### password

+ 2 - 2
pkg/api/alerting.go

@@ -175,10 +175,10 @@ func GetAlertNotifications(c *middleware.Context) Response {
 		return ApiError(500, "Failed to get alert notifications", err)
 	}
 
-	var result []dtos.AlertNotification
+	result := make([]*dtos.AlertNotification, 0)
 
 	for _, notification := range query.Result {
-		result = append(result, dtos.AlertNotification{
+		result = append(result, &dtos.AlertNotification{
 			Id:        notification.Id,
 			Name:      notification.Name,
 			Type:      notification.Type,

+ 1 - 2
public/app/features/alerting/alert_tab_ctrl.ts

@@ -53,11 +53,10 @@ export class AlertTabCtrl {
     this.panelCtrl.events.on('threshold-changed', thresholdChangedEventHandler);
 
     // set panel alert edit mode
-    var unbind = this.$scope.$on("$destroy", () => {
+    this.$scope.$on("$destroy", () => {
       this.panelCtrl.events.off("threshold-changed", thresholdChangedEventHandler);
       this.panelCtrl.editingThresholds = false;
       this.panelCtrl.render();
-      unbind();
     });
 
     // build notification model

+ 1 - 1
public/app/features/dashboard/row/row.html

@@ -17,7 +17,7 @@
 </div>
 
 <div class="panels-wrapper" ng-if="!ctrl.row.collapse">
-  <div class="dash-row-menu-container" data-click-hide>
+  <div class="dash-row-menu-container" data-click-hide ng-hide="ctrl.dashboard.meta.fullscreen">
     <ul class="dash-row-menu" role="menu">
       <li>
         <a ng-click="ctrl.toggleCollapse()">

+ 1 - 1
public/app/features/panel/partials/soloPanel.html

@@ -1,4 +1,4 @@
-<div class="panel nospace" ng-if="panel" style="width: 100%">
+<div class="panel panel--solo" ng-if="panel" style="width: 100%">
 	<plugin-component type="panel">
 	</plugin-component>
 </div>

+ 8 - 4
public/app/features/panel/solo_panel_ctrl.js

@@ -26,13 +26,17 @@ function (angular, $) {
     };
 
     $scope.initPanelScope = function() {
-      $scope.row = {
-        height: $(window).height() + 'px',
+      var panelInfo = $scope.dashboard.getPanelInfoById(panelId);
+
+      // fake row ctrl scope
+      $scope.ctrl = {
+        row: panelInfo.row,
+        dashboard: $scope.dashboard,
       };
 
-      $scope.test = "Hej";
+      $scope.ctrl.row.height = $(window).height();
+      $scope.panel = panelInfo.panel;
       $scope.$index = 0;
-      $scope.panel = $scope.dashboard.getPanelById(panelId);
 
       if (!$scope.panel) {
         $scope.appEvent('alert-error', ['Panel not found', '']);

+ 1 - 1
public/app/partials/dashboard.html

@@ -16,7 +16,7 @@
 
 	<div ng-show='dashboardMeta.canEdit' class="row-fluid add-row-panel-hint">
 		<div class="span12" style="text-align:right;">
-			<span style="margin-right: 10px;" ng-click="addRowDefault()" class="pointer btn btn-secondary btn-small">
+			<span style="margin-right: 10px;" ng-click="addRowDefault()" class="pointer btn btn-inverse btn-small">
 				<span><i class="fa fa-plus"></i> ADD ROW</span>
 			</span>
 		</div>

+ 1 - 1
public/app/plugins/panel/graph/threshold_manager.ts

@@ -100,7 +100,7 @@ export class ThresholdManager {
       handleTopPos = defaultHandleTopPos;
     } else {
       var valueCanvasPos = this.plot.p2c({x: 0, y: value});
-      handleTopPos = Math.min(Math.max(valueCanvasPos.top, 0), this.height) - 6;
+      handleTopPos = Math.round(Math.min(Math.max(valueCanvasPos.top, 0), this.height) - 6);
     }
 
     var handleElem = $(this.getHandleHtml(handleIndex, model, valueStr));

+ 2 - 2
public/sass/components/_panel_graph.scss

@@ -373,8 +373,8 @@
   }
 
   &--T0{
-    right: -105px;
-    width: 128px;
+    right: -104px;
+    width: 129px;
 
     .alert-handle-line {
       width: 28px;

+ 9 - 0
public/sass/pages/_dashboard.scss

@@ -22,6 +22,15 @@ div.flot-text {
 .panel {
   display: inline-block;
   float: left;
+
+  &--solo {
+    .resize-panel-handle {
+      display: none;
+    }
+    .panel-container {
+      border: none;
+    }
+  }
 }
 
 .panel-margin {