-
Notifications
You must be signed in to change notification settings - Fork 56
/
show_graph.php
119 lines (92 loc) · 2.62 KB
/
show_graph.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
<?php
$ip = $_GET['ip'];
$dbname = $_GET['dbname'];
$port = $_GET['port'];
?>
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>图形展示</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/echarts.common.min.js"></script>
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/shine.js"></script>
</head>
<body style="height: 100%; margin: 0">
<!-- 定义查询时间间隔 -->
<div class="card">
<div class="card-body">
<table>
<tr>
<td>
<form action="" method="post">
<input type="hidden" name="1_hour" value="DATE_SUB(now(),interval 1 hour)">
<button type="submit" name="button" class="btn btn-primary">1 小时</button>
</form>
</td>
<td>
<form action="" method="post">
<input type="hidden" name="3_hour" value="DATE_SUB(now(),interval 3 hour)">
<button type="submit" name="button" class="btn btn-success">3 小时</button>
</form>
</td>
<td>
<form action="" method="post">
<input type="hidden" name="6_hour" value="DATE_SUB(now(),interval 6 hour)">
<button type="submit" name="button" class="btn btn-info">6 小时</button>
</form>
</td>
<td>
<form action="" method="post">
<input type="hidden" name="12_hour" value="DATE_SUB(now(),interval 12 hour)">
<button type="submit" name="button" class="btn btn-warning">12 小时</button>
</form>
</td>
<td>
<form action="" method="post">
<input type="hidden" name="1_day" value="DATE_SUB(now(),interval 24 hour)">
<button type="submit" name="button" class="btn btn-danger">1 天</button>
</form>
</td>
<td>
<form action="" method="post">
<input type="hidden" name="2_day" value="DATE_SUB(now(),interval 48 hour)">
<button type="submit" name="button" class="btn btn-secondary">2 天</button>
</form>
</td>
</tr>
</table>
</div>
</div>
<?php
if(!empty($_POST['1_hour'])){
$interval_time = $_POST['1_hour'];
}
if(!empty($_POST['3_hour'])){
$interval_time = $_POST['3_hour'];
}
if(!empty($_POST['6_hour'])){
$interval_time = $_POST['6_hour'];
}
if(!empty($_POST['12_hour'])){
$interval_time = $_POST['12_hour'];
}
if(!empty($_POST['1_day'])){
$interval_time = $_POST['1_day'];
}
if(!empty($_POST['2_day'])){
$interval_time = $_POST['2_day'];
}
//echo '$interval_time变量值是: ' .$interval_time .'<br>';
?>
<!-- 结束----------------------------------------->
<div id="connect" style="height:400px"></div>
<?php include 'js/show_connect.php';?>
<div id="qps" style="height:400px"></div>
<?php include 'js/show_graph_qps.php';?>
<br><br>
<div id="index" style="height:400px"></div>
<?php include 'js/show_graph_index.php';?>
<br><br>
</body>
</html>