Admin protetto, dashboard KPI e aggiornamenti sito marketing.

Login admin con cambio password, metriche server (CPU/RAM/disco/banda), grafici e statistiche streaming; sezione piani ridimensionata.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-26 18:18:47 +02:00
parent 3d3420cc4a
commit 3a5649f482
26 changed files with 983 additions and 55 deletions

View File

@@ -0,0 +1,22 @@
module AdminHelper
def format_bytes(bytes)
return "" if bytes.nil?
units = %w[B KB MB GB TB]
size = bytes.to_f
unit = units.shift
while size >= 1024 && units.any?
size /= 1024
unit = units.shift
end
"#{size.round(size >= 10 ? 0 : 1)} #{unit}"
end
def format_duration_minutes(minutes)
return "0 min" if minutes.to_i <= 0
hours = minutes / 60
mins = minutes % 60
hours.positive? ? "#{hours}h #{mins}m" : "#{mins} min"
end
end