From b0aa9f197ae7341e27e450288d2357ed9cae5138 Mon Sep 17 00:00:00 2001 From: ibuler Date: Mon, 6 Aug 2018 12:20:27 +0800 Subject: [PATCH] =?UTF-8?q?[Bugfix]=20=E4=BF=AE=E5=A4=8D=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/assets/_user_asset_detail_modal.html | 9 ++++++--- apps/assets/templates/assets/domain_list.html | 4 ++-- apps/assets/templates/assets/user_asset_list.html | 2 +- apps/jumpserver/views.py | 8 +++++--- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/apps/assets/templates/assets/_user_asset_detail_modal.html b/apps/assets/templates/assets/_user_asset_detail_modal.html index b78854d2e..ca2b8f252 100644 --- a/apps/assets/templates/assets/_user_asset_detail_modal.html +++ b/apps/assets/templates/assets/_user_asset_detail_modal.html @@ -1,19 +1,22 @@ {% extends '_modal.html' %} {% load i18n %} {% load static %} - + {% block modal_id %}user_asset_detail_modal{% endblock %} {% block modal_title %}{% trans "Asset detail" %}{% endblock %} {% block modal_body %} -
+
- {% endblock %} {% block modal_button %} diff --git a/apps/assets/templates/assets/domain_list.html b/apps/assets/templates/assets/domain_list.html index a4042d57e..f16bc7f7f 100644 --- a/apps/assets/templates/assets/domain_list.html +++ b/apps/assets/templates/assets/domain_list.html @@ -4,8 +4,8 @@ {% block help_message %}
- 网域功能是为了解决部分环境(如:混合云)无法直接连接而新增的功能,原理是通过网关服务器进行跳转登 -录。 + 网域功能是为了解决部分环境(如:混合云)无法直接连接而新增的功能,原理是通过网关服务器进行跳转登录。
+ JMS => 网域网关 => 目标资产
{% endblock %} diff --git a/apps/assets/templates/assets/user_asset_list.html b/apps/assets/templates/assets/user_asset_list.html index a40cc9e52..e1284b7a7 100644 --- a/apps/assets/templates/assets/user_asset_list.html +++ b/apps/assets/templates/assets/user_asset_list.html @@ -193,7 +193,7 @@ $(document).ready(function () { $.each(data, function(index, value){ if(value.id === asset_id){ for(var i in desc){ - trs += "\n" + + trs += "\n" + ""+ desc[i] + ":"+ ""+ (value[i] === null?'':value[i]) + "\n" + ""; diff --git a/apps/jumpserver/views.py b/apps/jumpserver/views.py index a924c5ef5..7ec6c7774 100644 --- a/apps/jumpserver/views.py +++ b/apps/jumpserver/views.py @@ -5,15 +5,15 @@ from django.views.generic import TemplateView, View from django.utils import timezone from django.db.models import Count from django.shortcuts import redirect +from django.contrib.auth.mixins import LoginRequiredMixin from users.models import User from assets.models import Asset from terminal.models import Session -from common.permissions import AdminUserRequiredMixin from orgs.utils import current_org -class IndexView(AdminUserRequiredMixin, TemplateView): +class IndexView(LoginRequiredMixin, TemplateView): template_name = 'index.html' session_week = None @@ -22,7 +22,9 @@ class IndexView(AdminUserRequiredMixin, TemplateView): session_month_dates_archive = [] def dispatch(self, request, *args, **kwargs): - if not request.user.is_authenticated or not request.user.is_org_admin: + if not request.user.is_authenticated: + return self.handle_no_permission() + if not request.user.is_org_admin: return redirect('assets:user-asset-list') return super(IndexView, self).dispatch(request, *args, **kwargs)