mirror of https://github.com/jumpserver/jumpserver
[Update] 修改录像获取
parent
df2fad76c7
commit
87f2a67789
|
@ -168,7 +168,7 @@ class Session(OrgModelMixin):
|
|||
upload_to = 'replay'
|
||||
ACTIVE_CACHE_KEY_PREFIX = 'SESSION_ACTIVE_{}'
|
||||
|
||||
def get_rel_replay_path(self, version=3):
|
||||
def get_rel_replay_path(self, version=2):
|
||||
"""
|
||||
获取session日志的文件路径
|
||||
:param version: 原来后缀是 .gz,为了统一新版本改为 .replay.gz
|
||||
|
@ -177,13 +177,10 @@ class Session(OrgModelMixin):
|
|||
suffix = '.replay.gz'
|
||||
if version == 1:
|
||||
suffix = '.gz'
|
||||
if version <= 2:
|
||||
date = self.date_start.strftime('%Y-%m-%d')
|
||||
else:
|
||||
date = self.date_start.utcnow().strftime('%Y-%m-%d')
|
||||
date = self.date_start.strftime('%Y-%m-%d')
|
||||
return os.path.join(date, str(self.id) + suffix)
|
||||
|
||||
def get_local_path(self, version=3):
|
||||
def get_local_path(self, version=2):
|
||||
rel_path = self.get_rel_replay_path(version=version)
|
||||
if version == 2:
|
||||
local_path = os.path.join(self.upload_to, rel_path)
|
||||
|
|
|
@ -18,8 +18,8 @@ BOOTSTRAP_TOKEN:
|
|||
|
||||
# Session expiration setting, Default 24 hour, Also set expired on on browser close
|
||||
# 浏览器Session过期时间,默认24小时, 也可以设置浏览器关闭则过期
|
||||
# SESSION_COOKIE_AGE: 3600 * 24
|
||||
# SESSION_EXPIRE_AT_BROWSER_CLOSE: False
|
||||
# SESSION_COOKIE_AGE: 86400
|
||||
# SESSION_EXPIRE_AT_BROWSER_CLOSE: false
|
||||
|
||||
# Database setting, Support sqlite3, mysql, postgres ....
|
||||
# 数据库设置
|
||||
|
|
Loading…
Reference in New Issue