-
Notifications
You must be signed in to change notification settings - Fork 1
/
form.html
88 lines (83 loc) · 2.26 KB
/
form.html
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
<style type="text/css">
body {
background-color: #f0f0f2;
margin: 0;
padding: 0;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
div {
margin: 5em;
padding: 50px;
background-color: #fff;
border-radius: 1em;
}
a:link, a:visited {
color: #38488f;
text-decoration: none;
}
#zMonConfigBox {
width: 50%;
display: table;
}
#configForm {
width: 300px;
display: table-cell;
}
#result {
display: table-cell;
vertical-align: middle;
}
#zmonTarget {
margin: 2px;
width: 404px;
height: 249px;
}
</style>
<title></title>
<style type="text/css">
div.c1 {display: table-row}
</style>
</head>
<body>
<script type="text/javascript">
/*
* Generates a JSON encoded Zmon configuration from the ZmonConfig form.
*/
function GenerateZmonConfig()
{
v = [
{disk: document.forms.zmonform.partition.value},
{tcp: document.forms.zmonform.tcpPort.value},
{st: document.forms.zmonform.alertTo.value},
{sf: document.forms.zmonform.alertFrom.value},
]
document.forms.zmonform.zmonTarget.value = JSON.stringify(v);
}
</script>
<div class="c1" id="zMonConfigBox">
<form id="zmonform" action="" method="post" onsubmit="setTimeout('GenerateZmonConfig()', 0); return false;" name="zmonform">
<div id="configForm">
<h3>Disk Partition Mount Point</h3>
<p><input type="text" name="partition" value="/"></p>
<h3>TCP Host:Port</h3>
<p><input type="text" name="tcpPort" value="localhost:22"></p>
<h3>Alert To</h3>
<p><input type="text" name="alertTo" value="[email protected]"></p>
<h3>Alert From</h3>
<p><input type="text" name="alertFrom" value="[email protected]"></p>
</div>
<div id="result">
<h3>Your Zmon configuration</h3>
<span id="configResult">
<textarea id="zmonTarget" rows=5 cols=10 disabled="disabled">
Press Generate
</textarea>
<input type="submit" name="submitbutton" value="Generate"></span></div>
</form>
</div>
</body>
</html>