Migration: Migrate New notification channel page (#25265)
* creating page * add types select * adding switches * start with converting angular templates to json * converting more alert channels to new format * convert remaining channels * typing the form * add validation, update models * fix default value in type select * fix type * fix issue with validation rule * add missing settings * fix type errors * test notification * add comments to structs * fix selectable value and minor things on each channel * More typings * fix strictnull * rename ModelValue -> PropertyName * rename show -> showWhen * add enums and adding comments * fix comment * break out channel options to component * use try catch * adding default case to OptionElement if element not supported
This commit is contained in:
@@ -13,6 +13,7 @@ func init() {
|
||||
Type: "webhook",
|
||||
Name: "webhook",
|
||||
Description: "Sends HTTP POST request to a URL",
|
||||
Heading: "Webhook settings",
|
||||
Factory: NewWebHookNotifier,
|
||||
OptionsTemplate: `
|
||||
<h3 class="page-heading">Webhook settings</h3>
|
||||
@@ -36,6 +37,42 @@ func init() {
|
||||
<input type="text" class="gf-form-input max-width-14" ng-model="ctrl.model.settings.password"></input>
|
||||
</div>
|
||||
`,
|
||||
Options: []alerting.NotifierOption{
|
||||
{
|
||||
Label: "Url",
|
||||
Element: alerting.ElementTypeInput,
|
||||
InputType: alerting.InputTypeText,
|
||||
PropertyName: "url",
|
||||
Required: true,
|
||||
},
|
||||
{
|
||||
Label: "Http Method",
|
||||
Element: alerting.ElementTypeSelect,
|
||||
SelectOptions: []alerting.SelectOption{
|
||||
{
|
||||
Value: "POST",
|
||||
Label: "POST",
|
||||
},
|
||||
{
|
||||
Value: "PUT",
|
||||
Label: "PUT",
|
||||
},
|
||||
},
|
||||
PropertyName: "httpMethod",
|
||||
},
|
||||
{
|
||||
Label: "Username",
|
||||
Element: alerting.ElementTypeInput,
|
||||
InputType: alerting.InputTypeText,
|
||||
PropertyName: "username",
|
||||
},
|
||||
{
|
||||
Label: "Password",
|
||||
Element: alerting.ElementTypeInput,
|
||||
InputType: alerting.InputTypePassword,
|
||||
PropertyName: "password",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user