mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-07-08 12:29:06 +00:00
[Update] 修改录像路径使用utc
This commit is contained in:
parent
0980dffb47
commit
cb1e19d28f
@ -168,7 +168,7 @@ class Session(OrgModelMixin):
|
|||||||
upload_to = 'replay'
|
upload_to = 'replay'
|
||||||
ACTIVE_CACHE_KEY_PREFIX = 'SESSION_ACTIVE_{}'
|
ACTIVE_CACHE_KEY_PREFIX = 'SESSION_ACTIVE_{}'
|
||||||
|
|
||||||
def get_rel_replay_path(self, version=2):
|
def get_rel_replay_path(self, version=3):
|
||||||
"""
|
"""
|
||||||
获取session日志的文件路径
|
获取session日志的文件路径
|
||||||
:param version: 原来后缀是 .gz,为了统一新版本改为 .replay.gz
|
:param version: 原来后缀是 .gz,为了统一新版本改为 .replay.gz
|
||||||
@ -177,10 +177,13 @@ class Session(OrgModelMixin):
|
|||||||
suffix = '.replay.gz'
|
suffix = '.replay.gz'
|
||||||
if version == 1:
|
if version == 1:
|
||||||
suffix = '.gz'
|
suffix = '.gz'
|
||||||
|
if version <= 2:
|
||||||
date = self.date_start.strftime('%Y-%m-%d')
|
date = self.date_start.strftime('%Y-%m-%d')
|
||||||
|
else:
|
||||||
|
date = self.date_start.utcnow().strftime('%Y-%m-%d')
|
||||||
return os.path.join(date, str(self.id) + suffix)
|
return os.path.join(date, str(self.id) + suffix)
|
||||||
|
|
||||||
def get_local_path(self, version=2):
|
def get_local_path(self, version=3):
|
||||||
rel_path = self.get_rel_replay_path(version=version)
|
rel_path = self.get_rel_replay_path(version=version)
|
||||||
if version == 2:
|
if version == 2:
|
||||||
local_path = os.path.join(self.upload_to, rel_path)
|
local_path = os.path.join(self.upload_to, rel_path)
|
||||||
|
Loading…
Reference in New Issue
Block a user