rename files
This commit is contained in:
parent
99b0b8b7db
commit
3c8bfbc009
@ -87,8 +87,8 @@ def return_file_access():
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
@require_secret
|
@require_secret
|
||||||
def network():
|
def connections():
|
||||||
return render_template('network.html')
|
return render_template('connections.html')
|
||||||
|
|
||||||
@require_secret
|
@require_secret
|
||||||
def dashboard():
|
def dashboard():
|
||||||
|
|||||||
6
app.py
6
app.py
@ -32,8 +32,9 @@ if os.environ.get('FLASK_ENV') == 'production':
|
|||||||
app.config['SESSION_COOKIE_SECURE'] = True
|
app.config['SESSION_COOKIE_SECURE'] = True
|
||||||
|
|
||||||
app.add_url_rule('/dashboard', view_func=a.dashboard)
|
app.add_url_rule('/dashboard', view_func=a.dashboard)
|
||||||
app.add_url_rule('/network', view_func=a.network)
|
app.add_url_rule('/connections', view_func=a.connections)
|
||||||
app.add_url_rule('/overview', view_func=auth.overview)
|
app.add_url_rule('/mylinks', view_func=auth.mylinks)
|
||||||
|
app.add_url_rule('/remove_secret', view_func=auth.remove_secret, methods=['POST'])
|
||||||
|
|
||||||
socketio = SocketIO(app, async_mode='eventlet')
|
socketio = SocketIO(app, async_mode='eventlet')
|
||||||
background_thread_running = False
|
background_thread_running = False
|
||||||
@ -332,7 +333,6 @@ def query_recent_connections():
|
|||||||
connections = [
|
connections = [
|
||||||
{
|
{
|
||||||
'timestamp': row[0],
|
'timestamp': row[0],
|
||||||
'full_path': row[1],
|
|
||||||
'ip_address': row[2],
|
'ip_address': row[2],
|
||||||
'user_agent': row[3],
|
'user_agent': row[3],
|
||||||
'referrer': row[4]
|
'referrer': row[4]
|
||||||
|
|||||||
4
auth.py
4
auth.py
@ -80,7 +80,7 @@ def require_secret(f):
|
|||||||
|
|
||||||
|
|
||||||
@require_secret
|
@require_secret
|
||||||
def overview():
|
def mylinks():
|
||||||
allowed_secrets = session.get('allowed_secrets', [])
|
allowed_secrets = session.get('allowed_secrets', [])
|
||||||
host = request.host
|
host = request.host
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ def overview():
|
|||||||
else:
|
else:
|
||||||
secret_folders[secret] = []
|
secret_folders[secret] = []
|
||||||
|
|
||||||
return render_template('overview.html',
|
return render_template('mylinks.html',
|
||||||
allowed_secrets=allowed_secrets,
|
allowed_secrets=allowed_secrets,
|
||||||
secret_qr_codes=secret_qr_codes,
|
secret_qr_codes=secret_qr_codes,
|
||||||
secret_folders=secret_folders)
|
secret_folders=secret_folders)
|
||||||
@ -26,19 +26,18 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="p-3">
|
<h1 class="mb-4">Downloads in den letzten 10 Minute</h1>
|
||||||
<h1 class="mb-4">Downloads in den letzten 10 Minute</h1>
|
<div class="mb-3">
|
||||||
<div class="mb-3">
|
<a href="{{ url_for('index') }}" class="btn btn-primary">App</a>
|
||||||
<a href="{{ url_for('index') }}" class="btn btn-primary">Home</a>
|
<a href="{{ url_for('mylinks') }}" class="btn btn-primary">Meine Links</a>
|
||||||
<a href="{{ url_for('dashboard') }}" class="btn btn-primary">Dashboard</a>
|
<a href="{{ url_for('connections') }}" class="btn btn-primary">Verbindungen</a>
|
||||||
</div>
|
<a href="{{ url_for('dashboard') }}" class="btn btn-primary">Auswertung</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-responsive table-container">
|
<div class="table-responsive table-container">
|
||||||
<table class="table table-hover">
|
<table class="table table-hover">
|
||||||
<thead class="table-info">
|
<thead class="table-info">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Timestamp</th>
|
<th>Timestamp</th>
|
||||||
<th>Full Path</th>
|
|
||||||
<th>IP Address</th>
|
<th>IP Address</th>
|
||||||
<th>User Agent</th>
|
<th>User Agent</th>
|
||||||
<th>Referrer</th>
|
<th>Referrer</th>
|
||||||
@ -69,7 +68,6 @@
|
|||||||
const row = document.createElement('tr');
|
const row = document.createElement('tr');
|
||||||
row.innerHTML = `
|
row.innerHTML = `
|
||||||
<td>${record.timestamp}</td>
|
<td>${record.timestamp}</td>
|
||||||
<td>${record.full_path}</td>
|
|
||||||
<td>${record.ip_address}</td>
|
<td>${record.ip_address}</td>
|
||||||
<td>${record.user_agent}</td>
|
<td>${record.user_agent}</td>
|
||||||
<td>${record.referrer}</td>
|
<td>${record.referrer}</td>
|
||||||
@ -6,21 +6,34 @@
|
|||||||
<title>Dashboard - Verbindungsanalyse</title>
|
<title>Dashboard - Verbindungsanalyse</title>
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
body { margin: 20px; }
|
html, body {
|
||||||
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
/* Use full width */
|
||||||
|
.container-fluid {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
.card { margin-bottom: 20px; }
|
.card { margin-bottom: 20px; }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container-fluid">
|
||||||
<h1 class="mb-4">Dashboard - Verbindungsanalyse({{ timeframe }})</h1>
|
<h1 class="mb-4">Dashboard - Verbindungsanalyse ({{ timeframe }})</h1>
|
||||||
<!-- Timeframe selection buttons -->
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<a href="{{ url_for('index') }}" class="btn btn-primary">Home</a>
|
<a href="{{ url_for('index') }}" class="btn btn-primary">App</a>
|
||||||
<a href="{{ url_for('network') }}" class="btn btn-primary">Netzwerk</a>
|
<a href="{{ url_for('mylinks') }}" class="btn btn-primary">Meine Links</a>
|
||||||
<a href="{{ url_for('dashboard', timeframe='today') }}" class="btn btn-primary">Today</a>
|
<a href="{{ url_for('connections') }}" class="btn btn-primary">Verbindungen</a>
|
||||||
<a href="{{ url_for('dashboard', timeframe='7days') }}" class="btn btn-primary">Last 7 Days</a>
|
<a href="{{ url_for('dashboard') }}" class="btn btn-primary">Auswertung</a>
|
||||||
<a href="{{ url_for('dashboard', timeframe='30days') }}" class="btn btn-primary">Last 30 Days</a>
|
</div>
|
||||||
<a href="{{ url_for('dashboard', timeframe='365days') }}" class="btn btn-primary">Last 365 Days</a>
|
<div class="mb-3">
|
||||||
|
<a href="{{ url_for('dashboard', timeframe='today') }}" class="btn btn-secondary btn-sm">Today</a>
|
||||||
|
<a href="{{ url_for('dashboard', timeframe='7days') }}" class="btn btn-secondary btn-sm">Last 7 Days</a>
|
||||||
|
<a href="{{ url_for('dashboard', timeframe='30days') }}" class="btn btn-secondary btn-sm">Last 30 Days</a>
|
||||||
|
<a href="{{ url_for('dashboard', timeframe='365days') }}" class="btn btn-secondary btn-sm">Last 365 Days</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Summary Cards -->
|
<!-- Summary Cards -->
|
||||||
|
|||||||
@ -13,27 +13,6 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='app.css') }}">
|
<link rel="stylesheet" href="{{ url_for('static', filename='app.css') }}">
|
||||||
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
||||||
<style>
|
|
||||||
/* Header styles */
|
|
||||||
.site-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 10px 20px;
|
|
||||||
background-color: #9bbbff; /* Using the theme color */
|
|
||||||
color: #000000;
|
|
||||||
}
|
|
||||||
.site-header img.logo {
|
|
||||||
height: 50px;
|
|
||||||
margin-right: 15px;
|
|
||||||
}
|
|
||||||
.site-header h1 {
|
|
||||||
font-size: 1.5em;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
.container {
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header class="site-header">
|
<header class="site-header">
|
||||||
|
|||||||
@ -13,26 +13,6 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='app.css') }}">
|
<link rel="stylesheet" href="{{ url_for('static', filename='app.css') }}">
|
||||||
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
||||||
<style>
|
|
||||||
.site-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 10px 20px;
|
|
||||||
background-color: #9bbbff;
|
|
||||||
color: #000000;
|
|
||||||
}
|
|
||||||
.site-header img.logo {
|
|
||||||
height: 50px;
|
|
||||||
margin-right: 15px;
|
|
||||||
}
|
|
||||||
.site-header h1 {
|
|
||||||
font-size: 1.5em;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
.container {
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header class="site-header">
|
<header class="site-header">
|
||||||
|
|||||||
@ -2,11 +2,21 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Übersicht gültiger Verbindungen</title>
|
<title>Meine Links</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<!-- Bootstrap 5 CSS -->
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
|
html, body {
|
||||||
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
/* Use full width */
|
||||||
|
.container-fluid {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
.qr-code {
|
.qr-code {
|
||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
display: block;
|
display: block;
|
||||||
@ -15,8 +25,14 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container my-5">
|
<div class="container-fluid">
|
||||||
<h1 class="mb-4">Übersicht deiner gültigen Verbindungen</h1>
|
<h1 class="mb-4">Übersicht deiner gültigen Links</h1>
|
||||||
|
<div class="mb-3">
|
||||||
|
<a href="{{ url_for('index') }}" class="btn btn-primary">App</a>
|
||||||
|
<a href="{{ url_for('mylinks') }}" class="btn btn-primary">Meine Links</a>
|
||||||
|
<a href="{{ url_for('connections') }}" class="btn btn-primary">Verbindungen</a>
|
||||||
|
<a href="{{ url_for('dashboard') }}" class="btn btn-primary">Auswertung</a>
|
||||||
|
</div>
|
||||||
{% if allowed_secrets %}
|
{% if allowed_secrets %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% for secret in allowed_secrets %}
|
{% for secret in allowed_secrets %}
|
||||||
@ -40,7 +56,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p class="text-muted">No folders available for this secret.</p>
|
<p class="text-muted">Keine Ordner für dieses Gemeimnis hinterlegt.</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -49,12 +65,10 @@
|
|||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="alert alert-warning" role="alert">
|
<div class="alert alert-warning" role="alert">
|
||||||
No valid secrets found.
|
Du hast aktuell keine gültigen Links.
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Bootstrap 5 JS Bundle -->
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
x
Reference in New Issue
Block a user