feat: show node connection status and traffic stats in admin panel
Enable sing-box Clash/V2Ray APIs for per-user metrics, persist cumulative traffic in SQLite, and refresh the dashboard every five seconds. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -61,6 +61,16 @@ fi
|
||||
: "${REALITY_SHORT_ID:?}"
|
||||
: "${PANEL_PASSWORD:?}"
|
||||
|
||||
if [[ -z "${CLASH_API_SECRET:-}" ]]; then
|
||||
CLASH_API_SECRET="$(openssl rand -hex 16)"
|
||||
if grep -q "^CLASH_API_SECRET=" "$ENV_FILE" 2>/dev/null; then
|
||||
sed -i "s|^CLASH_API_SECRET=.*|CLASH_API_SECRET=${CLASH_API_SECRET}|" "$ENV_FILE"
|
||||
else
|
||||
echo "CLASH_API_SECRET=${CLASH_API_SECRET}" >> "$ENV_FILE"
|
||||
fi
|
||||
source "$ENV_FILE"
|
||||
fi
|
||||
|
||||
normalize_panel_path() {
|
||||
local p="${1:-}"
|
||||
p="${p#/}"
|
||||
|
||||
Reference in New Issue
Block a user