Replace emoji icons with local SVG files for consistent rendering
- Created 10 SVG icon files in app/static/icons/ (Feather Icons style) - Updated base.html with SVG icons in navigation and dark mode toggle - Updated dashboard.html with icons in stats cards and quick actions - Updated content_list_new.html (playlist management) with SVG icons - Updated upload_media.html with upload-related icons - Updated manage_player.html with player management icons - Icons use currentColor for automatic theme adaptation - Removed emoji dependency for better Raspberry Pi compatibility - Added ICON_INTEGRATION.md documentation
This commit is contained in:
@@ -5,8 +5,10 @@ from flask import Blueprint, render_template, redirect, url_for
|
||||
from flask_login import login_required, current_user
|
||||
from app.extensions import db, cache
|
||||
from app.models.player import Player
|
||||
from app.models.group import Group
|
||||
from app.models.playlist import Playlist
|
||||
from app.models.content import Content
|
||||
from app.utils.logger import get_recent_logs
|
||||
import os
|
||||
|
||||
main_bp = Blueprint('main', __name__)
|
||||
|
||||
@@ -16,15 +18,30 @@ main_bp = Blueprint('main', __name__)
|
||||
@cache.cached(timeout=60, unless=lambda: current_user.role != 'viewer')
|
||||
def dashboard():
|
||||
"""Main dashboard page"""
|
||||
players = Player.query.all()
|
||||
groups = Group.query.all()
|
||||
# Get statistics
|
||||
total_players = Player.query.count()
|
||||
total_playlists = Playlist.query.count()
|
||||
total_content = Content.query.count()
|
||||
|
||||
# Calculate storage usage
|
||||
upload_folder = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'static', 'uploads')
|
||||
storage_mb = 0
|
||||
if os.path.exists(upload_folder):
|
||||
for filename in os.listdir(upload_folder):
|
||||
filepath = os.path.join(upload_folder, filename)
|
||||
if os.path.isfile(filepath):
|
||||
storage_mb += os.path.getsize(filepath)
|
||||
storage_mb = round(storage_mb / (1024 * 1024), 2) # Convert to MB
|
||||
|
||||
server_logs = get_recent_logs(20)
|
||||
|
||||
return render_template(
|
||||
'dashboard.html',
|
||||
players=players,
|
||||
groups=groups,
|
||||
server_logs=server_logs
|
||||
total_players=total_players,
|
||||
total_playlists=total_playlists,
|
||||
total_content=total_content,
|
||||
storage_mb=storage_mb,
|
||||
recent_logs=server_logs
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user