From 87f2a6778969d5a8ddc6085c27a5e1f664b81eee Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 15 Feb 2019 11:14:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9=E5=BD=95?= =?UTF-8?q?=E5=83=8F=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/models.py | 9 +++------ config_example.yml | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/apps/terminal/models.py b/apps/terminal/models.py index 32166bf9f..ac912e82a 100644 --- a/apps/terminal/models.py +++ b/apps/terminal/models.py @@ -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) diff --git a/config_example.yml b/config_example.yml index a88dc8596..da09c9e80 100644 --- a/config_example.yml +++ b/config_example.yml @@ -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 .... # 数据库设置 From 49404f763dc9cc45c4d276ab6929683acbc6418f Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 15 Feb 2019 11:15:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9terminal?= =?UTF-8?q?=E5=AD=97=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ops/templates/ops/command_execution_create.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ops/templates/ops/command_execution_create.html b/apps/ops/templates/ops/command_execution_create.html index 178c1ad7a..bffdfdaef 100644 --- a/apps/ops/templates/ops/command_execution_create.html +++ b/apps/ops/templates/ops/command_execution_create.html @@ -170,7 +170,7 @@ function initResultTerminal() { term = new Terminal({ cursorBlink: false, screenKeys: false, - fontFamily: '"Consolas", "monospace"', + fontFamily: 'monaco, Consolas, "Lucida Console", monospace', fontSize: 14, rightClickSelectsWord: true, disableStdin: true,