-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
166 lines (153 loc) · 6.71 KB
/
index.php
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
<?php
$initializeDatabase = false; $section = 'Dashboard';
$css = [ 'assets/css/dashboard.css' ];
require_once 'views/header.php';
?>
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom">
<h1 class="h2"> <?= $section ?> </h1>
<div class="btn-toolbar mb-2 mb-md-0">
<div class="btn-group mr-2">
<button id="addServerBtn" class="btn btn-sm btn-outline-secondary"> Add server </button>
</div>
</div>
</div>
<div id="serverListProgress" class="progress">
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 0%"></div>
</div>
<div id="serverListTable" class="table-responsive" style="display: none;">
<table class="table table-striped table-sm text-center border-bottom">
<thead>
<tr>
<th> Image </th>
<th> Description </th>
<th> Hostname </th>
<th> IP address </th>
<th> Actions </th>
</tr>
</thead>
<tbody>
<!-- To be filled through Javascript -->
</tbody>
</table>
<p class="text-right">
Displaying a total of <span id="serverListCount">0</span> servers.
</p>
</div>
<div id="serverImageModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myExtraLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title h4" id="myExtraLargeModalLabel">
Server image
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body text-center"></div>
</div>
</div>
</div>
<div
class="modal fade"
id="serverDataModal"
tabindex="-1"
role="dialog"
aria-labelledby="serverDataModalLabel"
aria-hidden="true"
data-edit="null"
>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="serverDataModalLabel"> <span class="modalMode"> Add </span> server </h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="serverDescription" class="col-form-label"> Description </label>
<textarea class="form-control" id="serverDescription" maxlength="200"></textarea>
<div class="invalid-feedback">
Please provide a valid description.
</div>
</div>
<div class="form-group">
<label for="serverHostname" class="col-form-label">Hostname</label>
<input type="text" class="form-control" id="serverHostname">
<div class="invalid-feedback">
Please provide a valid hostname.
</div>
</div>
<div class="form-group">
<label for="serverIP" class="col-form-label">IP address</label>
<input type="text" class="form-control" id="serverIP">
<div class="invalid-feedback">
Please provide a valid IP address.
</div>
</div>
<label class="col-form-label"> Image </label>
<div class="custom-file">
<input type="file" class="custom-file-input" id="serverImage">
<label id="serverImageLabel" class="custom-file-label" for="serverImage">Choose file...</label>
<div class="invalid-feedback">
Invalid image, please select either a jpg/jpeg, gif or png, all 300x300 px.
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">
Close
</button>
<button id="saveServerBtn" type="button" class="btn btn-primary">
Save
</button>
</div>
</div>
</div>
</div>
<div id="removeServerModal" class="modal fade" tabindex="-1" role="dialog" data-remove="null" data-confirmed="false">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"> Remove server </h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>
Do you really want to remove this server?
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"> No </button>
<button id="removeConfirmBtn" type="button" class="btn btn-danger"> Yes </button>
</div>
</div>
</div>
</div>
<div id="serverStatusModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myExtraLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title h4" id="myExtraLargeModalLabel">
Server status
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body text-center">
<p class="text-center"> # of active processes </p>
<canvas class="my-4 border-bottom" id="processesChart" width="900" height="380"></canvas>
<p class="text-center"> # of active sessions </p>
<canvas class="my-4 border-bottom" id="sessionsChart" width="900" height="380"></canvas>
</div>
</div>
</div>
</div>
<?php require_once 'views/footer.php'; ?>