Bernd Wurst commited on 2013-03-16 07:07:58
Zeige 2 geänderte Dateien mit 34 Einfügungen und 6 Löschungen.
| ... | ... |
@@ -23,6 +23,14 @@ require_once('class/domain.php');
|
| 23 | 23 |
require_once("certs.php");
|
| 24 | 24 |
|
| 25 | 25 |
|
| 26 |
+function traffic_month($vhost_id) |
|
| 27 |
+{
|
|
| 28 |
+ $vhost_id = (int) $vhost_id; |
|
| 29 |
+ $result = db_query("SELECT sum(mb_in+mb_out) as mb FROM vhosts.traffic where date > CURDATE() - INTERVAL 1 MONTH AND vhost_id = {$vhost_id}");
|
|
| 30 |
+ $data = mysql_fetch_assoc($result); |
|
| 31 |
+ return $data['mb']; |
|
| 32 |
+} |
|
| 33 |
+ |
|
| 26 | 34 |
function autoipv6_address($vhost_id, $mode = 1) |
| 27 | 35 |
{
|
| 28 | 36 |
$result = db_query("SELECT uid, v6_prefix FROM vhosts.v_vhost LEFT JOIN system.servers ON (servers.hostname = server) WHERE v_vhost.id={$vhost_id}");
|
| ... | ... |
@@ -33,6 +33,7 @@ output("<p>Mit dieser Funktion legen Sie fest, welche Domains und Subdomains als
|
| 33 | 33 |
|
| 34 | 34 |
|
| 35 | 35 |
$vhosts = list_vhosts(); |
| 36 |
+$traffic_sum = 0; |
|
| 36 | 37 |
|
| 37 | 38 |
if (count($vhosts) > 0) |
| 38 | 39 |
{
|
| ... | ... |
@@ -40,7 +41,7 @@ if (count($vhosts) > 0) |
| 40 | 41 |
addnew('edit', 'Neue Domain bzw. Subdomain einrichten');
|
| 41 | 42 |
addnew('../webapps/install', 'Neue Domain bzw. Subdomain mit vorinstallierter Web-Anwendung einrichten');
|
| 42 | 43 |
} |
| 43 |
- output("<table><tr><th>(Sub-)Domain</th><th></th><th>Zusätzliche Alias-Namen</th><th>Protokoll</th><th>SSL</th><th>PHP</th><th>Lokaler Pfad<sup>*</sup></th></tr>\n");
|
|
| 44 |
+ output("<table><tr><th>(Sub-)Domain</th><th></th><th>Zusätzliche Alias-Namen</th><th>Protokoll</th><th>SSL</th><th>Traffic<sup>*</sup></th><th>PHP</th><th>Lokaler Pfad<sup>**</sup></th></tr>\n");
|
|
| 44 | 45 |
|
| 45 | 46 |
$even = True; |
| 46 | 47 |
|
| ... | ... |
@@ -64,17 +65,17 @@ if (count($vhosts) > 0) |
| 64 | 65 |
} |
| 65 | 66 |
output(internal_link('aliases', $tmp, 'vhost='.$vhost['id'], 'title="Aliase verwalten"'));
|
| 66 | 67 |
output('</td>');
|
| 67 |
- $logfiles = 'Kein Protokoll'; |
|
| 68 |
+ $logfiles = 'Kein Log'; |
|
| 68 | 69 |
if ($vhost['logtype'] == 'default') |
| 69 | 70 |
$logfiles = 'Zugriffe '; |
| 70 | 71 |
elseif ($vhost['logtype'] == 'anonymous') |
| 71 |
- $logfiles = 'Zugriffe anonym'; |
|
| 72 |
+ $logfiles = 'Anonym'; |
|
| 72 | 73 |
if ($vhost['errorlog'] == 1) |
| 73 | 74 |
{
|
| 74 | 75 |
if ($vhost['logtype'] == NULL) |
| 75 |
- $logfiles = 'Nur Fehler'; |
|
| 76 |
+ $logfiles = 'Fehler'; |
|
| 76 | 77 |
else |
| 77 |
- $logfiles .= ' und Fehler'; |
|
| 78 |
+ $logfiles .= ' + Fehler'; |
|
| 78 | 79 |
} |
| 79 | 80 |
$stats = $vhost['stats'] ? internal_link("showstats", other_icon("chart_bar.png", "Statistiken anzeigen"), "vhost={$vhost['id']}").' ' : '';
|
| 80 | 81 |
output("<td>{$stats}{$logfiles}</td>");
|
| ... | ... |
@@ -92,6 +93,17 @@ if (count($vhosts) > 0) |
| 92 | 93 |
output("<td>".icon_enabled('SSL eingeschaltet')."</td>");
|
| 93 | 94 |
} |
| 94 | 95 |
|
| 96 |
+ $traffic = traffic_month($vhost['id']); |
|
| 97 |
+ $traffic_sum += (int) $traffic; |
|
| 98 |
+ $traffic_string = $traffic.' MB'; |
|
| 99 |
+ if ($traffic > 1024) {
|
|
| 100 |
+ $traffic_string = round($traffic / 1024, 2).' GB'; |
|
| 101 |
+ } |
|
| 102 |
+ if ($traffic === NULL) {
|
|
| 103 |
+ $traffic_string = '--'; |
|
| 104 |
+ } |
|
| 105 |
+ output("<td style=\"text-align: right;\">{$traffic_string}</td>");
|
|
| 106 |
+ |
|
| 95 | 107 |
if ($vhost['is_webapp'] == 1) {
|
| 96 | 108 |
output('<td colspan="2"><em><strong>Sonderanwendung:</strong> Vorinstallierte Webanwendung</em></td>');
|
| 97 | 109 |
} |
| ... | ... |
@@ -130,7 +142,15 @@ if (count($vhosts) > 0) |
| 130 | 142 |
output("</tr>\n");
|
| 131 | 143 |
} |
| 132 | 144 |
output('</table>');
|
| 133 |
- output('<p style="font-size: 90%;"><sup>*</sup>) schwach geschriebene Pfadangaben bezeichnen die Standardeinstellung. Ist ein Pfad fett dargestellt, so haben Sie einen davon abweichenden Wert eingegeben.</p>');
|
|
| 145 |
+ if ($traffic_sum > 0) {
|
|
| 146 |
+ $traffic_string = $traffic_sum.' MB'; |
|
| 147 |
+ if ($traffic_sum > 1024) {
|
|
| 148 |
+ $traffic_string = round($traffic_sum / 1024, 2).' GB'; |
|
| 149 |
+ } |
|
| 150 |
+ output('<p><strong>Traffic insgesamt: '.$traffic_string.'</strong> in den lezten 30 Tagen</p>');
|
|
| 151 |
+ } |
|
| 152 |
+ output('<p style="font-size: 90%;"><sup>*</sup>) Dieser Wert stellt den Datenverkehr dieser Website für die letzten 30 Tage dar.</p>');
|
|
| 153 |
+ output('<p style="font-size: 90%;"><sup>**</sup>) schwach geschriebene Pfadangaben bezeichnen die Standardeinstellung. Ist ein Pfad fett dargestellt, so haben Sie einen davon abweichenden Wert eingegeben.</p>');
|
|
| 134 | 154 |
} |
| 135 | 155 |
else // keine VHosts vorhanden |
| 136 | 156 |
{
|
| 137 | 157 |