1 <%@ page import="org.ultramonkey.l7.model.*,
2 org.ultramonkey.l7.controller.*,
3 org.ultramonkey.l7.view.*, java.util.*"
4 language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
10 L7guiServletBase base = new L7guiServletBase();
11 if (session.isNew() || base.checkSession(session) == false) {
12 MessageView error = new MessageView(41305, LogCategorySet.GUI_USER_AUTHENTICATION,
13 Message.INVALID_SESSSION);
14 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
15 response.sendRedirect(RedirectPages.LOGIN);
20 * get cluster status and fix css seat
22 L7guiFramework framework = new L7guiFramework();
23 ClusterData cd = framework.getClusterData();
25 MessageView error = new MessageView(41306, LogCategorySet.GUI_IO_COMMAND,
26 Message.CLUSTER_DATA_ERROR);
27 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
28 response.sendRedirect(RedirectPages.LOGIN);
32 String cssSeat = "l7gui_single_style.css";
33 if ( cd.self_status == ClusterStatus.ACTIVE ){
34 cssSeat = "l7gui_act_style.css";
36 else if ( cd.self_status == ClusterStatus.STANDBY ){
37 cssSeat = "l7gui_sby_style.css";
41 * in case : sessionTimeout == null(Adm Command Normal)
42 * get save status & sync status
48 Parameter param = Parameter.getInstance();
50 MessageView error = new MessageView(41307, LogCategorySet.GUI_START_STOP,
51 Message.UNEXPECTED_ERROR);
52 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
53 response.sendRedirect(RedirectPages.LOGIN);
56 String sessionTimeout = param.getValue(Parameter.L7VSADM_TIMEOUT_FLAG);
58 boolean saveState = false;
59 String logSaveState = (String)session.getAttribute(SessionKeys.LOG_SAVE_STATE);
60 String vsSaveState = (String)session.getAttribute(SessionKeys.VS_SAVE_STATE);
63 String logSyncState = null;
64 String vsSyncState = null;
65 String monitorSyncState = null;
66 String repSyncState = null;
67 String snmpSyncState = null;
68 String guiSyncState = null;
70 String legendInfo = null;
72 if ( sessionTimeout == null ) {
77 if ( (logSaveState == null) || (vsSaveState == null) ){
78 MessageView error = new MessageView(41308, LogCategorySet.GUI_USER_AUTHENTICATION,
79 Message.UNEXPECTED_ERROR);
80 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
81 response.sendRedirect(RedirectPages.LOGIN);
85 if ((logSaveState.equals(SessionKeys.SAVE)) && (vsSaveState.equals(SessionKeys.SAVE))){
91 * in case : ACT or SBY get sync status
93 if ( (cd.self_status == ClusterStatus.ACTIVE) || (cd.self_status == ClusterStatus.STANDBY) ){
95 logSyncState = (String)session.getAttribute(SessionKeys.LOG_SYNC_STATE);
96 vsSyncState = (String)session.getAttribute(SessionKeys.VS_SYNC_STATE);
97 monitorSyncState = (String)session.getAttribute(SessionKeys.MONITOR_SYNC_STATE);
98 repSyncState = (String)session.getAttribute(SessionKeys.REP_SYNC_STATE);
99 snmpSyncState = (String)session.getAttribute(SessionKeys.SNMP_SYNC_STATE);
100 guiSyncState = (String)session.getAttribute(SessionKeys.GUI_SYNC_STATE);
102 if ( (logSyncState == null) || (vsSyncState == null)
103 || (monitorSyncState == null ) || (repSyncState == null )
104 || (snmpSyncState == null ) || (guiSyncState == null) ){
106 MessageView error = new MessageView(41309, LogCategorySet.GUI_USER_AUTHENTICATION,
107 Message.UNEXPECTED_ERROR);
108 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
109 response.sendRedirect(RedirectPages.LOGIN);
113 if ( (logSyncState.equals(SessionKeys.SYNC)) && (vsSyncState.equals(SessionKeys.SYNC))
114 && (monitorSyncState.equals(SessionKeys.SYNC)) && (repSyncState.equals(SessionKeys.SYNC))
115 && (snmpSyncState.equals(SessionKeys.SYNC)) && (guiSyncState.equals(SessionKeys.SYNC)) ){
122 if ( (cd.self_status == ClusterStatus.ACTIVE) || (cd.self_status == ClusterStatus.STANDBY) ){
123 if ( saveState == true && syncState == 1 ){
124 legendInfo = "No Sync Info";
126 else if ( saveState == false && syncState == 1 ){
127 legendInfo = "No Sync & No Save Info";
129 else if ( saveState == false && syncState == 2 ){
130 legendInfo = "No Save Info";
134 if (saveState == false ){
135 legendInfo = "No Save Info";
141 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
144 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
145 <meta http-equiv="Pragma" content="no-cache">
146 <meta http-equiv="Cache-Control" content="no-cache">
147 <meta http-equiv="Expires" content="0">
148 <meta http-equiv="Content-Script-Type" content="text/javascript" />
149 <meta http-equiv="Content-Style-Type" content="text/css" />
150 <script src="l7gui.js" type="text/javascript"></script>
152 <meta http-equiv="refresh" content="<%= RedirectPages.NOSCRIPT_TIME %>; url=<%= RedirectPages.LOGIN %>"/>
154 <link rel="stylesheet" type="text/css" href="<%=cssSeat %>" />
155 <link rel="shortcut icon" href="images/favicon.ico" />
156 <title>Check Logout</title>
159 <body class="normal">
160 <jsp:include page="menu.jsp" flush="false"/>
164 <h1>Check Logout </h1>
165 <form method="post" action="logout_success.jsp">
167 if ( sessionTimeout == null ) {
168 if ( legendInfo != null ){
171 <legend><%=legendInfo %></legend>
172 <table class="status">
174 if ( saveState == false ){
178 <label for="noSaveCategory">No Save Category</label>
182 if ( logSaveState.equals(SessionKeys.NO_SAVE) )
183 out.println("<p class=\"text\"> Log </p>");
184 if ( vsSaveState.equals(SessionKeys.NO_SAVE ) )
185 out.println("<p class=\"text\"> Service </p>");
193 if ( syncState == 1){
197 <label for="noSyncCategory">No Sync Category</label>
201 if ( logSyncState.equals(SessionKeys.NO_SYNC) )
202 out.println("<p class=\"text\"> Log </p>");
203 if ( monitorSyncState.equals(SessionKeys.NO_SYNC ) )
204 out.println("<p class=\"text\"> Monitor </p>");
205 if ( vsSyncState.equals(SessionKeys.NO_SYNC ) )
206 out.println("<p class=\"text\"> Service </p>");
207 if ( repSyncState.equals(SessionKeys.NO_SYNC ) )
208 out.println("<p class=\"text\"> Replication </p>");
209 if ( snmpSyncState.equals(SessionKeys.NO_SYNC ) )
210 out.println("<p class=\"text\"> SNMPAgent </p>");
211 if ( guiSyncState.equals(SessionKeys.NO_SYNC ) )
212 out.println("<p class=\"text\"> GUI </p>");
227 <input type="submit" name="button" value="<%=ButtonMode.YES %>" onClick="return confirm(logout)" />