forked from bmelim/zabdash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgroups.php
83 lines (63 loc) · 2.72 KB
/
groups.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
require_once '../include/config.inc.php';
require_once '../include/hosts.inc.php';
require_once '../include/actions.inc.php';
include('config.php');
if(isset($_REQUEST['sel']) && $_REQUEST['sel'] != '' && $_REQUEST['sel'] == 1) {
$group = $_POST['groupid'];
}
//check version
if(ZABBIX_EXPORT_VERSION >= '4.0'){
$grps = 'hstgrp';
}
else {
$grps = 'groups';
}
$dbGroups = DBselect( 'SELECT * FROM '.$grps.' WHERE groupid <> 1 ORDER BY name ASC');
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Language" content="pt-br">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--<meta http-equiv='refresh' content='90'>-->
<title>ZabDash - Hosts Groups</title>
<link rel="icon" href="img/favicon.ico" type="image/x-icon" />
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/font-awesome.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.10.2.custom.min.js"></script>
<link href="inc/select2/select2.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="inc/select2/select2.js" language="javascript"></script>
</head>
<body>
<div class="row col-md-12 col-sm-12" style="margin-top:50px; margin-bottom: 20px; float:none; margin-right:auto; margin-left:auto; text-align:center;">
<span><h3><i class="fa fa-desktop"></i> <?php echo _('Host groups'); ?></h3></span>
<form id="form1" name="form1" class="form_rel" method="post" action="groups.php?sel=1" style="margin-top:30px; margin-bottom: 20px;">
<select id='groupid' name='groupid[]' multiple style='width: 300px; height: 27px;' autofocus data-placeholder="<?php echo $labels['Select one or more groups']; ?>">
<option value='-1'> <?php echo _('All'); ?> </option>
<?php
while ($groups = DBFetch($dbGroups)) {
echo "<option value='".$groups['groupid']."'>".$groups['name']."</option>\n";
}
?>
</select><br><br><p>
<button type='button' class='btn btn-primary' onclick='javascript:this.form.submit();'><?php echo _('Apply'); ?></button>
<button type='button' class='btn btn-primary' onclick="javascript:location.href='groups.php';"><?php echo _('Reset'); ?></button>
</form>
<?php
if($group != '') {
echo '<script language="javascript"> window.open(\'hosts.php?groupid='.implode(",",$group).'\',\'_blank\'); </script>';
}
?>
</div>
<script type="text/javascript">
$("#groupid").select2();
</script>
</body>
</html>