Fix tor configuration append / graph visualization
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
<?php
|
||||
require __DIR__ . '/../lib/app.php'; auth_require();
|
||||
require __DIR__ . '/../lib/app.php';
|
||||
auth_require();
|
||||
|
||||
header('Content-Type: application/json');
|
||||
$path = "/var/lib/torpanel/stats.json";
|
||||
if (!file_exists($path)) { echo json_encode(["data"=>[]]); exit; }
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
|
||||
header('Pragma: no-cache');
|
||||
|
||||
$path = '/var/lib/torpanel/stats.json';
|
||||
if (!is_readable($path)) {
|
||||
echo json_encode(['data' => []]);
|
||||
exit;
|
||||
}
|
||||
|
||||
$raw = file_get_contents($path);
|
||||
echo $raw ?: json_encode(["data"=>[]]);
|
||||
echo $raw !== false && $raw !== '' ? $raw : json_encode(['data' => []]);
|
||||
Reference in New Issue
Block a user