feat: Endpoint 支持标签匹配

feat: Endpoint 支持标签匹配

feat: Endpoint 支持标签匹配

feat: Endpoint 支持标签匹配

feat: Endpoint 添加帮助信息

feat: Endpoint 添加帮助信息
This commit is contained in:
Jiangjie.Bai
2022-06-28 20:12:55 +08:00
committed by Jiangjie.Bai
parent e8363ddff8
commit 05826abf9d
8 changed files with 584 additions and 771 deletions

View File

@@ -196,10 +196,14 @@ class Session(OrgModelMixin):
def login_from_display(self):
return self.get_login_from_display()
def get_target_ip(self):
def get_asset_or_application(self):
instance = get_object_or_none(Asset, pk=self.asset_id)
if not instance:
instance = get_object_or_none(Application, pk=self.asset_id)
return instance
def get_target_ip(self):
instance = self.get_asset_or_application()
target_ip = instance.get_target_ip() if instance else ''
return target_ip