From b60573ff771c1b2e731e2310921373622f6313f6 Mon Sep 17 00:00:00 2001 From: mhf Date: Thu, 16 Feb 2023 11:38:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(notify):=20=E6=B7=BB=E5=8A=A0=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E6=9D=A5=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/notify/tasks/notifications_send_task.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/notify/tasks/notifications_send_task.go b/pkg/notify/tasks/notifications_send_task.go index e392ca914f..8c5a5ed03b 100644 --- a/pkg/notify/tasks/notifications_send_task.go +++ b/pkg/notify/tasks/notifications_send_task.go @@ -27,6 +27,7 @@ import ( "yunion.io/x/onecloud/pkg/cloudcommon/db" "yunion.io/x/onecloud/pkg/cloudcommon/db/taskman" "yunion.io/x/onecloud/pkg/notify/models" + "yunion.io/x/onecloud/pkg/notify/options" rpcapi "yunion.io/x/onecloud/pkg/notify/rpc/apis" "yunion.io/x/onecloud/pkg/util/logclient" ) @@ -167,6 +168,14 @@ func (self *NotificationSendTask) OnInit(ctx context.Context, obj db.IStandalone if err != nil { self.taskFailed(ctx, notification, err.Error(), false) } + + switch lang { + case apis.TEMPLATE_LANG_CN: + p.Message += "\n来自 " + options.Options.ApiServer + case apis.TEMPLATE_LANG_EN: + p.Message += "\nfrom " + options.Options.ApiServer + } + // set status before send now := time.Now() for _, rn := range receivers {