From 0262d94dd343736a3723e0a9f7d408425d37facb Mon Sep 17 00:00:00 2001 From: wangyong <864072399@qq.com> Date: Tue, 24 Nov 2015 19:04:16 +0800 Subject: [PATCH] fix disk detail bug --- jumpserver.conf | 2 +- jumpserver/templatetags/mytags.py | 6 +++++- templates/jasset/asset_edit.html | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/jumpserver.conf b/jumpserver.conf index 6297ab00a..41894e0d9 100644 --- a/jumpserver.conf +++ b/jumpserver.conf @@ -13,7 +13,7 @@ password = mysql234 database = jumpserver [websocket] -web_socket_host = j:3000 +web_socket_host = js:3000 [mail] mail_enable = 1 diff --git a/jumpserver/templatetags/mytags.py b/jumpserver/templatetags/mytags.py index c8f5debde..2759838f2 100644 --- a/jumpserver/templatetags/mytags.py +++ b/jumpserver/templatetags/mytags.py @@ -209,7 +209,11 @@ def str_to_dic(info): """ str to list """ - return ast.literal_eval(info).iteritems() + if '{' in info: + info_dic = ast.literal_eval(info).iteritems() + else: + info_dic = {} + return info_dic @register.filter(name='str_to_code') diff --git a/templates/jasset/asset_edit.html b/templates/jasset/asset_edit.html index a3f9bd516..c22bab6ca 100644 --- a/templates/jasset/asset_edit.html +++ b/templates/jasset/asset_edit.html @@ -96,15 +96,15 @@
{{ af.memory|bootstrap_horizontal }} + + {{ af.disk|bootstrap_horizontal }} + {{ af.system_type|bootstrap_horizontal }} {{ af.system_version|bootstrap_horizontal }} - - {{ af.disk|bootstrap_horizontal }} - {{ af.number|bootstrap_horizontal }}