fir into gui structure
This commit is contained in:
parent
9f3e5bea93
commit
2e8f586f5b
28
analytics.py
28
analytics.py
@ -10,6 +10,8 @@ import auth
|
||||
|
||||
file_access_temp = []
|
||||
|
||||
app_config = auth.return_app_config()
|
||||
|
||||
# Example database name; you can change to whatever you want:
|
||||
DB_NAME = 'access_log.db'
|
||||
|
||||
@ -190,11 +192,26 @@ def songs_dashboard():
|
||||
performance_data = [(count, titel) for titel, count in performance_counts.items()]
|
||||
performance_data.sort(reverse=True, key=lambda x: x[0])
|
||||
|
||||
return render_template('songs_dashboard.html', timeframe=timeframe_param, performance_data=performance_data, site=site, category=category, admin_enabled=auth.is_admin())
|
||||
title_short = app_config.get('TITLE_SHORT', 'Default Title')
|
||||
title_long = app_config.get('TITLE_LONG' , 'Default Title')
|
||||
|
||||
return render_template('songs_dashboard.html',
|
||||
timeframe=timeframe_param,
|
||||
performance_data=performance_data,
|
||||
site=site,
|
||||
category=category,
|
||||
admin_enabled=auth.is_admin(),
|
||||
title_short=title_short,
|
||||
title_long=title_long)
|
||||
|
||||
@require_secret
|
||||
def connections():
|
||||
return render_template('connections.html', admin_enabled=auth.is_admin())
|
||||
title_short = app_config.get('TITLE_SHORT', 'Default Title')
|
||||
title_long = app_config.get('TITLE_LONG' , 'Default Title')
|
||||
return render_template('connections.html',
|
||||
admin_enabled=auth.is_admin(),
|
||||
title_short=title_short,
|
||||
title_long=title_long)
|
||||
|
||||
@require_secret
|
||||
def dashboard():
|
||||
@ -465,6 +482,9 @@ def dashboard():
|
||||
# Convert the top-files rows to a list of dictionaries
|
||||
rows = [dict(rel_path=r[0], access_count=r[1]) for r in rows]
|
||||
|
||||
title_short = app_config.get('TITLE_SHORT', 'Default Title')
|
||||
title_long = app_config.get('TITLE_LONG' , 'Default Title')
|
||||
|
||||
return render_template(
|
||||
"dashboard.html",
|
||||
timeframe=session['timeframe'],
|
||||
@ -478,7 +498,9 @@ def dashboard():
|
||||
unique_user=unique_user,
|
||||
cached_percentage=cached_percentage,
|
||||
timeframe_data=timeframe_data,
|
||||
admin_enabled=auth.is_admin()
|
||||
admin_enabled=auth.is_admin(),
|
||||
title_short=title_short,
|
||||
title_long=title_long
|
||||
)
|
||||
|
||||
def export_to_excel():
|
||||
|
||||
8
auth.py
8
auth.py
@ -235,6 +235,9 @@ def mylinks():
|
||||
token_url[token] = url
|
||||
token_valid_to[token] = token_item.get('validity', 'Unbekannt')
|
||||
|
||||
title_short = app_config.get('TITLE_SHORT', 'Default Title')
|
||||
title_long = app_config.get('TITLE_LONG' , 'Default Title')
|
||||
|
||||
return render_template('mylinks.html',
|
||||
valid_secrets=valid_secrets,
|
||||
secret_qr_codes=secret_qr_codes,
|
||||
@ -247,7 +250,10 @@ def mylinks():
|
||||
token_folders=token_folders,
|
||||
token_url=token_url,
|
||||
token_valid_to=token_valid_to,
|
||||
admin_enabled=is_admin()
|
||||
admin_enabled=is_admin(),
|
||||
|
||||
title_short=title_short,
|
||||
title_long=title_long
|
||||
)
|
||||
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ import secrets
|
||||
import string
|
||||
import auth
|
||||
|
||||
app_config = auth.return_app_config()
|
||||
|
||||
# Secret alphabet
|
||||
ALPHABET = string.ascii_letters + string.digits
|
||||
@ -13,7 +14,13 @@ ALPHABET = string.ascii_letters + string.digits
|
||||
|
||||
@auth.require_admin
|
||||
def folder_secret_config_editor():
|
||||
return render_template('folder_secret_config_editor.html', alphabet=ALPHABET, admin_enabled=auth.is_admin())
|
||||
title_short = app_config.get('TITLE_SHORT', 'Default Title')
|
||||
title_long = app_config.get('TITLE_LONG' , 'Default Title')
|
||||
return render_template('folder_secret_config_editor.html',
|
||||
alphabet=ALPHABET,
|
||||
admin_enabled=auth.is_admin(),
|
||||
title_short=title_short,
|
||||
title_long=title_long)
|
||||
|
||||
@auth.require_admin
|
||||
def folder_secret_config_action():
|
||||
|
||||
@ -4,6 +4,7 @@ html, body {
|
||||
color: var(--main-text-color);
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
/* padding: 0; */
|
||||
}
|
||||
|
||||
/* Global Styles */
|
||||
@ -23,6 +24,7 @@ body {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10px 20px;
|
||||
/* width: 100%; */
|
||||
}
|
||||
.site-header img.logo {
|
||||
height: 50px;
|
||||
@ -51,6 +53,12 @@ body {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.container-fluid {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* Breadcrumb Styles */
|
||||
.breadcrumb {
|
||||
margin-bottom: 15px;
|
||||
@ -294,3 +302,17 @@ footer {
|
||||
.image-item.loaded .thumbnail {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.qr-code {
|
||||
max-width: 300px;
|
||||
display: block;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.card {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.locked { background-color:#eee; }
|
||||
|
||||
.unlocked { background-color: #fff3cd; }
|
||||
@ -7,52 +7,39 @@
|
||||
<title>{% block title %}Meine Links{% endblock %}</title>
|
||||
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
|
||||
<style>
|
||||
/* common styles */
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.container-fluid {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.qr-code {
|
||||
max-width: 300px;
|
||||
display: block;
|
||||
margin: auto;
|
||||
}
|
||||
.card {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
.locked { background-color:#eee; }
|
||||
.unlocked { background-color: #fff3cd; }
|
||||
</style>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='theme.css') }}">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='app.css') }}">
|
||||
|
||||
{% block head_extra %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="site-header">
|
||||
<a href="/">
|
||||
<img src="/custom_logo/logoW.png" alt="Logo" class="logo">
|
||||
</a>
|
||||
<h1>{{ title_long }}</h1>
|
||||
</header>
|
||||
<div class="wrapper">
|
||||
<!-- Navigation Bar -->
|
||||
<div style="background-color: #979797; padding: 5px; display: flex; gap: 5px; flex-wrap: wrap;">
|
||||
<a href="{{ url_for('index') }}" class="btn btn-secondary btn-sm">App</a>
|
||||
<a href="{{ url_for('mylinks') }}" class="btn btn-secondary btn-sm">Meine Links</a>
|
||||
<a href="{{ url_for('connections') }}" class="btn btn-secondary btn-sm">Verbindungen</a>
|
||||
<a href="{{ url_for('dashboard') }}" class="btn btn-secondary btn-sm">Auswertung-Downloads</a>
|
||||
<a href="{{ url_for('songs_dashboard') }}" class="btn btn-secondary btn-sm">Auswertung-Wiederholungen</a>
|
||||
<div style="margin-bottom: 10px; background-color: #979797; padding: 5px; display: flex; gap: 5px; flex-wrap: wrap;">
|
||||
<span> </span>
|
||||
<a href="{{ url_for('index') }}" class="btn btn-sm">App</a>
|
||||
<span class="btn btn-sm">|</span>
|
||||
<a href="{{ url_for('mylinks') }}" class="btn btn-sm">Meine Links</a>
|
||||
<span class="btn btn-sm">|</span>
|
||||
<a href="{{ url_for('connections') }}" class="btn btn-sm">Verbindungen</a>
|
||||
<span class="btn btn-sm">|</span>
|
||||
<a href="{{ url_for('dashboard') }}" class="btn btn-sm">Auswertung-Downloads</a>
|
||||
<span class="btn btn-sm">|</span>
|
||||
<a href="{{ url_for('songs_dashboard') }}" class="btn btn-sm">Auswertung-Wiederholungen</a>
|
||||
{% if admin_enabled %}
|
||||
<a href="{{ url_for('folder_secret_config_editor') }}" class="btn btn-secondary btn-sm" id="edit-folder-config">Ordnerkonfiguration</a>
|
||||
<span class="btn btn-sm">|</span>
|
||||
<a href="{{ url_for('folder_secret_config_editor') }}" class="btn btn-sm" id="edit-folder-config">Ordnerkonfiguration</a>
|
||||
{% endif %}
|
||||
{% block nav_extra %}{% endblock %}
|
||||
</div>
|
||||
<div class="container">
|
||||
<h2>{% block nav_brand %}Übersicht deiner gültigen Links{% endblock %}</h2>
|
||||
</div>
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
|
||||
{% block scripts %}{% endblock %}
|
||||
|
||||
|
||||
@ -3,14 +3,6 @@
|
||||
|
||||
{% block title %}Recent Connections{% endblock %}
|
||||
|
||||
{% block nav_brand %}Downloads der letzten 10 Minuten{% endblock %}
|
||||
|
||||
{% block nav_extra %}
|
||||
<span class="ms-3">
|
||||
Anzahl Verbindungen: <strong id="totalConnections">0</strong>
|
||||
</span>
|
||||
{% endblock %}
|
||||
|
||||
{% block head_extra %}
|
||||
<style>
|
||||
/* page-specific styles */
|
||||
@ -34,6 +26,10 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="container-fluid">
|
||||
<h2>Übersicht deiner gültigen Links</h2>
|
||||
<span class="ms-3">
|
||||
Anzahl Verbindungen: <strong id="totalConnections">0</strong>
|
||||
</span>
|
||||
<div class="table-responsive table-container">
|
||||
<table class="table table-hover">
|
||||
<thead class="table-secondary">
|
||||
|
||||
@ -4,14 +4,12 @@
|
||||
{# page title #}
|
||||
{% block title %}Dashboard{% endblock %}
|
||||
|
||||
{# override navbar text: #}
|
||||
{% block nav_brand %}Auswertung-Downloads{% endblock %}
|
||||
|
||||
{# page content #}
|
||||
{% block content %}
|
||||
|
||||
<!-- Main Container -->
|
||||
<div class="container-fluid px-4">
|
||||
<h2>Auswertung-Downloads</h2>
|
||||
<!-- Dropdown Controls -->
|
||||
<div class="mb-4 d-flex flex-wrap gap-2">
|
||||
<!-- Timeframe Dropdown -->
|
||||
|
||||
@ -4,12 +4,10 @@
|
||||
{# page title #}
|
||||
{% block title %}Ordnerkonfiguration{% endblock %}
|
||||
|
||||
{# override navbar text: #}
|
||||
{% block nav_brand %}Ordnerkonfiguration{% endblock %}
|
||||
|
||||
{# page content #}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h2>Ordnerkonfiguration</h2>
|
||||
<div id="records"></div>
|
||||
<button id="add-btn" class="btn btn-primary mt-3">Add New Record</button>
|
||||
</div>
|
||||
|
||||
@ -4,16 +4,10 @@
|
||||
{# page title #}
|
||||
{% block title %}Meine Links{% endblock %}
|
||||
|
||||
{# override navbar text: #}
|
||||
{#
|
||||
{% block nav_brand %}
|
||||
Übersicht deiner gültigen Links
|
||||
{% endblock %}
|
||||
#}
|
||||
|
||||
{# page‐specific content #}
|
||||
{% block content %}
|
||||
<div class="container-fluid">
|
||||
<h2>Übersicht deiner gültigen Links</h2>
|
||||
<div class="row">
|
||||
{% if valid_secrets %}
|
||||
{% for secret in valid_secrets %}
|
||||
|
||||
@ -35,12 +35,6 @@
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
||||
<style>
|
||||
.site-header {
|
||||
width: 100%;
|
||||
}
|
||||
.card {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.btn {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
@ -2,16 +2,14 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{# page title #}
|
||||
{% block title %}Edit Folder Config{% endblock %}
|
||||
|
||||
{# override navbar text: #}
|
||||
{% block nav_brand %}Dashboard - Analyse Wiederholungen{% endblock %}
|
||||
{% block title %}Analyse Wiederholungen{% endblock %}
|
||||
|
||||
{# page content #}
|
||||
{% block content %}
|
||||
|
||||
<!-- Main Container -->
|
||||
<div class="container-fluid px-4">
|
||||
<h2>Analyse Wiederholungen</h2>
|
||||
<!-- Dropdown Controls -->
|
||||
<div class="mb-4 d-flex flex-wrap gap-2">
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user