Enkelt admin GUI som kan lägga till nya OraMon i listan.
Ingen annan funktionalitet ännu :)
Showing
2 changed files
with
37 additions
and
8 deletions
1 | <%@page import="se.lil.om.Registry"%> | 1 | <%@page import="se.lil.om.Registry"%> |
2 | <%@page import="se.lil.om.OraMon"%> | 2 | <%@page import="se.lil.om.OraMon"%> |
3 | <%@page import="java.util.ArrayList"%> | 3 | <%@page import="java.util.ArrayList"%> |
4 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" | 4 | <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> |
5 | pageEncoding="ISO-8859-1"%> | ||
6 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | 5 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
7 | <html> | 6 | <html> |
8 | <head> | 7 | <head> |
... | @@ -10,21 +9,51 @@ | ... | @@ -10,21 +9,51 @@ |
10 | <title>OraMon Admin</title> | 9 | <title>OraMon Admin</title> |
11 | </head> | 10 | </head> |
12 | <body> | 11 | <body> |
12 | |||
13 | <% | 13 | <% |
14 | // Handling of actions | ||
14 | boolean error = false; | 15 | boolean error = false; |
15 | String errMsg = ""; | 16 | String errMsg = ""; |
16 | if(request.getParameter("action").equals("add")) { | 17 | if(request.getParameter("action") != null) { |
18 | if(request.getParameter("action").equals("add")) { | ||
19 | if(request.getParameter("data") != null && request.getParameter("data").length() != 0) { | ||
20 | Registry.getList().add(new OraMon()); | ||
21 | } else { | ||
17 | error = true; | 22 | error = true; |
18 | errMsg = request.getParameter("data"); | 23 | errMsg = "Data is empty. Nothing added."; |
19 | System.out.println(errMsg); | 24 | } |
25 | } | ||
20 | } | 26 | } |
21 | %> | 27 | %> |
22 | 28 | ||
23 | <% ArrayList<OraMon> monList = Registry.getList(); %> | 29 | <% ArrayList<OraMon> monList = Registry.getList(); %> |
30 | |||
24 | <% if(error) { %> | 31 | <% if(error) { %> |
25 | <div style="background: yellow; padding: 10px; width: 100%">Error: <%= errMsg %></div> | 32 | <div style="background: Salmon; padding: 10px;">Error: <%= errMsg %></div> |
33 | <% } %> | ||
34 | |||
35 | <h1>OraMon Web 1.0</h1> | ||
36 | |||
37 | <h2>Status</h2> | ||
38 | |||
39 | <p>Number of monitors: <%= monList.size() %></p> | ||
40 | <% for (OraMon mon : Registry.getList()) { %> | ||
41 | <div style="background-color: LightSteelBlue; padding: 10px;"> | ||
42 | <table> | ||
43 | <tr><td>Connection String</td><td><%= mon.getConString() %></td></tr> | ||
44 | </table> | ||
45 | </div> | ||
26 | <% } %> | 46 | <% } %> |
27 | <h1>OraMon Status</h1> | 47 | |
28 | <p>Number of monitors: <%= monList.size() %> | 48 | <h2>Administration</h2> |
49 | |||
50 | <div title="Add Monitor" style="background: WhiteSmoke; padding: 10px;"> | ||
51 | <form> | ||
52 | <table> | ||
53 | <tr><td>Data:</td><td><input name="data" size="50"></td></tr> | ||
54 | </table> | ||
55 | <input type="submit" name="action" value="add"> | ||
56 | </form> | ||
57 | </div> | ||
29 | </body> | 58 | </body> |
30 | </html> | 59 | </html> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
No preview for this file type
-
Please register or sign in to post a comment