Compare commits

..

No commits in common. "4411a9e96ebb1cf0656ee498aeefd6c75adce277" and "83a0b4f5ba2420ba846d607b205f07bce0b19c05" have entirely different histories.

5 changed files with 8 additions and 85 deletions

View File

@ -346,25 +346,4 @@ footer {
@keyframes spin {
to { transform: rotate(360deg); }
}
.card-body.collapsable {
display: none;
transition: max-height 0.3s ease;
overflow: hidden;
}
.card-body.collapsable.show {
display: block;
max-height: 1000px;
}
.toggle-icon {
font-size: 1.25rem;
user-select: none;
}
.toggle-icon:hover {
color: #007bff;
}

View File

@ -498,56 +498,4 @@ function syncThemeColor() {
.forEach(svg => svg.setAttribute('fill', cssVar));
}
document.addEventListener('DOMContentLoaded', syncThemeColor);
// toggle card visibility
document.addEventListener('DOMContentLoaded', function() {
// 1. Select all plus/minus icons
var icons = document.querySelectorAll('.card .toggle-icon');
icons.forEach(function(icon) {
// 2. For each icon, find its corresponding collapsable body
var card = icon.closest('.card');
if (!card) return;
var body = card.querySelector('.card-body.collapsable');
if (!body) return;
// 3. Initialize ariaexpanded & icon text based on whether .show is present
if (body.classList.contains('show')) {
icon.textContent = '';
icon.setAttribute('aria-expanded', 'true');
} else {
icon.textContent = '+';
icon.setAttribute('aria-expanded', 'false');
}
function toggleSection() {
// Toggle the 'show' class
if (body.classList.contains('show')) {
body.classList.remove('show');
icon.textContent = '+';
icon.setAttribute('aria-expanded', 'false');
} else {
body.classList.add('show');
icon.textContent = '';
icon.setAttribute('aria-expanded', 'true');
}
}
// 4. Click listener
icon.addEventListener('click', function(e) {
e.stopPropagation();
toggleSection();
});
// 5. Keydown listener (Enter/Space for accessibility)
icon.addEventListener('keydown', function(e) {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
toggleSection();
}
});
});
});
document.addEventListener('DOMContentLoaded', syncThemeColor);

View File

@ -26,7 +26,7 @@
{% block content %}
<div class="container-fluid">
<h2>Verbindungen der letzten 10 Minuten</h2>
<h2>Übersicht deiner gültigen Links</h2>
<span class="ms-3">
Anzahl Verbindungen: <strong id="totalConnections">0</strong>
</span>

View File

@ -62,11 +62,10 @@
<!-- Detailed Table of Top File Accesses -->
{% for top20_item in top20 %}
<div class="card mb-4">
<div class="card-header d-flex justify-content-between align-items-center">
<span>Top 20 Dateizugriffe ({{ top20_item['category'] }})</span>
<span class="toggle-icon" aria-label="collapse" role="button" tabindex="0">+</span>
<div class="card-header">
Top 20 Dateizugriffe ({{ top20_item['category'] }})
</div>
<div class="card-body collapsable">
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped">
<thead>
@ -96,5 +95,5 @@
{% endblock %}
{% block scripts %}
{% endblock %}

View File

@ -1,7 +1,6 @@
import os
import sys
import time
import torch
import whisper
import concurrent.futures
import json
@ -19,6 +18,7 @@ with open("transcription_config.yml", "r", encoding="utf-8") as file:
settings = yaml.safe_load(file)
folder_list = settings.get("folder_list")
model_name = settings.get("model_name")
device = settings.get("device")
def load_audio_librosa(path: str, sr: int = 16_000) -> np.ndarray:
audio, orig_sr = librosa.load(path, sr=sr) # load + resample to 16 kHz
@ -222,10 +222,7 @@ def process_folder(root_folder):
else:
print(f"Checked {checked_files} files. Start to transcribe {len(valid_files)} files.")
# Choose “cuda” if available, otherwise “cpu”
device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"Loading Whisper model on {device}")
print("Loading Whisper model...")
model = whisper.load_model(model_name, device=device)
# Use a thread pool to pre-load files concurrently.