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
6b17cdbc
Commit
6b17cdbc
authored
Sep 06, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(alerting): Save As removes alerts from panels, closes #5965
parent
2ca7284a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
16 deletions
+31
-16
public/app/features/alerting/alert_tab_ctrl.ts
+23
-15
public/app/features/alerting/partials/alert_tab.html
+0
-1
public/app/features/dashboard/saveDashboardAsCtrl.js
+8
-0
No files found.
public/app/features/alerting/alert_tab_ctrl.ts
View file @
6b17cdbc
...
...
@@ -74,18 +74,20 @@ export class AlertTabCtrl {
this
.
alertNotifications
.
push
(
model
);
}
});
}).
then
(()
=>
{
this
.
backendSrv
.
get
(
`/api/alert-history?dashboardId=
${
this
.
panelCtrl
.
dashboard
.
id
}
&panelId=
${
this
.
panel
.
id
}
`
).
then
(
res
=>
{
this
.
alertHistory
=
_
.
map
(
res
,
ah
=>
{
ah
.
time
=
moment
(
ah
.
timestamp
).
format
(
'MMM D, YYYY HH:mm:ss'
);
ah
.
stateModel
=
alertDef
.
getStateDisplayModel
(
ah
.
newState
);
});
}
ah
.
metrics
=
_
.
map
(
ah
.
data
,
ev
=>
{
return
ev
.
Metric
+
"="
+
ev
.
Value
;
}).
join
(
', '
);
getAlertHistory
()
{
this
.
backendSrv
.
get
(
`/api/alert-history?dashboardId=
${
this
.
panelCtrl
.
dashboard
.
id
}
&panelId=
${
this
.
panel
.
id
}
`
).
then
(
res
=>
{
this
.
alertHistory
=
_
.
map
(
res
,
ah
=>
{
ah
.
time
=
moment
(
ah
.
timestamp
).
format
(
'MMM D, YYYY HH:mm:ss'
);
ah
.
stateModel
=
alertDef
.
getStateDisplayModel
(
ah
.
newState
);
return
ah
;
});
ah
.
metrics
=
_
.
map
(
ah
.
data
,
ev
=>
{
return
ev
.
Metric
+
"="
+
ev
.
Value
;
}).
join
(
', '
);
return
ah
;
});
});
}
...
...
@@ -125,7 +127,11 @@ export class AlertTabCtrl {
}
initModel
()
{
var
alert
=
this
.
alert
=
this
.
panel
.
alert
=
this
.
panel
.
alert
||
{};
var
alert
=
this
.
alert
=
this
.
panel
.
alert
=
this
.
panel
.
alert
||
{
enabled
:
false
};
if
(
!
this
.
alert
.
enabled
)
{
return
;
}
alert
.
conditions
=
alert
.
conditions
||
[];
if
(
alert
.
conditions
.
length
===
0
)
{
...
...
@@ -145,11 +151,9 @@ export class AlertTabCtrl {
return
memo
;
},
[]);
if
(
this
.
alert
.
enabled
)
{
this
.
panelCtrl
.
editingThresholds
=
true
;
}
ThresholdMapper
.
alertToGraphThresholds
(
this
.
panel
);
this
.
panelCtrl
.
editingThresholds
=
true
;
this
.
panelCtrl
.
render
();
}
...
...
@@ -173,6 +177,10 @@ export class AlertTabCtrl {
}
validateModel
()
{
if
(
!
this
.
alert
.
enabled
)
{
return
;
}
let
firstTarget
;
var
fixed
=
false
;
let
foundTarget
=
null
;
...
...
public/app/features/alerting/partials/alert_tab.html
View file @
6b17cdbc
...
...
@@ -65,7 +65,6 @@
<metric-segment-model
property=
"conditionModel.evaluator.type"
options=
"ctrl.evalFunctions"
custom=
"false"
css-class=
"query-keyword"
on-change=
"ctrl.evaluatorTypeChanged(conditionModel.evaluator)"
></metric-segment-model>
<input
class=
"gf-form-input max-width-7"
type=
"number"
ng-hide=
"conditionModel.evaluator.params.length === 0"
ng-model=
"conditionModel.evaluator.params[0]"
ng-change=
"ctrl.evaluatorParamsChanged()"
></input>
<label
class=
"gf-form-label query-keyword"
ng-show=
"conditionModel.evaluator.params.length === 2"
>
TO
</label>
<input
class=
"gf-form-input max-width-7"
type=
"number"
ng-if=
"conditionModel.evaluator.params.length === 2"
ng-model=
"conditionModel.evaluator.params[1]"
ng-change=
"ctrl.evaluatorParamsChanged()"
></input>
</div>
<div
class=
"gf-form"
>
<label
class=
"gf-form-label"
>
...
...
public/app/features/dashboard/saveDashboardAsCtrl.js
View file @
6b17cdbc
...
...
@@ -12,6 +12,14 @@ function (angular) {
$scope
.
clone
.
id
=
null
;
$scope
.
clone
.
editable
=
true
;
$scope
.
clone
.
title
=
$scope
.
clone
.
title
+
" Copy"
;
// remove alerts
$scope
.
clone
.
rows
.
forEach
(
function
(
row
)
{
row
.
panels
.
forEach
(
function
(
panel
)
{
delete
panel
.
alert
;
});
});
// remove auto update
delete
$scope
.
clone
.
autoUpdate
;
};
...
...
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