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' => []]);
|
||||
@@ -125,7 +125,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
<input class="form-control" id="orport" name="orport" type="number" min="1" max="65535" placeholder="9001"
|
||||
value="<?= htmlspecialchars($_POST['orport'] ?? '9001') ?>">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-3">
|
||||
<label class="form-label" for="rate_mbps">Bandwidth</label>
|
||||
<div class="input-group">
|
||||
<input class="form-control" id="rate_mbps" name="rate_mbps" type="number" min="1" step="1" placeholder="5"
|
||||
|
||||
Reference in New Issue
Block a user