forked from ecloudcontrol/tomcat9-helloworld
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclock.jsp
More file actions
195 lines (164 loc) · 6.41 KB
/
clock.jsp
File metadata and controls
195 lines (164 loc) · 6.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<html>
<head>
<title><%=System.getProperty("title")%></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<style>
* {
box-sizing: border-box;
font-family: verdana;
}
label {
padding: 1px 1px 1px 0;
display: inline-block;
}
.column {
float: left;
width: 25%;
padding: 10px;
height: 50px; /* Should be removed. Only for demonstration */
}
.gap {
float: left;
width: 100%;
padding: 1px;
height: 1px; /* Should be removed. Only for demonstration */
}
.column-mid {
background-color:#3377ff;
float: left;
width: 25%;
padding: 10px;
height: 50px; /* Should be removed. Only for demonstration */
}
.column-mid-white {
background-color:#3377ff;
color: white;
float: left;
width: 25%;
padding: 10px;
height: 50px; /* Should be removed. Only for demonstration */
}
.column-50 {
background-color:#f1f1f1;
float: left;
width: 50%;
padding: 10px;
height: 50px; /* Should be removed. Only for demonstration */
}
.column-50-blue {
background-color:#3377e0;
float: left;
width: 50%;
padding: 10px;
height: 50px; /* Should be removed. Only for demonstration */
}
.text-bk {
background-color:#3377ff;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
.responsive {
width: 100%;
max-width: 250px;
height: auto;
}
</style>
<script type="text/javascript">
function load()
{
setTimeout("window.open(self.location, '_self');", 1000);
}
</script>
</head>
<body onload="load()"">
<div class="row">
<div>
<h1 style="color:#DAA520;"><center>APP-Z DEMO</center></h1>
<p><center>Fully Automated Hybrid Cloud Platform</center></p>
</div>
</div>
<div class="row">
<div class="column">
</div>
<div class="column-mid-white">
<label for="app"><%=System.getProperty("title")%></label>
</div>
<div class="column-mid-white" style="text-align:right">
<label for="ver">VERSION: <%= System.getProperty("appz.image_version")%></label>
</div>
<div class="column">
</div>
</div>
<div class="row">
<div class="column" style="height:100px">
</div>
<div class="column-50" style="text-align:center; height:100px">
<%@ page import="java.io.*,java.util.*"%>
<%
// Set refresh, autoload time as 1 seconds
//response.setIntHeader("Refresh", 1);
// Get current time
Calendar calendar = new GregorianCalendar();
String am_pm;
int hour = calendar.get(Calendar.HOUR);
int minute = calendar.get(Calendar.MINUTE);
int second = calendar.get(Calendar.SECOND);
if (calendar.get(Calendar.AM_PM) == 0)
am_pm = "AM";
else
am_pm = "PM";
String CT = (hour < 10 ? "0" : "") + hour + ":" + (minute < 10 ? "0" : "") + minute + ":" + (second < 10 ? "0" : "") + second + " " + am_pm;
%>
<label for="time"><h1>TIME: <%=CT %></h1></label>
</div>
<div class="column" style="height:100px">
</div>
</div>
<div class="row">
<div class="column">
</div>
<div class="column-mid-white">
<%@ page import="java.net.*"%>
<%
String ipValue = "error";
try {
InetAddress inetAddress;
ipValue = InetAddress.getLocalHost().getHostAddress();
} catch (UnknownHostException e) {
e.printStackTrace();
}
%>
<label for="ip">IP: <%=ipValue %></label>
</div>
<div class="column-mid-white" style="text-align:right">
<label for="nano">NANO: <%= System.getProperty("nano")%></label>
</div>
<div class="column">
</div>
</div>
<div class="row">
<div class="gap">
</div>
</div>
<div class="row">
<div class="column">
</div>
<div class="column-50-blue" style="text-align:center; height:125px">
<h4 style="color:#e1e1e1"><center>Application Server</center></h4>
<h2 style="color:white;"><center><%= application.getServerInfo().indexOf('$') > 0 ? application.getServerInfo().split("/")[0] : application.getServerInfo() %></center></h2>
</div>
<div class="column">
</div>
</div>
<div class="row">
<div>
<center><img src="cloud_logo.png" alt="CLOUDBOURNE" class="responsive" width="90px" height="50"></center>
</div>
</div>
</body>
</html>