-
diff --git a/apps/perms/api.py b/apps/perms/api.py
index db6f31774527c37e0ebe4dd6deba1212dcdee468..02d583ba18a817e84b41161cf0ec6ce896ef4e9e 100644
--- a/apps/perms/api.py
+++ b/apps/perms/api.py
@@ -197,7 +197,7 @@ class MyAssetGroupAssetsApi(ListAPIView):
permission_classes = (IsValidUser,)
def get(self, request, *args, **kwargs):
- asset_groups = {}
+ asset_groups = dict()
asset_groups[0] = {
'id': 0, 'name': 'ungrouped', 'assets': []
}
@@ -216,7 +216,7 @@ class MyAssetGroupAssetsApi(ListAPIView):
asset_json = asset.to_json()
asset_json['system_users'] = [su.to_json() for su in system_users]
if not asset.groups.all():
- asset_groups[0][assets].append(asset_json)
+ asset_groups[0]['assets'].append(asset_json)
continue
for asset_group in asset.groups.all():
if asset_group.id in asset_groups:
diff --git a/apps/templates/_base_list.html b/apps/templates/_base_list.html
index f88abd9ac56f275160da6755166c380e45cdd484..4448ecae985c8a901af6b2db7b3db8ed3141319e 100644
--- a/apps/templates/_base_list.html
+++ b/apps/templates/_base_list.html
@@ -1,7 +1,7 @@
{% extends 'base.html' %}
{% load static %}
{% block custom_head_css_js %}
-
+
diff --git a/apps/templates/_nav.html b/apps/templates/_nav.html
index d0a2b907321b34ba965b60bd554657c5b64ee08e..7e2ee4720a42dadab5c2432d81b82d2d50effc3e 100644
--- a/apps/templates/_nav.html
+++ b/apps/templates/_nav.html
@@ -1,6 +1,6 @@
{% load i18n %}
-
+
{% trans 'Home' %}
diff --git a/apps/templates/index.html b/apps/templates/index.html
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..581751f222c6763bc01e32ad50acb96f295edf47 100644
--- a/apps/templates/index.html
+++ b/apps/templates/index.html
@@ -0,0 +1,478 @@
+{% extends 'base.html' %}
+{% load static %}
+{% block content %}
+
+
+
+
+
+
+
+
+
+
+ Connected
+
已连接服务器
+
+
+
+
+
+
+
+
+
+
+
+ 活跃用户资产占比
+
+
+ 以下图形分别描述一个月活跃用户和资产占所有用户主机的百分比
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
一周Top10资产
+ 登录次数及最近一次登录记录.
+
+
+ {% if week_asset_hot_ten %}
+ {% for data in week_asset_hot_ten %}
+
+
+
+
+ {{ data.asset }}
+
+ {{ data.total }}次
+
+
+
最近一次登录用户
+
{{ data.last.user }}
+
于{{ data.last.date_start |date:"Y-m-d H:i:s" }}
+
+
+
+ {% endfor %}
+ {% else %}
+
(暂无)
+ {% endif %}
+
+
+
+
+
+
+
最近十次登录
+
+ 10 Messages
+
+
+
+
登录记录
+ 最近十次登录记录.
+
+
+
+
+ {% if last_login_ten %}
+ {% for login in last_login_ten %}
+
+
+
+
+
+ {% ifequal login.is_finished 0 %}
+ {{ login.date_start|timesince }} ago
+ {% else %}
+ {{ login.date_start|timesince }} ago
+ {% endifequal %}
+ {{ login.user }} 登录了{{ login.asset }}
+ {{ login.date_start }}
+
+
+
+ {% endfor %}
+ {% else %}
+
(暂无)
+ {% endif %}
+
+
+
+
+
+
+
+
+
+
+
一周Top10用户
+ 用户登录次数及最近一次登录记录.
+
+
+ {% if week_user_hot_ten %}
+ {% for data in week_user_hot_ten %}
+
+
+
+
+ {{ data.user }}
+
+ {{ data.total }}次
+
+
+
最近一次登录主机
+
{{ data.last.asset }}
+
于{{ data.last.date_start |date:"Y-m-d H:i:s" }}
+
+
+
+ {% endfor %}
+ {% else %}
+
(暂无)
+ {% endif %}
+
+
+
+
+
+
+{% endblock %}
+
+{% block custom_foot_js %}
+
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/apps/users/templates/users/user_group_detail.html b/apps/users/templates/users/user_group_detail.html
index a27c4f91f7969d251284b716391222373f9c8a83..f317183c2e081ee27f80d53a32ed959cb6642981 100644
--- a/apps/users/templates/users/user_group_detail.html
+++ b/apps/users/templates/users/user_group_detail.html
@@ -5,7 +5,7 @@
{% block custom_head_css_js %}
-
+
diff --git a/requirements/requirements.txt b/requirements/requirements.txt
index 64dfed303d967f207db1dba433ad2a8fdc639f3c..7353390d2f4d9c2f386377902e197b16c222ff8b 100644
--- a/requirements/requirements.txt
+++ b/requirements/requirements.txt
@@ -7,7 +7,7 @@ ForgeryPy==0.1
openpyxl==2.4.0
celery==3.1.23
paramiko==2.1.1
-ansible==2.1.2.0
+ansible==2.2.2.0
django-simple-captcha==0.5.2
django-formtools==1.0
sshpubkeys==2.2.0
@@ -20,4 +20,3 @@ tornado==4.4.2
eventlet==0.20.1
django-filter==1.0.0
passlib==1.7.1
-sshpass
diff --git a/utils/clean_migrations.sh b/utils/clean_migrations.sh
index c1c8e6e09668000b477d9ef004e6bdd0b958f62a..b5493dc0dfa3e33cd058c0fc39cb632331ec9eb7 100755
--- a/utils/clean_migrations.sh
+++ b/utils/clean_migrations.sh
@@ -2,5 +2,5 @@
#
for app in users assets perms audits ops applications;do
- rm -f ../apps/$app/migrations/000*
+ rm -f ../apps/$app/migrations/00*
done