-
Notifications
You must be signed in to change notification settings - Fork 215
/
index.template.html
102 lines (99 loc) · 4.25 KB
/
index.template.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{%TEMPLATE->struct/head%}
{%TEMPLATE->struct/menu%}
<h2>Health Checks</h2>
{%TEMPLATE->struct/messages%}
<div class="alert alert-info">
Health checks can be used to check if all agents are working properly. Note that a health check won't be finished until all registered agents report back their results.
</div>
<div class="card">
<div class="table-responsive">
<table class="table table-bordered">
<tr>
<th>Check ID</th>
<th>Created</th>
<th>Type</th>
<th>Status</th>
<th> </th>
</tr>
{{FOREACH check;[[checks]]}}
<tr>
<td>[[check.getId()]]</td>
<td>[[date([[config.getVal([[$DConfig::TIME_FORMAT]])]], [[check.getTime()]])]]</td>
<td>{{IF [[check.getCheckType()]] == [[$DHealthCheckType::BRUTE_FORCE]]}}Brute-Force{{ENDIF}} ([[Util::getHashtypeById([[check.getHashtypeId()]])]])</td>
<td>
{{IF [[check.getStatus()]] == [[$DHealthCheckStatus::PENDING]]}}
Running
{{ENDIF}}
{{IF [[check.getStatus()]] == [[$DHealthCheckStatus::COMPLETED]]}}
Completed
{{ENDIF}}
{{IF [[check.getStatus()]] == [[$DHealthCheckStatus::ABORTED]]}}
Aborted
{{ENDIF}}
</td>
<td>
<a href="health.php?id=[[check.getId()]]" class="float-right mx-1 btn btn-primary">View</a>
</td>
</tr>
{{ENDFOREACH}}
{{IF [[sizeof([[checks]])]] == 0}}
<tr><td>---</td><td>---</td><td>---</td><td>---</td><td>---</td></tr>
{{ENDIF}}
<tr>
<td colspan="5">
<form class="form-inline" method="post" action="">
<input type="hidden" name="action" value="[[$DHealthCheckAction::CREATE]]">
<input type="hidden" name="csrf" value="[[csrf]]">
<select class="form-control mx-1" name="type" title="Type">
<option value="0">Brute-Force</option>
</select>
<select class="form-control mx-1" name="hashtypeId" title="Hash Type">
<option value="0">MD5</option>
<option value="3200">BCRYPT</option>
</select>
<select name="crackerBinaryTypeId" id="crackerBinaryType" class="form-control mx-1" title="Cracker Binary">
{{FOREACH binary;[[binaries]]}}
<option value="[[binary.getId()]]">[[binary.getTypeName()]]</option>
{{ENDFOREACH}}
</select>
<select name="crackerBinaryVersionId" id="crackerBinaryVersion" class="form-control" title="Binary Version">
<option value="0"> </option>
</select>
<script type="text/javascript">
var versions = [];
{{FOREACH version;[[versions]]}}
if ([[version.getCrackerBinaryTypeId()]] in versions) {
versions[ [[version.getCrackerBinaryTypeId()]] ].push(["[[version.getVersion()]]", [[version.getId()]] ]);
}
else{
versions [ [[version.getCrackerBinaryTypeId()]] ] = [ ["[[version.getVersion()]]", [[version.getId()]] ] ];
}
{{ENDFOREACH}}
configureDropDownLists(document.getElementById('crackerBinaryType'), document.getElementById('crackerBinaryVersion'));
$("#crackerBinaryType").change(function() {
configureDropDownLists(document.getElementById('crackerBinaryType'), document.getElementById('crackerBinaryVersion'));
});
function configureDropDownLists(ddl1, ddl2) {
ddl2.options.length = 0;
if (ddl1.value.length === 0) {
return;
}
for (i = 0; i < versions[ddl1.value].length; i++){
createOption(ddl2, versions[ddl1.value][i][0], versions[ddl1.value][i][1]);
}
}
function createOption(ddl, text, value) {
var opt = document.createElement('option');
opt.value = value;
opt.text = text;
ddl.options.add(opt);
}
</script>
<button type="submit" class="btn btn-success mx-1">Create</button>
</form>
</td>
</tr>
</table>
</div>
</div>
{%TEMPLATE->struct/foot%}