mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-12-22 12:02:34 +00:00
feat: 支持 virtual app (#12199)
* feat: 支持 virtual app * perf: 增加 virtual host * perf: 新增 virtual app 上传接口 * perf: 更名为 app provider * perf: 优化代码 --------- Co-authored-by: Eric <xplzv@126.com>
This commit is contained in:
@@ -18,7 +18,7 @@ from common.utils import lazyproperty, pretty_string, bulk_get
|
||||
from common.utils.timezone import as_current_tz
|
||||
from orgs.mixins.models import JMSOrgBaseModel
|
||||
from orgs.utils import tmp_to_org
|
||||
from terminal.models import Applet
|
||||
from terminal.models import Applet, VirtualApp
|
||||
|
||||
|
||||
def date_expired_default():
|
||||
@@ -177,6 +177,15 @@ class ConnectionToken(JMSOrgBaseModel):
|
||||
}
|
||||
return options
|
||||
|
||||
def get_virtual_app_option(self):
|
||||
method = self.connect_method_object
|
||||
if not method or method.get('type') != 'virtual_app' or method.get('disabled', False):
|
||||
return None
|
||||
virtual_app = VirtualApp.objects.filter(name=method.get('value')).first()
|
||||
if not virtual_app:
|
||||
return None
|
||||
return virtual_app
|
||||
|
||||
def get_applet_option(self):
|
||||
method = self.connect_method_object
|
||||
if not method or method.get('type') != 'applet' or method.get('disabled', False):
|
||||
|
||||
Reference in New Issue
Block a user