From a38624d198cb0f3eee26466e080676fc0fc9e6fd Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 21 Dec 2023 14:02:24 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E5=90=8C=E5=90=8D?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E7=99=BB=E5=BD=95=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/accounts/models/account.py | 6 +++++- apps/terminal/models/applet/applet.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/accounts/models/account.py b/apps/accounts/models/account.py index 14f4bd2cf..4a175609f 100644 --- a/apps/accounts/models/account.py +++ b/apps/accounts/models/account.py @@ -73,7 +73,11 @@ class Account(AbsConnectivity, LabeledMixin, BaseAccount): ] def __str__(self): - return '{}({})'.format(self.name, self.asset.name) + if self.asset_id: + host = self.asset.name + else: + host = 'Dynamic' + return '{}({})'.format(self.name, host) @lazyproperty def platform(self): diff --git a/apps/terminal/models/applet/applet.py b/apps/terminal/models/applet/applet.py index 05209b03d..fd5934285 100644 --- a/apps/terminal/models/applet/applet.py +++ b/apps/terminal/models/applet/applet.py @@ -301,7 +301,7 @@ class Applet(JMSBaseModel): 'account': account, 'lock_key': lock_key } - logger.debug('Select host and account: {}'.format(res)) + logger.debug('Select host and account: {}-{}'.format(host.name, account.username)) return res def delete(self, using=None, keep_parents=False):