-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstatus_monitor.php
98 lines (98 loc) · 4.49 KB
/
status_monitor.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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- META -->
<meta http-equiv="Cache-Control" content="No-Cache"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- Style -->
<style>
/* 20230729 */
@media all{
html{font-size:100%;font-family:sans-serif;color:#666666;font-weight:400;}
body{margin-top:9%;}
a{font-size:0.917rem;text-decoration:none;color:#00A896;}
.banner{margin-top:1.5rem;margin-bottom:1rem;margin:0px auto;text-align:center;font-size:1rem;color:#05668D;font-weight:500;padding:0.5rem;}
/* If load fail */
.fail{margin:0px auto;text-align:center;font-size:1rem;color:#02C39A;font-weight:500;padding:0.5rem;}
/* Show source code */
.footer{margin-top:10rem;margin:0px auto;text-align:center;font-size:0.8rem;font-weight:500;padding:0.917rem}
/* Table */
table{margin:0px auto;border:0.063rem solid #FFFFFF;width:80%;border-collapse:collapse;}
/* Table*/
tr{background:#FFFFFF;height:1.563rem;border-left:none;padding:0.188rem 0.125rem;}
/*Header*/
tr:nth-child(1){background:#028090;color:#FFFFFF;border-left:none;padding:0.188rem 0.125rem;}
/*Column*/
td{padding:0.5rem;}
td:nth-child(2){text-align:center;font-weight:500;}
td:nth-child(4){text-align:center;min-width:5rem;}
td:nth-child(5){text-align:center;min-width:2rem;}
td:nth-child(6){text-align:center;min-width:3rem;}
td:nth-child(7){text-align:center;min-width:2rem;}
td:nth-child(8){text-align:center;min-width:2rem;}
}
/* RWD in mobile device */
@media print,screen and (max-width: 960px){
body{font-size:1rem;line-height:1.2rem;font-weight:450;}
.banner{display:none;}
.footer{margin-top:5rem;margin:0px auto;text-align:center;font-size:0.6rem;font-weight:500;padding:0.5rem}
table{margin:0px auto;border:0.063rem solid #FFFFFF;width:95%;border-collapse:collapse;}
td:nth-child(4){display:none;}
td:nth-child(5){display:none;}
td:nth-child(6){display:none;}
td:nth-child(7){display:none;}
td:nth-child(8){display:none;}
}
</style>
<!-- Title -->
<title>Hentai@Home Client Status</title>
</head>
<!-- Body -->
<body>
<!-- Load CSV file -->
<div class="banner">Hentai@Home Status</div>
<table class="ehentai">
<!-- php block -->
<?php
header("refresh:600");
// File path as you python script location
if ($file = fopen("/script_location/status4hah.check.csv","r")){
while (($line = fgetcsv($file)) !== false){
echo "<tr>";
foreach ($line as $cell) {echo "<td>" . htmlspecialchars($cell) . "</td>";}
echo "</tr>\n";}
fclose($file);
}else{
// If unable open file
echo '<div class="fail">';
echo "Unable to open monitoring file.";
echo "</div>";}
?>
<!-- php block -->
</table>
<br>
<div class="banner">Monitor Status</div>
<table class="program">
<!-- php block -->
<?php
header("refresh:600");
// File path as you python script location
if ($file = fopen("/script_location/status4hah.status.csv","r")){
while (($line = fgetcsv($file)) !== false){
echo "<tr>";
foreach ($line as $cell) {echo "<td>" . htmlspecialchars($cell) . "</td>";}
echo "</tr>\n";}
fclose($file);
}else{
// If unable open file
echo '<div class="fail">';
echo "Unable to open monitoring file.";
echo "</div>";}
?>
<!-- php block -->
</table>
<div class="footer">
<a href="https://github.com/Suzhou65/Status4HaH">Check source code in GitHub</a>
</div>
</body>
</html>