-
Notifications
You must be signed in to change notification settings - Fork 150
/
Copy pathavail_step_3.tt
173 lines (164 loc) · 6.85 KB
/
avail_step_3.tt
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
[% USE date %]
[% PROCESS _header.tt %]
[% PROCESS _infobox.tt %]
<h1 class="mt-5">Availability Report</h1>
<div class="card mx-auto min-w-[420px] max-w-[800px] w-full mt-5 overflow-hidden">
<div class="head p-0">
<span class="tabs w-44 px-2"><a class="flex" href="avail.cgi">1. Report Type</a></span>
<i class="fa-solid fa-angle-right text-sm"></i>
<span class="tabs w-44 px-2">
[% IF host %]
<a class="flex" href="avail.cgi?report_type=hosts">2. Select Host</a>
[% ELSIF hostgroup %]
<a class="flex" href="avail.cgi?report_type=hostgroups">2. Select Hostgroup</a>
[% ELSIF service %]
<a class="flex" href="avail.cgi?report_type=services">2. Select Service</a>
[% ELSIF servicegroup %]
<a class="flex" href="avail.cgi?report_type=servicegroups">2. Select Servicegroup</a>
[% END %]
</span>
<i class="fa-solid fa-angle-right text-sm"></i>
<span class="tabs w-44 active px-2"><a class="flex" href="#">3. Report Options</a></span>
</div>
<form method="get" action="avail.cgi" id="avail_form" class="overflow-x-auto">
<input type='hidden' name='show_log_entries' value=''>
[% IF host %]<input type='hidden' name='host' value="[% host | html %]">[% END %]
[% IF hostgroup %]<input type='hidden' name='hostgroup' value="[% hostgroup | html %]">[% END %]
[% IF service %]<input type='hidden' name='service' value="[% service | html %]">[% END %]
[% IF servicegroup %]<input type='hidden' name='servicegroup' value="[% servicegroup | html %]">[% END %]
<div class="body">
<table class="cellspacing-x">
<tr>
<th class="text-right align-top">Report Period</th>
<td>
[% t1 = date.now - 86400 %]
[% t2 = date.now %]
[% PROCESS _timeperiods_select_options.tt selected_timeperiod="" custom=1 name="timeperiod" t1=t1 t2=t2 current=0 show_hint=0 width="w-56" %]
</td>
</tr>
<tr>
<th class="text-right align-top">Report time Period</th>
<td>
<select name='rpttimeperiod' class="w-56">
<option value="">None</option>
[% FOREACH t = timeperiods %]
<option value="[% t.name | html %]">[% t.name | html %]</option>
[% END %]
</select>
</td>
</tr>
<tr>
<th class="text-right align-top">Assume Initial States</th>
<td>
<select name='assumeinitialstates'>
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
</td>
</tr>
<tr>
<th class="text-right align-top">Assume State Retention</th>
<td>
<select name='assumestateretention'>
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
</td>
</tr>
<tr>
<th class="text-right align-top">Assume States During Program Downtime</th>
<td>
<select name='assumestatesduringnotrunning'>
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
</td>
</tr>
<tr>
<th class="text-right align-top">Include Soft States</th>
<td>
<select name='includesoftstates'>
<option value="yes">Yes</option>
<option value="no" selected>No</option>
</select>
</td>
</tr>
[% UNLESS service %]
<tr>
<th class="text-right align-top">First Assumed Host State</th>
<td>
<select name='initialassumedhoststate' class="w-56">
<option value=0>Unspecified</option>
<option value=-1>Current State</option>
<option value=3>Host Up</option>
<option value=4>Host Down</option>
<option value=5>Host Unreachable</option>
</select>
</td>
</tr>
[% END %]
<tr>
<th class="text-right align-top">First Assumed Service State</th>
<td>
<select name='initialassumedservicestate' class="w-56">
<option value="0">Unspecified</option>
<option value="-1">Current State</option>
<option value="6">Service Ok</option>
<option value="8">Service Warning</option>
<option value="7">Service Unknown</option>
<option value="9">Service Critical</option>
</select>
</td>
</tr>
<tr>
<th class="text-right align-top">Output Format</th>
<td>
<div class="radiogroup w-56">
<input type="radio" name="view_mode" value="html" id="view_mode_0" checked><label for="view_mode_0">HTML</label>
<input type="radio" name="view_mode" value="xls" id="view_mode_1" ><label for="view_mode_1">XLS</label>
<input type="radio" name="view_mode" value="csv" id="view_mode_2" ><label for="view_mode_2">CSV</label>
<input type="radio" name="view_mode" value="json" id="view_mode_3" ><label for="view_mode_3">JSON</label>
</div>
</td>
</tr>
</table>
</div>
<div class="footer justify-center border-t-0">
<input class="green" type='submit' value='Create Availability Report'></td>
</div>
</form>
<div class="footer justify-center h-fit flexcol gap-2">
<h4 class="self-start mt-1">Other options:</h4>
<div class="w-full">
<table>
<tr>
<th class="w-1/4">Permanent url for this report:</th>
<td class="w-3/4 max-w-[10rem]">
<div class="flex">
<div class="truncate flex-1">
<a class="link" target="_blank" href="" id="permalink"></a>
</div>
<div>
<button class="iconOnly px-1 copy_button" onclick="copyCode(event, String(document.getElementById('permalink').href)); return false;"><i class="uil uil-copy" title="Copy to clipboard"></i></button>
</div>
</div>
</td>
</tr>
</table>
</div>
[% IF c.config.exists('use_feature_reports') && c.config.use_feature_reports %]
<div class="pb-2">
<input name="email" value="Create E-Mail Report" onclick="window.location='reports2.cgi?action=edit&report=new&template=report_from_url.tt&params.url='+encodeURIComponent(jQuery('#permalink').attr('href')); return false;" type="button">
</div>
[% END %]
</div>
</div>
<script>
function update_permalink() {
var link = 'avail.cgi?'+jQuery("#avail_form").find("input[type='hidden'], :input:not(:hidden)").serialize();
jQuery('#permalink').text(link).attr('href', link);
}
jQuery("#avail_form INPUT, #avail_form SELECT").on("change", update_permalink);
update_permalink();
</script>
[% PROCESS _footer.tt %]