OSDN Git Service

Initial commit
[ultramonkey-l7/l7gui.git] / src / WebContent / sync_fail.jsp
1 <%@ page
2         import="org.ultramonkey.l7.model.*,org.ultramonkey.l7.controller.*,org.ultramonkey.l7.view.*"
3         language="java" contentType="text/html; charset=UTF-8"
4         pageEncoding="UTF-8"%>
5
6 <%
7         /*
8          * check session
9          */
10     L7guiServletBase base = new L7guiServletBase();
11         if (session.isNew() || base.checkSession(session) == false) {
12                 MessageView error = new MessageView(41395,
13                 LogCategorySet.GUI_USER_AUTHENTICATION,
14                 Message.INVALID_SESSSION);
15                 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
16                 response.sendRedirect(RedirectPages.LOGIN);
17                 return;
18         }
19
20         /*
21          * get VS IPaddress
22          */
23         L7guiFramework framework = new L7guiFramework();
24         ClusterData cd = framework.getClusterData();
25
26         String self = "";
27         String other = "";
28
29         if (cd == null) {
30                 MessageView error = new MessageView(41396,
31                 LogCategorySet.GUI_IO_COMMAND,
32                 Message.CLUSTER_DATA_ERROR);
33                 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
34                 response.sendRedirect(RedirectPages.LOGIN);
35                 return;
36         } else {
37                 self = cd.self_ip;
38                 other = cd.other_ip;
39         }
40
41         if ((self == null) || (other == null)) {
42                 MessageView error = new MessageView(41397,
43                 LogCategorySet.GUI_IO_COMMAND,
44                 Message.CLUSTER_DATA_ERROR);
45                 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
46                 response.sendRedirect(RedirectPages.LOGIN);
47                 return;
48         }
49
50         /*
51          * get result message
52          */
53         MessageView message = (MessageView) session
54                         .getAttribute(SessionKeys.COMMAND_MESSAGE);
55
56         String errorMessage = "";
57         int errorNumber = 0;
58         String category = "";
59
60         if (message != null) {
61                 errorMessage = message.getMessage();
62                 errorNumber = message.getErrno();
63                 category = message.getCategory();
64                 session.setAttribute(SessionKeys.COMMAND_MESSAGE, null);
65         }
66
67         /*
68          * fix style seat
69          */
70         String cssSeat = "l7gui_single_style.css";
71         if (cd.self_status == ClusterStatus.ACTIVE) {
72                 cssSeat = "l7gui_act_style.css";
73         } else if (cd.self_status == ClusterStatus.STANDBY) {
74                 cssSeat = "l7gui_sby_style.css";
75         }
76 %>
77
78 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
79 <html>
80 <head>
81 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
82 <meta http-equiv="Content-Script-Type" content="text/javascript" />
83 <meta http-equiv="Content-Style-Type" content="text/css" />
84 <noscript>
85 <meta http-equiv="refresh"
86         content="<%= RedirectPages.NOSCRIPT_TIME %>; url=<%= RedirectPages.LOGIN %>" />
87 </noscript>
88 <link rel="stylesheet" type="text/css" href="<%=cssSeat %>" />
89 <link rel="shortcut icon" href="images/favicon.ico" />
90 <title>Failed : Sync Resources</title>
91 </head>
92
93 <body class="normal">
94
95 <jsp:include page="menu.jsp" flush="false" />
96
97 <div id="content">
98 <h1 class="title">Failed : Sync Resources</h1>
99 <h2>Sync failed.</h2>
100
101 <h2><%=self%> (<%=cd.self_status %>) <img class="arrow2" src="images/arrowlogo2.gif"
102                      alt="arrowlogo" /><%=other %> (<%=cd.other_status %>)</h2>
103
104 <% if ( (message != null ) && (errorMessage != null)){ 
105 %>
106 <h2>Error Reason :</h2>
107 <p class="error">[<%=category%>-<%=errorNumber%>]</p>
108 <p class=error><%=errorMessage%></p>
109 <%
110 }
111 %>
112 </div>
113 </body>
114 </html>