109 lines
4.2 KiB
Plaintext
109 lines
4.2 KiB
Plaintext
<%@ Page Title="" Language="C#" MasterPageFile="~/IronIntelMasterPage.master" AutoEventWireup="true" CodeFile="Credentials.aspx.cs" Inherits="Credentials_Credentials" %>
|
|
|
|
<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 type="text/javascript">
|
|
var ConnectionsURL = "<%=ConnectionsURL%>";
|
|
var isJDLink = <%=IsJDLink?"true":"false"%>;
|
|
var isJDSub = <%=IsJDSub?"true":"false"%>;
|
|
var isMyJD = <%=IsMyJD?"true":"false"%>;
|
|
|
|
$(function () {
|
|
setFavoriteDisplay(true);
|
|
|
|
_network.query = function (method, param, callback, error) {
|
|
_network.request("Credentials/Credentials.aspx", -1, method, param, callback, error);
|
|
}
|
|
_network.query('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);
|
|
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);
|
|
list.push(li);
|
|
}
|
|
$('.ul_menu').append(list);
|
|
}
|
|
|
|
if (data.length > 0) {
|
|
if (isJDLink || isJDSub || isMyJD)
|
|
default_page = '#' + data[1].ID;
|
|
else
|
|
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);
|
|
});
|
|
|
|
window.changePage(old_hash);
|
|
|
|
if (ConnectionsURL)
|
|
window.open(ConnectionsURL);
|
|
});
|
|
|
|
function getNavInfoByID(id, title1, icon) {
|
|
var title = title1;
|
|
if (id === "nav_credential") {
|
|
title = GetTextByKey("P_CREDENTIALS", title);
|
|
$(icon).addClass("iconcredentail");
|
|
}
|
|
else if (id === "nav_jdlink") {
|
|
title = GetTextByKey("P_JOHNDEERE", title);
|
|
$(icon).addClass("iconjdlink");
|
|
}
|
|
else if (id === "nav_jdnotification") {
|
|
title = GetTextByKey("P_JOHNDEERENOTIFICATIONS", title);
|
|
$(icon).addClass("iconjdnotification");
|
|
}
|
|
else if (id === "nav_apicredential") {
|
|
title = GetTextByKey("P_APICREDENTIALS", title);
|
|
$(icon).addClass("iconcredentail");
|
|
}
|
|
return title;
|
|
}
|
|
|
|
function afterpagechanged(hash, name) {
|
|
setFavorateStyle(hash, name);
|
|
};
|
|
</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>
|
|
|