Commit 2d19af60 by Torkel Ödegaard

fix(alerting): various alerting fixes

parent 05c124bb
......@@ -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
......@@ -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,
......
......@@ -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
......
......@@ -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()">
......
<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>
......
......@@ -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', '']);
......
......@@ -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>
......
......@@ -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));
......
......@@ -373,8 +373,8 @@
}
&--T0{
right: -105px;
width: 128px;
right: -104px;
width: 129px;
.alert-handle-line {
width: 28px;
......
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment