mirror of https://github.com/jumpserver/jumpserver
perf: 修改 session type 序列🥱
parent
88355f55bb
commit
0748c32c5a
|
@ -35,7 +35,7 @@ def parse_sentinels_host(sentinels_host):
|
|||
VERSION = const.VERSION
|
||||
BASE_DIR = const.BASE_DIR
|
||||
PROJECT_DIR = const.PROJECT_DIR
|
||||
APP_DIR = os.path.join(PROJECT_DIR, 'apps')
|
||||
APPS_DIR = os.path.join(PROJECT_DIR, 'apps')
|
||||
DATA_DIR = os.path.join(PROJECT_DIR, 'data')
|
||||
ANSIBLE_DIR = os.path.join(DATA_DIR, 'ansible')
|
||||
CERTS_DIR = os.path.join(DATA_DIR, 'certs')
|
||||
|
|
|
@ -78,6 +78,7 @@ class DownloadUploadMixin:
|
|||
with open(zip_path, 'rb') as f:
|
||||
response = HttpResponse(f.read(), status=200, content_type='application/octet-stream')
|
||||
response['Content-Disposition'] = 'attachment; filename*=UTF-8\'\'{}.zip'.format(instance.name)
|
||||
os.unlink(zip_path)
|
||||
return response
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ class SessionType(models.TextChoices):
|
|||
class SessionSerializer(BulkOrgResourceModelSerializer):
|
||||
org_id = serializers.CharField(allow_blank=True)
|
||||
protocol = serializers.ChoiceField(choices=Protocol.choices, label=_("Protocol"))
|
||||
type = LabeledChoiceField(choices=SessionType.choices, label=_("Type"))
|
||||
type = LabeledChoiceField(choices=SessionType.choices, label=_("Type"), default=SessionType.normal)
|
||||
|
||||
class Meta:
|
||||
model = Session
|
||||
|
|
Loading…
Reference in New Issue