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"
11 L7guiServletBase base = new L7guiServletBase();
12 if (session.isNew() || base.checkSession(session) == false) {
13 MessageView error = new MessageView(41387, LogCategorySet.GUI_USER_AUTHENTICATION,
14 Message.INVALID_SESSSION);
15 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
16 response.sendRedirect(RedirectPages.LOGIN);
23 MessageView message = (MessageView) session.getAttribute(SessionKeys.RESULT_MESSAGE);
24 String errorMessage = "";
27 if (message != null) {
28 errorMessage = message.getMessage();
29 errorNumber = message.getErrno();
30 category = message.getCategory();
31 session.setAttribute(SessionKeys.RESULT_MESSAGE, null);
37 MessageView commandmessage = (MessageView) session.getAttribute(SessionKeys.COMMAND_MESSAGE);
38 String commandMessage = "";
39 int commandNumber = 0;
40 String commandCategory = "";
41 if (commandmessage != null) {
42 commandMessage = commandmessage.getMessage();
43 commandNumber = commandmessage.getErrno();
44 commandCategory = commandmessage.getCategory();
45 session.setAttribute(SessionKeys.COMMAND_MESSAGE, null);
51 L7guiFramework framework = new L7guiFramework();
52 ClusterData cd = framework.getClusterData();
54 MessageView error = new MessageView(41388, LogCategorySet.GUI_USER_AUTHENTICATION,
55 Message.CLUSTER_DATA_ERROR);
56 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
57 response.sendRedirect(RedirectPages.LOGIN);
60 session.setAttribute("cd",cd);
63 * get sync status and get self/other IP
65 String syncLogStatus = null;
66 String syncMonitorStatus = null;
67 String syncServiceStatus = null;
68 String syncRepStatus = null;
69 String syncSnmpStatus = null;
70 String syncGuiStatus = null;
72 String otherIp = null;
75 if ( (cd.self_status == ClusterStatus.ACTIVE ) || (cd.self_status == ClusterStatus.STANDBY) ){
77 syncLogStatus = (String)session.getAttribute(SessionKeys.LOG_SYNC_STATE);
78 syncMonitorStatus = (String)session.getAttribute(SessionKeys.MONITOR_SYNC_STATE);
79 syncServiceStatus = (String)session.getAttribute(SessionKeys.VS_SYNC_STATE);
80 syncRepStatus = (String)session.getAttribute(SessionKeys.REP_SYNC_STATE);
81 syncSnmpStatus = (String)session.getAttribute(SessionKeys.SNMP_SYNC_STATE);
82 syncGuiStatus = (String)session.getAttribute(SessionKeys.GUI_SYNC_STATE);
83 if ( (syncLogStatus == null) || (syncMonitorStatus == null) || (syncServiceStatus == null)
84 || (syncRepStatus == null) || (syncSnmpStatus == null) || (syncGuiStatus == null) ){
86 MessageView error = new MessageView(41389, LogCategorySet.GUI_USER_AUTHENTICATION,
87 Message.CLUSTER_DATA_ERROR);
88 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
89 response.sendRedirect(RedirectPages.LOGIN);
95 otherIp = cd.other_ip;
96 if ( (selfIp == null) || (otherIp == null) ){
97 MessageView error = new MessageView(41390, LogCategorySet.GUI_IO_COMMAND,
98 Message.CLUSTER_DATA_ERROR);
99 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
100 response.sendRedirect(RedirectPages.LOGIN);
109 String cssSeat = "l7gui_single_style.css";
110 if ( cd.self_status == ClusterStatus.ACTIVE ){
111 cssSeat = "l7gui_act_style.css";
113 else if ( cd.self_status == ClusterStatus.STANDBY ){
114 cssSeat = "l7gui_sby_style.css";
120 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
123 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
124 <meta http-equiv="Pragma" content="no-cache">
125 <meta http-equiv="Cache-Control" content="no-cache">
126 <meta http-equiv="Expires" content="0">
127 <meta http-equiv="Content-Script-Type" content="text/javascript" />
128 <meta http-equiv="Content-Style-Type" content="text/css" />
129 <script src="l7gui.js" type="text/javascript"></script>
131 <meta http-equiv="refresh" content="<%= RedirectPages.NOSCRIPT_TIME %>; url=<%= RedirectPages.LOGIN %>"/>
133 <link rel="stylesheet" type="text/css" href="<%=cssSeat %>" />
134 <link rel="shortcut icon" href="images/favicon.ico" />
136 <title>Sync Resources</title>
139 <body class="normal">
140 <jsp:include page="menu.jsp" flush="false"/>
144 <h1>Sync Resources</h1>
145 <% if ( (cd.self_status != ClusterStatus.ACTIVE ) && (cd.self_status != ClusterStatus.STANDBY) ){
147 <p class="error">"Sync Resources" function is effective only when cluster is applied. </p>
152 if (message != null) {
155 <p class="error">[<%=category %>-<%=errorNumber %>]</p>
156 <p class="error"><%=errorMessage %></p>
160 else if (commandmessage != null ){
162 <p class="success">[<%=commandCategory %>-<%=commandNumber %>]</p>
163 <p class="success"><%=commandMessage %></p>
169 <form method="post" action="SyncStateServlet" name="sync">
171 <legend>Sync Info</legend>
172 <h3> <%= selfIp %> <img class="arrow2" src="images/arrowlogo2.gif" alt="arrowlogo" /> <%=otherIp %> </h3>
175 <table class="infotable" cellspacing="0">
178 <th>Sync<br />CHECK</th><th>Category</th><th>Description</th>
183 <td class="center"><input type="checkbox" name="sync_category" value="log_all"></td>
184 <td class="left">Log</td>
185 <td class="left"> Log settings</td>
188 <td class="center"><input type="checkbox" name="sync_category" value="monitor"></td>
189 <td class="left">Monitor</td>
190 <td class="left">Monitor settings</td>
193 <td class="center"><input type="checkbox" name="sync_category" value="service"></td>
194 <td class="left">Service</td>
195 <td class="left">VirtualService settings</td>
198 <td class="center"><input type="checkbox" name="sync_category" value="replication_info"></td>
199 <td class="left">Replication</td>
200 <td class="left">Replication settings</td>
203 <td class="center"><input type="checkbox" name="sync_category" value="snmp_info"></td>
204 <td class="left">SNMP Agent</td>
205 <td class="left">SNMP Agent settings</td>
208 <td class="center"><input type="checkbox" name="sync_category" value="userdata"></td>
209 <td class="left">GUI</td>
210 <td class="left">GUI User Management (Users & Password)</td>
216 <input type="submit" name="button" value="<%=ButtonMode.SAVESYNC%>" onClick="return confirm(savesync)" />