2023-04-28 12:22:26 +08:00

128 lines
5.3 KiB
Plaintext

<%@ Page Title="" Language="C#" MasterPageFile="~/IronIntelMasterPage.master" AutoEventWireup="true" CodeFile="Security.aspx.cs" Inherits="Security_Security" %>
<asp:Content ID="Content1" ContentPlaceHolderID="holder_head" runat="Server">
<link href="<%=GetFileUrlWithVersion("../css/split.css")%>" rel="stylesheet" type="text/css" />
<script src="<%=GetFileUrlWithVersion("../js/split.js")%>"></script>
<%--<script src="<%=GetFileUrlWithVersion("../fic/js/utility.js")%>" type="text/javascript"></script>--%>
<script type="text/javascript">
$(function () {
setFavoriteDisplay(true);
_network.securityquery = function (method, param, callback, error) {
_network.request("Security/Security.aspx", -1, method, param, callback, error);
}
_network.securityquery('GetNavs', '', function (data) {
if (data != null && data.length > 0) {
var list = [];
for (var i = 0; i < data.length; i++) {
var icon = $(' <button></button>');
var title = getNavInfoByID(data[i].ID, data[i].Title, icon);
//if (data[i].ID == "nav_curfew") continue;//临时屏蔽Curfew Configuration
var li = $('<li class="nav_item"></li>').attr({
'id': data[i].ID,
'page': data[i].Url,
'title': title
});
var a = $('<a></a>').attr('href', '#' + data[i].ID);
var src = data[i].IconPath;
if (!src) {
src = 'img/none.png';
}
var divicon = $('<div></div>').append(icon);
a.append(divicon);
a.append($('<span></span>').text(title));
li.append(a);
if (data[i].ID === "nav_dts") {
li.click(function () {
setPageTitle(GetTextByKey("P_DATATABLEPERMISSION", 'Data Table Access Rights Definitions'), true);
})
}
else if (data[i].ID === "nav_filters") {
li.click(function () {
setPageTitle(GetTextByKey("P_DASHBOARDFILTERS", 'Filter Definitions'), true);
})
}
list.push(li);
}
$('.ul_menu').append(list);
}
if (data.length > 0) {
default_page = '#' + data[0].ID;
if (!old_hash) {
old_hash = default_page;
}
window.changePage(old_hash);
} else {
// 无权限时跳转至登录页面
window.location.href = '<%=LoginPageUrl%>';
}
}, function (e) {
console.log(e);
});
});
function getNavInfoByID(id, title1, icon) {
var title = title1;
if (id === "nav_users") {
title = GetTextByKey("P_USERS", title);
$(icon).addClass("iconusers");
}
else if (id === "nav_user_group") {
title = GetTextByKey("P_USERSGROUP", title);
$(icon).addClass("iconusergroup");
}
else if (id === "nav_dts") {
title = GetTextByKey("P_DATATABLEPERMISSION", title);
$(icon).addClass("icondatatablepermission");
}
else if (id === "nav_filters") {
title = GetTextByKey("P_DASHBOARDFILTERS", title);
$(icon).addClass("icondashboardfilters");
}
else if (id === "nav_curfew") {
title = GetTextByKey("P_CURFEWCONFIGURATION", title);
$(icon).addClass("iconcurfew");
}
else if (id === "nav_curfewmt") {
title = GetTextByKey("P_CURFEWMOVEMENTTOLERANCE", title);
$(icon).addClass("iconcurfewmt");
}
else if (id === "nav_usertocontractor") {
title = GetTextByKey("P_USERTOCONTRACTOR", title);
$(icon).addClass("iconusertocontractor");
}
return title;
}
function afterpagechanged(hash, name) {
setFavorateStyle(hash, name);
if (hash === "#nav_dts" || hash === "#nav_filters") {//调用FIC的页面,特殊处理
$('#set_right .loading_holder').fadeOut('fast');
$('#set_right iframe').fadeIn();
}
};
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="holder_content" runat="Server">
<div id="set_left">
<ul class="ul_menu">
<li id="nav_arrow">
<div class="icn collapse"></div>
</li>
</ul>
<div class="hostmask maskbg" style="display: none;"></div>
</div>
<div id="set_right">
<div class="loading_holder">
<div class="loading_icon icn icn-spin"></div>
</div>
</div>
</asp:Content>