This repository has been archived by the owner on Sep 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathhome.php
157 lines (149 loc) · 6.5 KB
/
home.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Main</title>
<!-- Bootstrap CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- bootstrap theme -->
<link href="css/bootstrap-theme.css" rel="stylesheet">
<!--external css-->
<!-- font icon -->
<link href="css/elegant-icons-style.css" rel="stylesheet" />
<link href="css/font-awesome.min.css" rel="stylesheet" />
<!-- Custom styles -->
<link href="css/style.css" rel="stylesheet">
<link href="css/style-responsive.css" rel="stylesheet" />
<link href="css/jquery-ui-1.10.4.min.css" rel="stylesheet">
<?php
if(!file_exists("config.ini"))
{
echo "<span class=\"info-center\">Config not found, redirecting to setup.</span>";
echo "<script> window.location.href=\"settings.php\";</script>";
//Exit(1);
}
if(!file_exists("bookmarks.dat")){
echo "<span class=\"error-center\">Failed to load bookmarks.dat</span>";
echo "<script> window.location.href='bookmarks.php' </script>";
}
include 'requests.php';
//$cfg is loaded from requests.php
echo '<meta http-equiv="refresh" content="' . $cfg['refresh_seconds'] . '" >';
?>
</head>
<body>
<?php
// Process requests
$client = strtolower($cfg['torrent_client']);
if( $client == "qbittorrent"){
$torrents = getRequest("/query/torrents?filter=all&sort=name");
$global_info = getRequest("/query/transferInfo");
} elseif ($client == "transmission"){
$torrents = transmissionTorrents();
$global_info = transmissionAll();
}
//Show Errors?
$show_errors = $cfg['show_errors'];
//Show Weather
if( $cfg['show_weather'] == "true"){
$weather = weather();
}
?>
<!--main content start-->
<section id="main-content">
<!--overview start-->
<section class="wrapper-frame">
<!--Dashboard and Weather Row-->
<!--Dashboard section-->
<div class="row">
<div class="col-lg-6">
<h3 class="page-header"><i class="fa fa-laptop"></i> Dashboard</h3>
</div>
<!--Weather Section-->
<div class="col-1">
<?php if($cfg['show_weather'] == "true"){ ?>
<canvas id="weather-canvas" width="64" height="64"></canvas>
<script src="js/skycons.js"></script>
<script>
var icons = new Skycons();
icons.set("weather-canvas", "<?php echo $weather[1];?>");
icons.play();
</script>
<?php } ?>
</div>
<div class="col-5">
<?php if($cfg['show_weather'] == "true"){ ?>
<h3 class="page-header"><?php echo "<b>" . round($weather[2]) . "</b>, " . $weather[0] . ", Feels like <b>" . round($weather[3]) . "</b>";?></h3>
<?php } ?>
</div>
</div>
<!--Breadcrumb Section-->
<div class="row">
<div class="col-lg-12">
<ol class="breadcrumb">
<li><i class="fa fa-home"></i><a href="home.php">Home</a></li>
<li><i class="fa fa-laptop"></i>Dashboard</li>
</ol>
</div>
</div>
<!--Downloading and Seeding Section-->
<?php
if (!$cfg['torrent_client'] == ""){
include 'torrents_info.php';
}
?>
<!--prtg section-->
<?php
if ($cfg['show_prtg'] == "true"){
include 'prtg.php';
}
?>
<!--Torrent List section-->
<?php
if (!$cfg['torrent_client'] == ""){
include 'torrents_listing.php';
}
?>
<!--Error display-->
<?php
if($show_errors && count($errors) > 0){
echo "<div class=\"row\">";
echo "<div class=\"col-lg-12 col-md-3 col-sm-12 col-xs-12\">";
echo "<div class=\"info-box red-bg\">";
echo "<h3><span style=\"color: black; font-weight: bold;\">Errors</span></h3>";
foreach($errors as $err){
echo "<span style=\"color: black; font-weight: bold;\">" . $err . "</span><br>";
}
echo "</div>";
echo "</div>";
echo "</div>";
}
?>
</section>
<!--overview end-->
</section>
<!--main content end-->
<!-- container section start -->
<!-- javascripts -->
<script src="js/jquery.js"></script>
<script src="js/jquery-ui-1.10.4.min.js"></script>
<script src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.9.2.custom.min.js"></script>
<!-- bootstrap -->
<script src="js/bootstrap.min.js"></script>
<!-- nice scroll -->
<script src="js/jquery.scrollTo.min.js"></script>
<script src="js/jquery.nicescroll.js" type="text/javascript"></script>
<!-- custom select -->
<script src="js/jquery.customSelect.min.js" ></script>
<!--custome script for all page-->
<script src="js/scripts.js"></script>
<!-- custom script for this page-->
<script src="js/jquery.autosize.min.js"></script>
<script src="js/jquery.placeholder.min.js"></script>
<script src="js/jquery.slimscroll.min.js"></script>
<!--weather scripts-->
<script src="js/skycons.js"></script>
</body>
</html>