-
Notifications
You must be signed in to change notification settings - Fork 82
/
list_hypervisors.php
83 lines (82 loc) · 3.65 KB
/
list_hypervisors.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
<?php
/*
KVM-VDI
Tadas Ustinavičius
Vilnius,Lithuania.
2017-07-20
*/
include ('functions/config.php');
require_once('functions/functions.php');
if (!check_session()){
header ("Location: $serviceurl/?error=1");
exit;
}
set_lang();
$hypervisors_reply=get_SQL_array("SELECT * FROM hypervisors ORDER BY name,ip DESC");
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link href="inc/x-editable/bootstrap3-editable/css/bootstrap-editable.css" rel="stylesheet">
<script src="inc/x-editable/bootstrap3-editable/js/bootstrap-editable.js"></script>
<script src="inc/js/modal/kvm-vdi-kvm-hypervisors.js"></script>
</head>
<body>
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title"><?php echo _("Modify hypervisors");?></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-3 hypervisor-line">
Name
</div>
<div class="col-md-3 hypervisor-line">
Address
</div>
<div class="col-md-3 hypervisor-line">
SPICE address
</div>
<div class="col-md-3 hypervisor-line">
</div>
</div>
<?php
$x=0;
while ($x < sizeof($hypervisors_reply)){
echo '<div class="row hypervisor-list" id="row-name-' . $hypervisors_reply[$x]['id'] . '">
<div class="col-md-3 hypervisor-line name-' . $hypervisors_reply[$x]['id'] . '">
<a href="#" class="hypervisor" data-type="text" data-name="update-name" data-pk="' . $hypervisors_reply[$x]['id'] . '" data-url="inc/infrastructure/KVM/UpdateHypervisors.php">' . $hypervisors_reply[$x]['name'] . '</a>
</div>
<div class="col-md-3 hypervisor-line name-' . $hypervisors_reply[$x]['id'] . '">
<a href="#" class="hypervisor" data-type="text" data-name="update-address" data-pk="' . $hypervisors_reply[$x]['id'] . '" data-url="inc/infrastructure/KVM/UpdateHypervisors.php">' . $hypervisors_reply[$x]['ip'] . '</a>
</div>
<div class="col-md-3 hypervisor-line name-' . $hypervisors_reply[$x]['id'] . '">
<a href="#" class="hypervisor" data-type="text" data-name="update-spice" data-pk="' . $hypervisors_reply[$x]['id'] . '" data-url="inc/infrastructure/KVM/UpdateHypervisors.php">' . $hypervisors_reply[$x]['address2'] . '</a>
</div>
<div class="col-md-3 hypervisor-line">
<input class="hide" type="checkbox" name="hypervisor[]" value="' . $hypervisors_reply[$x]['id'] . '" id="hypervisor-' . $hypervisors_reply[$x]['id'] . '">
<button type="button" class="btn btn-warning DeleteHypervisorButton" data-id="' . $hypervisors_reply[$x]['id'] . '">' . _("Delete") . '</button>
</div>
</div>';
++$x;
}
?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo _("Close");?></button>
<button type="button" class="btn btn-primary hide" id="SubmitHypervisorsButton"><?php echo _("Save changes");?></button>
</div>
</div>
</body>
<script>
$(document).ready(function(){
$('.hypervisor').editable({
success: function(response, newValue) {
refresh_screen();
}
});
});
</script>
</html>