feat(notify): add action 'change_ipaddr' for notify topic

This commit is contained in:
rainzm
2021-06-24 10:29:35 +08:00
parent 066efeea65
commit 7630589465
3 changed files with 6 additions and 0 deletions
+1
View File
@@ -32,6 +32,7 @@ var (
ActionResize SAction = "resize"
ActionExpiredRelease SAction = "expired_release"
ActionExecute SAction = "execute"
ActionChangeIpaddr SAction = "change_ipaddr"
)
const (
+1
View File
@@ -151,6 +151,7 @@ var action2Topic = make(map[string]string, 0)
func init() {
action2Topic[string(api.ActionRebuildRoot)] = string(api.ActionUpdate)
action2Topic[string(api.ActionResetPassword)] = string(api.ActionUpdate)
action2Topic[string(api.ActionChangeIpaddr)] = string(api.ActionUpdate)
}
func (lt *SLocalTemplateManager) fillWithTemplate(ctx context.Context, titleOrContent string, contactType string, lang string, event api.SEvent, dis jsonutils.JSONObject) (string, error) {
+4
View File
@@ -149,6 +149,9 @@ func (sm *STopicManager) InitializeData() error {
notify.TOPIC_RESOURCE_ELASTICCACHE,
)
t.addAction(notify.ActionUpdate)
t.addAction(notify.ActionRebuildRoot)
t.addAction(notify.ActionResetPassword)
t.addAction(notify.ActionChangeIpaddr)
t.Type = notify.TOPIC_TYPE_RESOURCE
case DefaultResourceReleaseDue1Day:
t.addResources(
@@ -340,6 +343,7 @@ func init() {
notify.ActionChangeConfig,
notify.ActionExpiredRelease,
notify.ActionExecute,
notify.ActionChangeIpaddr,
)
}