mirror of https://github.com/jumpserver/jumpserver
perf: 支持 mp4 录像文件上传和新增 video worker 类型
parent
127f6730f6
commit
ee7f1f8f5e
|
@ -186,6 +186,8 @@ class SessionReplayViewSet(AsyncApiMixin, viewsets.ViewSet):
|
|||
tp = 'guacamole'
|
||||
if url.endswith('.cast.gz'):
|
||||
tp = 'asciicast'
|
||||
if url.endswith('.replay.mp4'):
|
||||
tp = 'mp4'
|
||||
|
||||
download_url = reverse('api-terminal:session-replay-download', kwargs={'pk': session.id})
|
||||
data = {
|
||||
|
|
|
@ -48,6 +48,7 @@ class TerminalType(TextChoices):
|
|||
magnus = 'magnus', 'Magnus'
|
||||
razor = 'razor', 'Razor'
|
||||
tinker = 'tinker', 'Tinker'
|
||||
video_worker = 'video_worker', 'Video Worker'
|
||||
|
||||
@classmethod
|
||||
def types(cls):
|
||||
|
|
|
@ -48,8 +48,8 @@ class Session(OrgModelMixin):
|
|||
|
||||
upload_to = 'replay'
|
||||
ACTIVE_CACHE_KEY_PREFIX = 'SESSION_ACTIVE_{}'
|
||||
SUFFIX_MAP = {1: '.gz', 2: '.replay.gz', 3: '.cast.gz'}
|
||||
DEFAULT_SUFFIXES = ['.replay.gz', '.cast.gz', '.gz']
|
||||
SUFFIX_MAP = {1: '.gz', 2: '.replay.gz', 3: '.cast.gz', 4: '.replay.mp4'}
|
||||
DEFAULT_SUFFIXES = ['.replay.gz', '.cast.gz', '.gz', '.replay.mp4']
|
||||
|
||||
# Todo: 将来干掉 local_path, 使用 default storage 实现
|
||||
def get_all_possible_local_path(self):
|
||||
|
|
|
@ -61,7 +61,7 @@ class SessionDisplaySerializer(SessionSerializer):
|
|||
|
||||
class ReplaySerializer(serializers.Serializer):
|
||||
file = serializers.FileField(allow_empty_file=True)
|
||||
version = serializers.IntegerField(write_only=True, required=False, min_value=2, max_value=3)
|
||||
version = serializers.IntegerField(write_only=True, required=False, min_value=2, max_value=4)
|
||||
|
||||
|
||||
class SessionJoinValidateSerializer(serializers.Serializer):
|
||||
|
|
Loading…
Reference in New Issue