mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-06 18:00:57 +00:00
perf: 账号备份增加sftp方式 (#12032)
* perf: 添加sftp支持 * perf: 账号备份增加sftp方式 --------- Co-authored-by: wangruidong <940853815@qq.com> Co-authored-by: Bryan <jiangjie.bai@fit2cloud.com>
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
from django.template.loader import render_to_string
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from common.tasks import send_mail_attachment_async
|
||||
from common.tasks import send_mail_attachment_async, upload_backup_to_obj_storage
|
||||
from notifications.notifications import UserMessage
|
||||
from users.models import User
|
||||
from terminal.models.component.storage import ReplayStorage
|
||||
|
||||
|
||||
class AccountBackupExecutionTaskMsg(object):
|
||||
@@ -31,6 +32,25 @@ class AccountBackupExecutionTaskMsg(object):
|
||||
)
|
||||
|
||||
|
||||
class AccountBackupByObjStorageExecutionTaskMsg(object):
|
||||
subject = _('Notification of account backup route task results')
|
||||
|
||||
def __init__(self, name: str, obj_storage: ReplayStorage):
|
||||
self.name = name
|
||||
self.obj_storage = obj_storage
|
||||
|
||||
@property
|
||||
def message(self):
|
||||
name = self.name
|
||||
return _('{} - The account backup passage task has been completed.'
|
||||
' See the attachment for details').format(name)
|
||||
|
||||
def publish(self, attachment_list=None):
|
||||
upload_backup_to_obj_storage(
|
||||
self.obj_storage, attachment_list
|
||||
)
|
||||
|
||||
|
||||
class ChangeSecretExecutionTaskMsg(object):
|
||||
subject = _('Notification of implementation result of encryption change plan')
|
||||
|
||||
|
Reference in New Issue
Block a user