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
18c73631
Commit
18c73631
authored
Oct 16, 2018
by
Dave Waters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename UI Option, align with control, update tests
parent
6376154b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
14 deletions
+16
-14
pkg/services/sqlstore/alert_notification_test.go
+14
-12
public/app/features/alerting/partials/notification_edit.html
+2
-2
No files found.
pkg/services/sqlstore/alert_notification_test.go
View file @
18c73631
...
@@ -227,18 +227,20 @@ func TestAlertNotificationSQLAccess(t *testing.T) {
...
@@ -227,18 +227,20 @@ func TestAlertNotificationSQLAccess(t *testing.T) {
Convey
(
"Can update alert notification"
,
func
()
{
Convey
(
"Can update alert notification"
,
func
()
{
newCmd
:=
&
models
.
UpdateAlertNotificationCommand
{
newCmd
:=
&
models
.
UpdateAlertNotificationCommand
{
Name
:
"NewName"
,
Name
:
"NewName"
,
Type
:
"webhook"
,
Type
:
"webhook"
,
OrgId
:
cmd
.
Result
.
OrgId
,
OrgId
:
cmd
.
Result
.
OrgId
,
SendReminder
:
true
,
SendReminder
:
true
,
Frequency
:
"60s"
,
DisableResolvedMessage
:
true
,
Settings
:
simplejson
.
New
(),
Frequency
:
"60s"
,
Id
:
cmd
.
Result
.
Id
,
Settings
:
simplejson
.
New
(),
Id
:
cmd
.
Result
.
Id
,
}
}
err
:=
UpdateAlertNotification
(
newCmd
)
err
:=
UpdateAlertNotification
(
newCmd
)
So
(
err
,
ShouldBeNil
)
So
(
err
,
ShouldBeNil
)
So
(
newCmd
.
Result
.
Name
,
ShouldEqual
,
"NewName"
)
So
(
newCmd
.
Result
.
Name
,
ShouldEqual
,
"NewName"
)
So
(
newCmd
.
Result
.
Frequency
,
ShouldEqual
,
60
*
time
.
Second
)
So
(
newCmd
.
Result
.
Frequency
,
ShouldEqual
,
60
*
time
.
Second
)
So
(
newCmd
.
Result
.
DisableResolvedMessage
,
ShouldBeTrue
)
})
})
Convey
(
"Can update alert notification to disable sending of reminders"
,
func
()
{
Convey
(
"Can update alert notification to disable sending of reminders"
,
func
()
{
...
@@ -257,12 +259,12 @@ func TestAlertNotificationSQLAccess(t *testing.T) {
...
@@ -257,12 +259,12 @@ func TestAlertNotificationSQLAccess(t *testing.T) {
})
})
Convey
(
"Can search using an array of ids"
,
func
()
{
Convey
(
"Can search using an array of ids"
,
func
()
{
cmd1
:=
models
.
CreateAlertNotificationCommand
{
Name
:
"nagios"
,
Type
:
"webhook"
,
OrgId
:
1
,
SendReminder
:
true
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
cmd1
:=
models
.
CreateAlertNotificationCommand
{
Name
:
"nagios"
,
Type
:
"webhook"
,
OrgId
:
1
,
SendReminder
:
true
,
DisableResolvedMessage
:
false
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
cmd2
:=
models
.
CreateAlertNotificationCommand
{
Name
:
"slack"
,
Type
:
"webhook"
,
OrgId
:
1
,
SendReminder
:
true
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
cmd2
:=
models
.
CreateAlertNotificationCommand
{
Name
:
"slack"
,
Type
:
"webhook"
,
OrgId
:
1
,
SendReminder
:
true
,
DisableResolvedMessage
:
false
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
cmd3
:=
models
.
CreateAlertNotificationCommand
{
Name
:
"ops2"
,
Type
:
"email"
,
OrgId
:
1
,
SendReminder
:
true
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
cmd3
:=
models
.
CreateAlertNotificationCommand
{
Name
:
"ops2"
,
Type
:
"email"
,
OrgId
:
1
,
SendReminder
:
true
,
DisableResolvedMessage
:
false
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
cmd4
:=
models
.
CreateAlertNotificationCommand
{
IsDefault
:
true
,
Name
:
"default"
,
Type
:
"email"
,
OrgId
:
1
,
SendReminder
:
true
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
cmd4
:=
models
.
CreateAlertNotificationCommand
{
IsDefault
:
true
,
Name
:
"default"
,
Type
:
"email"
,
OrgId
:
1
,
SendReminder
:
true
,
DisableResolvedMessage
:
false
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
otherOrg
:=
models
.
CreateAlertNotificationCommand
{
Name
:
"default"
,
Type
:
"email"
,
OrgId
:
2
,
SendReminder
:
true
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
otherOrg
:=
models
.
CreateAlertNotificationCommand
{
Name
:
"default"
,
Type
:
"email"
,
OrgId
:
2
,
SendReminder
:
true
,
DisableResolvedMessage
:
false
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
So
(
CreateAlertNotificationCommand
(
&
cmd1
),
ShouldBeNil
)
So
(
CreateAlertNotificationCommand
(
&
cmd1
),
ShouldBeNil
)
So
(
CreateAlertNotificationCommand
(
&
cmd2
),
ShouldBeNil
)
So
(
CreateAlertNotificationCommand
(
&
cmd2
),
ShouldBeNil
)
...
...
public/app/features/alerting/partials/notification_edit.html
View file @
18c73631
...
@@ -34,10 +34,10 @@
...
@@ -34,10 +34,10 @@
</gf-form-switch>
</gf-form-switch>
<gf-form-switch
<gf-form-switch
class=
"gf-form"
class=
"gf-form"
label=
"Disable
OK Alert
"
label=
"Disable
Resolved Message
"
label-class=
"width-12"
label-class=
"width-12"
checked=
"ctrl.model.disableResolvedMessage"
checked=
"ctrl.model.disableResolvedMessage"
tooltip=
"Disable the
OK Alert
that is sent when alerting state returns to false"
>
tooltip=
"Disable the
resolved message [OK]
that is sent when alerting state returns to false"
>
</gf-form-switch>
</gf-form-switch>
<gf-form-switch
<gf-form-switch
class=
"gf-form"
class=
"gf-form"
...
...
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