fix(monitor): add metric content for email template (#21568)

This commit is contained in:
Zexi Li
2024-11-11 16:09:35 +08:00
committed by GitHub
parent 1a24f1c6f6
commit 896e0889ec
3 changed files with 11 additions and 6 deletions

View File

@@ -108,6 +108,7 @@
<td>名称</td> <td>名称</td>
<td>IP</td> <td>IP</td>
<td>平台</td> <td>平台</td>
<td>指标</td>
<td>触发值</td> <td>触发值</td>
</tr> </tr>
</thead> </thead>
@@ -124,7 +125,8 @@
<td> <td>
{{ index .tags "brand" }} {{ index .tags "brand" }}
</td> </td>
<td>{{$Matche.value_str}}</td> <td>{{ $Matche.metric }}</td>
<td>{{ $Matche.value_str }}</td>
</tr> </tr>
{{end}} {{end}}
</tbody> </tbody>

View File

@@ -108,6 +108,7 @@
<td>Name</td> <td>Name</td>
<td>IP</td> <td>IP</td>
<td>Brand</td> <td>Brand</td>
<td>Metric</td>
<td>Trigger value</td> <td>Trigger value</td>
</tr> </tr>
</thead> </thead>
@@ -124,7 +125,8 @@
<td> <td>
{{ index .tags "brand" }} {{ index .tags "brand" }}
</td> </td>
<td>{{$Matche.value_str}}</td> <td>{{ $Matche.metric }}</td>
<td>{{ $Matche.value_str }}</td>
</tr> </tr>
{{end}} {{end}}
</tbody> </tbody>

View File

@@ -471,7 +471,8 @@ func (s *sendUserImpl) send() error {
} }
func (s *sendUserImpl) execNotifyFunc() error { func (s *sendUserImpl) execNotifyFunc() error {
return notifyclient.NotifyAllWithoutRobotWithCtx(s.Ctx, s.msg.Uid, false, notify.TNotifyPriority(s.msg.Priority), return notifyclient.NotifyAllWithoutRobotWithCtx(
s.Ctx, s.msg.Uid, false, s.msg.Priority,
"DEFAULT", jsonutils.Marshal(&s.config)) "DEFAULT", jsonutils.Marshal(&s.config))
} }
@@ -484,7 +485,7 @@ func (s *sendSysImpl) send() error {
} }
func (s *sendSysImpl) execNotifyFunc() error { func (s *sendSysImpl) execNotifyFunc() error {
notifyclient.SystemNotifyWithCtx(s.Ctx, notify.TNotifyPriority(s.msg.Priority), "DEFAULT", notifyclient.SystemNotifyWithCtx(s.Ctx, s.msg.Priority, "DEFAULT",
jsonutils.Marshal(&s.config)) jsonutils.Marshal(&s.config))
return nil return nil
} }
@@ -499,7 +500,7 @@ func (s *sendMobileImpl) send() error {
return err return err
} }
notifyclient.RawNotifyWithCtx(s.Ctx, s.msg.Uid, false, notify.TNotifyChannel(s.Setting.Channel), notifyclient.RawNotifyWithCtx(s.Ctx, s.msg.Uid, false, notify.TNotifyChannel(s.Setting.Channel),
notify.TNotifyPriority(s.msg.Priority), s.msg.Priority,
s.msg.Topic, s.msg.Topic,
msgObj) msgObj)
return nil return nil
@@ -514,7 +515,7 @@ func (s *sendRobotImpl) send() error {
} }
func (s *sendRobotImpl) execNotifyFunc() error { func (s *sendRobotImpl) execNotifyFunc() error {
return notifyclient.NotifyRobotWithCtx(s.Ctx, s.msg.Robots, notify.TNotifyPriority(s.msg.Priority), return notifyclient.NotifyRobotWithCtx(s.Ctx, s.msg.Robots, s.msg.Priority,
"DEFAULT", jsonutils.Marshal(&s.config)) "DEFAULT", jsonutils.Marshal(&s.config))
} }