debuggers.hg

view tools/control/web/tmpl/vd-vdcr.tmpl @ 636:73fab8c399fd

bitkeeper revision 1.333 (3f0d5c67WCK8celxi8KUCjs_eFc8QA)

Update web interface to work with new VBD interface.
Finish tidying up web build files
author rac61@labyrinth.cl.cam.ac.uk
date Thu Jul 10 12:30:31 2003 +0000 (2003-07-10)
parents e5cb8bd7ebfe
children
line source
1 Create New Virtual Disk
2 SECTION&XenoServers
3 BREADCRUMB&Virtual Disk Manager&vd.jsp
5 <!-- content -->
6 <img src="pixel.gif" class="block" width="1" height="12">
8 <table cellpadding="0" cellspacing="0" border="0">
9 <tbody>
10 INCLUDE&vdmenu.tmpl
11 <td valign="top">
14 <b>Create Virtual Disk Results</b>
15 <br>
17 <%
18 HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request);
19 String size = null;
20 String expiry_string = null;
21 long expiry = 0;
23 if (hsrw.getParameter("size") == null ||
24 hsrw.getParameter("size").trim().equals(""))
25 {
26 %>
27 Error: size not specified.<br>
28 <%
29 }
30 else if (hsrw.getParameter("expiry") == null ||
31 hsrw.getParameter("expiry").trim().equals(""))
32 {
33 %>
34 Error: expiry time not specified.<br>
35 <%
36 }
37 else
38 {
39 size = hsrw.getParameter("size").trim() +
40 hsrw.getParameter("sizeunits").trim();
42 try
43 {
44 expiry = Long.decode(hsrw.getParameter("expiry")).longValue();
46 /* not perfect, but good enough for now... */
47 if ( hsrw.getParameter("expiryunits").equals("d"))
48 {
49 expiry *= 24 * 60 * 60 * 1000;
50 }
51 else if ( hsrw.getParameter("expiryunits").equals("w"))
52 {
53 expiry *= 24 * 60 * 60 * 1000 * 7;
54 }
55 else if ( hsrw.getParameter("expiryunits").equals("m"))
56 {
57 expiry *= 24 * 60 * 60 * 1000 * 30;
58 }
59 else if ( hsrw.getParameter("expiryunits").equals("y"))
60 {
61 expiry *= 24 * 60 * 60 * 1000 * 365;
62 }
64 expiry += System.currentTimeMillis();
65 %>
66 output =<br>
67 <%= new CommandVdCreate( hsrw.getParameter("name"), Library.parseSize(size), new Date(expiry)).executeWeb() %>
68 <br>
69 <%
70 }
71 catch (NumberFormatException e)
72 {
73 %>
74 Error: invalid expiry time specification.<br>
75 <%
76 }
77 }
78 %>
80 <%
81 root.doFlushState();
82 %>
84 </td>
85 </tbody>
86 </table>
91 <!-- end content -->