mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-19 10:26:27 +00:00
@@ -2,11 +2,10 @@
|
||||
#
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from orgs.mixins.models import OrgManager
|
||||
from assets.models.platform import Platform
|
||||
from assets.const import GATEWAY_NAME
|
||||
from assets.models.platform import Platform
|
||||
from common.utils import get_logger, lazyproperty
|
||||
|
||||
from orgs.mixins.models import OrgManager
|
||||
from .asset.host import Host
|
||||
|
||||
logger = get_logger(__file__)
|
||||
@@ -57,6 +56,14 @@ class Gateway(Host):
|
||||
account = self.select_account
|
||||
return account.password if account else None
|
||||
|
||||
@lazyproperty
|
||||
def port(self):
|
||||
protocol = self.protocols.filter(name='ssh').first()
|
||||
if protocol:
|
||||
return protocol.port
|
||||
else:
|
||||
return '22'
|
||||
|
||||
@lazyproperty
|
||||
def private_key(self):
|
||||
account = self.select_account
|
||||
|
Reference in New Issue
Block a user