mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-08-31 15:11:27 +00:00
perf: 当连接资产为网关时,connection_token不返回网域网关信息
This commit is contained in:
@@ -10,6 +10,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from rest_framework.exceptions import PermissionDenied
|
||||
|
||||
from assets.const import Protocol
|
||||
from assets.const.host import GATEWAY_NAME
|
||||
from common.db.fields import EncryptTextField
|
||||
from common.exceptions import JMSException
|
||||
from common.utils import lazyproperty, pretty_string, bulk_get
|
||||
@@ -231,12 +232,14 @@ class ConnectionToken(JMSOrgBaseModel):
|
||||
def domain(self):
|
||||
if not self.asset.platform.domain_enabled:
|
||||
return
|
||||
domain = self.asset.domain if self.asset else None
|
||||
if self.asset.platform.name == GATEWAY_NAME:
|
||||
return
|
||||
domain = self.asset.domain if self.asset.domain else None
|
||||
return domain
|
||||
|
||||
@lazyproperty
|
||||
def gateway(self):
|
||||
if not self.asset:
|
||||
if not self.asset or not self.domain:
|
||||
return
|
||||
return self.asset.gateway
|
||||
|
||||
|
Reference in New Issue
Block a user