mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-18 16:39:28 +00:00
feat: 站内信 (#6183)
* 添加站内信 * s * s * 添加接口 * fix * fix * 重构了一些 * 完成 * 完善 * s * s * s * s * s * s * 测试ok * 替换业务中发送消息的方式 * 修改 * s * 去掉 update 兼容 create * 添加 unread total 接口 * 调整json字段 Co-authored-by: xinwen <coderWen@126.com>
This commit is contained in:
@@ -9,7 +9,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ugettext
|
||||
from django.db import models
|
||||
|
||||
from terminal.utils import send_command_execution_alert_mail
|
||||
from terminal.notifications import CommandExecutionAlert
|
||||
from common.utils import lazyproperty
|
||||
from orgs.models import Organization
|
||||
from orgs.mixins.models import OrgModelMixin
|
||||
@@ -99,12 +99,12 @@ class CommandExecution(OrgModelMixin):
|
||||
else:
|
||||
msg = _("Command `{}` is forbidden ........").format(self.command)
|
||||
print('\033[31m' + msg + '\033[0m')
|
||||
send_command_execution_alert_mail({
|
||||
CommandExecutionAlert({
|
||||
'input': self.command,
|
||||
'assets': self.hosts.all(),
|
||||
'user': str(self.user),
|
||||
'risk_level': 5,
|
||||
})
|
||||
}).publish_async()
|
||||
self.result = {"error": msg}
|
||||
self.org_id = self.run_as.org_id
|
||||
self.is_finished = True
|
||||
|
Reference in New Issue
Block a user