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:
fit2bot
2023-12-05 16:52:11 +08:00
committed by GitHub
parent a43bb25b5a
commit d2429f7883
25 changed files with 605 additions and 5 deletions

View File

@@ -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):