OSDN Git Service

Initial commit
[ultramonkey-l7/l7gui.git] / src / WebContent / monitor_info.jsp
1 <%@ page
2         import="org.ultramonkey.l7.model.*,org.ultramonkey.l7.controller.*,org.ultramonkey.l7.view.*,java.util.*"
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(41319,
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 result message
22          */
23         MessageView message = (MessageView) session
24                         .getAttribute(SessionKeys.RESULT_MESSAGE);
25
26         String errorMessage = "";
27         int errorNumber = 0;
28         String category = "";
29         
30         if (message != null) {
31                 errorMessage = message.getMessage();
32                 errorNumber = message.getErrno();
33                 category = message.getCategory();
34                 session.setAttribute(SessionKeys.RESULT_MESSAGE, null);
35         }
36
37         /*
38          * get command message
39          */
40         MessageView commandmessage = (MessageView) session
41                         .getAttribute(SessionKeys.COMMAND_MESSAGE);
42
43         String commandMessage = "";
44         int commandNumber = 0;
45         String commandCategory = "";
46
47         if (commandmessage != null) {
48                 commandMessage = commandmessage.getMessage();
49                 commandNumber = commandmessage.getErrno();
50                 commandCategory = commandmessage.getCategory();
51                 session.setAttribute(SessionKeys.COMMAND_MESSAGE, null);
52         }
53
54         /*
55          * get DirectorData
56          */
57         L7guiFramework framework = new L7guiFramework();
58         DirectorData dd = framework.getDirectorData();
59         if (dd == null) {
60                 MessageView error = new MessageView(41320,
61                 LogCategorySet.GUI_IO_FILE, Message.UNEXPECTED_ERROR);
62                 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
63                 response.sendRedirect(RedirectPages.LOGIN);
64                 return;
65         }
66
67         /*
68          * get cluster status
69          */
70         ClusterData cd = framework.getClusterData();
71         if (cd == null) {
72                 MessageView error = new MessageView(41321,
73                 LogCategorySet.GUI_IO_COMMAND,
74                 Message.CLUSTER_DATA_ERROR);
75                 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
76                 response.sendRedirect(RedirectPages.LOGIN);
77                 return;
78         }
79
80         /*
81          * fix style seat
82          */
83         String cssSeat = "l7gui_single_style.css";
84         if (cd.self_status == ClusterStatus.ACTIVE) {
85                 cssSeat = "l7gui_act_style.css";
86         } else if (cd.self_status == ClusterStatus.STANDBY) {
87                 cssSeat = "l7gui_sby_style.css";
88         }
89 %>
90
91 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
92 <html>
93 <head>
94         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
95         <meta http-equiv="Pragma" content="no-cache">
96         <meta http-equiv="Cache-Control" content="no-cache">
97         <meta http-equiv="Expires" content="0">                 
98         <meta http-equiv="Content-Script-Type" content="text/javascript" />
99         <meta http-equiv="Content-Style-Type" content="text/css" />
100         <script src="l7gui.js" type="text/javascript"></script>
101         <noscript>
102         <meta http-equiv="refresh"
103                 content="<%= RedirectPages.NOSCRIPT_TIME %>; url=<%= RedirectPages.LOGIN %>" />
104         </noscript>
105         <link rel="stylesheet" type="text/css" href="<%=cssSeat %>" />
106         <link rel="shortcut icon" href="images/favicon.ico" />
107
108         <title>Monitor Current Status</title>
109 </head>
110
111 <body class="normal">
112 <jsp:include page="menu.jsp" flush="false" />
113
114 <div id="content">
115
116
117 <h1>Monitor Current Status</h1>
118
119 <%
120 if (message != null) {
121 %>
122
123 <p class="error">[<%=category%>-<%=errorNumber%>]</p>
124 <p class="error"><%=errorMessage%></p>
125
126 <%
127 } else if (commandmessage != null) {
128 %>
129 <p class="success">[<%=commandCategory%>-<%=commandNumber%>]</p>
130 <p class="success"><%=commandMessage%></p>
131 <%
132 }
133 %>
134
135 <fieldset><legend>Monitor Settings</legend>
136 <table class="infotable">
137         <tr>
138                 <th class="left"><label for="checkTimeOut">CheckTimeOut</label></th>
139                 <td class="null">
140                 <%
141                         if ( (null != dd.checkTimeOut) && ("" != dd.checkTimeOut) )
142                                 out.print(dd.checkTimeOut + " [sec]");
143                 %>
144                 </td>
145         </tr>
146
147         <tr>
148                 <th class="left"><label for="negotiateTimeOut">NegotiateTimeOut</label>
149                 </th>
150                 <td class="null">
151                 <%
152                         if ( (null != dd.negotiateTimeOut) && ("" != dd.negotiateTimeOut) )
153                                 out.print(dd.negotiateTimeOut + " [sec]");
154                 %>
155                 </td>
156         </tr>
157
158         <tr>
159                 <th class="left"><label for="checkInterval">CheckInterval</label>
160                 </th>
161                 <td class="null">
162                 <%
163                         if ( (null != dd.checkInterval) && ("" != dd.checkInterval) )
164                                 out.print(dd.checkInterval + " [sec]");
165                 %>
166                 </td>
167         </tr>
168
169         <tr>
170                 <th class="left"><label for="checkCount">CheckCount</label></th>
171                 <td class="null">
172                 <%
173                         if ( (null != dd.checkCount) && ("" != dd.checkCount) )
174                                 out.print(dd.checkCount + " [time]");
175                 %>
176                 </td>
177         </tr>
178
179         <tr>
180                 <th class="left"><label for="callback">Callback</label></th>
181                 <td class="null">
182                 <%
183                         if (null != dd.callback)
184                                 out.print(dd.callback);
185                 %>
186                 </td>
187         </tr>
188
189         <tr>
190                 <th class="left"><label for="fallback">Fallback</label></th>
191                 <td class="null">
192                 <%
193                         if (null != dd.fallback)
194                                 out.print(dd.fallback);
195                 %>
196                 </td>
197         </tr>
198
199         <tr>
200                 <th class="left"><label for="logfile">Logfile</label></th>
201                 <td class="null">
202                 <%
203                         if (null != dd.logfile)
204                                 out.print(dd.logfile);
205                 %>
206                 </td>
207         </tr>
208
209         <tr>
210                 <th class="left"><label for="execute">Execute</label></th>
211                 <td class="null">
212                 <%
213                         if (null != dd.execute)
214                                 out.print(dd.execute);
215                 %>
216                 </td>
217         </tr>
218
219         <tr>
220                 <th class="left"><label for="supervised">Supervised</label></th>
221                 <td class="null">
222                 <%
223                         if (null != dd.supervised)
224                                 out.print(dd.supervised);
225                 %>
226                 </td>
227         </tr>
228
229         <tr>
230                 <th class="left"><label for="quiescent">Quiescent</label></th>
231                 <td class="null">
232                 <%
233                         if (null != dd.quiescent)
234                                 out.print(dd.quiescent);
235                 %>
236                 </td>
237         </tr>
238
239 </table>
240 </fieldset>
241
242
243 <h2>Modify Monitor setting</h2>
244 <h4>Please push the following button, if you would like to modify the Monitor setting.</h4>
245 <form method="post" action="monitor_modify.jsp">
246         <input type="submit" value="Modify">
247 </form>
248 </div>
249 </body>
250 </html>