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