Commit b0aa9f19 authored by ibuler's avatar ibuler

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

parent fc156e23
{% extends '_modal.html' %}
{% load i18n %}
{% load static %}
<style>
.modal-body {
background-color: white !important;
}
</style>
{% block modal_id %}user_asset_detail_modal{% endblock %}
{% block modal_title %}{% trans "Asset detail" %}{% endblock %}
{% block modal_body %}
<div class="ibox-content">
<div class="ibox-content" style="background-color: inherit">
<table class="table">
<tbody id="asset_detail_tbody">
</tbody>
</table>
</div>
{% endblock %}
{% block modal_button %}
......
......@@ -4,8 +4,8 @@
{% block help_message %}
<div class="alert alert-info help-message">
网域功能是为了解决部分环境(如:混合云)无法直接连接而新增的功能,原理是通过网关服务器进行跳转登
录。
网域功能是为了解决部分环境(如:混合云)无法直接连接而新增的功能,原理是通过网关服务器进行跳转登录。<br>
JMS => 网域网关 => 目标资产
</div>
{% endblock %}
......
......@@ -193,7 +193,7 @@ $(document).ready(function () {
$.each(data, function(index, value){
if(value.id === asset_id){
for(var i in desc){
trs += "<tr>\n" +
trs += "<tr class='no-borders-tr'>\n" +
"<td>"+ desc[i] + ":</td>"+
"<td><b>"+ (value[i] === null?'':value[i]) + "</b></td>\n" +
"</tr>";
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment