[Bugfix] 修复跳转错误的问题

pull/1645/head
ibuler 2018-08-06 12:20:27 +08:00
parent fc156e23f3
commit b0aa9f197a
4 changed files with 14 additions and 9 deletions

View File

@ -1,19 +1,22 @@
{% extends '_modal.html' %} {% extends '_modal.html' %}
{% load i18n %} {% load i18n %}
{% load static %} {% load static %}
<style>
.modal-body {
background-color: white !important;
}
</style>
{% block modal_id %}user_asset_detail_modal{% endblock %} {% block modal_id %}user_asset_detail_modal{% endblock %}
{% block modal_title %}{% trans "Asset detail" %}{% endblock %} {% block modal_title %}{% trans "Asset detail" %}{% endblock %}
{% block modal_body %} {% block modal_body %}
<div class="ibox-content"> <div class="ibox-content" style="background-color: inherit">
<table class="table"> <table class="table">
<tbody id="asset_detail_tbody"> <tbody id="asset_detail_tbody">
</tbody> </tbody>
</table> </table>
</div> </div>
{% endblock %} {% endblock %}
{% block modal_button %} {% block modal_button %}

View File

@ -4,8 +4,8 @@
{% block help_message %} {% block help_message %}
<div class="alert alert-info help-message"> <div class="alert alert-info help-message">
网域功能是为了解决部分环境(如:混合云)无法直接连接而新增的功能,原理是通过网关服务器进行跳转登 网域功能是为了解决部分环境(如:混合云)无法直接连接而新增的功能,原理是通过网关服务器进行跳转登录。<br>
录。 JMS => 网域网关 => 目标资产
</div> </div>
{% endblock %} {% endblock %}

View File

@ -193,7 +193,7 @@ $(document).ready(function () {
$.each(data, function(index, value){ $.each(data, function(index, value){
if(value.id === asset_id){ if(value.id === asset_id){
for(var i in desc){ for(var i in desc){
trs += "<tr>\n" + trs += "<tr class='no-borders-tr'>\n" +
"<td>"+ desc[i] + ":</td>"+ "<td>"+ desc[i] + ":</td>"+
"<td><b>"+ (value[i] === null?'':value[i]) + "</b></td>\n" + "<td><b>"+ (value[i] === null?'':value[i]) + "</b></td>\n" +
"</tr>"; "</tr>";

View File

@ -5,15 +5,15 @@ from django.views.generic import TemplateView, View
from django.utils import timezone from django.utils import timezone
from django.db.models import Count from django.db.models import Count
from django.shortcuts import redirect from django.shortcuts import redirect
from django.contrib.auth.mixins import LoginRequiredMixin
from users.models import User from users.models import User
from assets.models import Asset from assets.models import Asset
from terminal.models import Session from terminal.models import Session
from common.permissions import AdminUserRequiredMixin
from orgs.utils import current_org from orgs.utils import current_org
class IndexView(AdminUserRequiredMixin, TemplateView): class IndexView(LoginRequiredMixin, TemplateView):
template_name = 'index.html' template_name = 'index.html'
session_week = None session_week = None
@ -22,7 +22,9 @@ class IndexView(AdminUserRequiredMixin, TemplateView):
session_month_dates_archive = [] session_month_dates_archive = []
def dispatch(self, request, *args, **kwargs): 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 redirect('assets:user-asset-list')
return super(IndexView, self).dispatch(request, *args, **kwargs) return super(IndexView, self).dispatch(request, *args, **kwargs)