Commit 58fad132 58fad132a12daea1cedf7fb6110788bfad3282c5 by Christian Gerdes

Enkelt admin GUI som kan lägga till nya OraMon i listan.

Ingen annan funktionalitet ännu :)
1 parent 236de0e5
<%@page import="se.lil.om.Registry"%>
<%@page import="se.lil.om.OraMon"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
......@@ -10,21 +9,51 @@
<title>OraMon Admin</title>
</head>
<body>
<%
// Handling of actions
boolean error = false;
String errMsg = "";
if(request.getParameter("action").equals("add")) {
error = true;
errMsg = request.getParameter("data");
System.out.println(errMsg);
if(request.getParameter("action") != null) {
if(request.getParameter("action").equals("add")) {
if(request.getParameter("data") != null && request.getParameter("data").length() != 0) {
Registry.getList().add(new OraMon());
} else {
error = true;
errMsg = "Data is empty. Nothing added.";
}
}
}
%>
<% ArrayList<OraMon> monList = Registry.getList(); %>
<% if(error) { %>
<div style="background: yellow; padding: 10px; width: 100%">Error: <%= errMsg %></div>
<div style="background: Salmon; padding: 10px;">Error: <%= errMsg %></div>
<% } %>
<h1>OraMon Web 1.0</h1>
<h2>Status</h2>
<p>Number of monitors: <%= monList.size() %></p>
<% for (OraMon mon : Registry.getList()) { %>
<div style="background-color: LightSteelBlue; padding: 10px;">
<table>
<tr><td>Connection String</td><td><%= mon.getConString() %></td></tr>
</table>
</div>
<% } %>
<h1>OraMon Status</h1>
<p>Number of monitors: <%= monList.size() %>
<h2>Administration</h2>
<div title="Add Monitor" style="background: WhiteSmoke; padding: 10px;">
<form>
<table>
<tr><td>Data:</td><td><input name="data" size="50"></td></tr>
</table>
<input type="submit" name="action" value="add">
</form>
</div>
</body>
</html>
\ No newline at end of file
......