perf: 会话列表显示终端名称;修复启动 warning 问题

pull/8451/head^2
Jiangjie.Bai 2022-07-01 19:19:24 +08:00 committed by 老广
parent 62a2a74c27
commit 90228e69e0
1 changed files with 6 additions and 1 deletions

View File

@ -15,7 +15,7 @@ from applications.models import Application
from users.models import User from users.models import User
from orgs.mixins.models import OrgModelMixin from orgs.mixins.models import OrgModelMixin
from django.db.models import TextChoices from django.db.models import TextChoices
from common.utils import get_object_or_none from common.utils import get_object_or_none, lazyproperty
from ..backends import get_multi_command_storage from ..backends import get_multi_command_storage
@ -161,6 +161,11 @@ class Session(OrgModelMixin):
else: else:
return True return True
@lazyproperty
def terminal_display(self):
display = self.terminal.name if self.terminal else ''
return display
def save_replay_to_storage_with_version(self, f, version=2): def save_replay_to_storage_with_version(self, f, version=2):
suffix = self.SUFFIX_MAP.get(version, '.cast.gz') suffix = self.SUFFIX_MAP.get(version, '.cast.gz')
local_path = self.get_local_storage_path_by_suffix(suffix) local_path = self.get_local_storage_path_by_suffix(suffix)