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

@@ -1,6 +1,30 @@
module Admin
class BaseController < ActionController::Base
layout "admin"
protect_from_forgery with: :null_session
protect_from_forgery with: :exception
before_action :require_admin_login
include ::AdminHelper
helper_method :current_admin_account, :admin_logged_in?
private
def require_admin_login
return if admin_logged_in?
session[:admin_return_to] = request.fullpath unless request.path == admin_login_path
redirect_to admin_login_path, alert: "Accedi per continuare"
end
def current_admin_account
return unless session[:admin_account_id]
@current_admin_account ||= AdminAccount.find_by(id: session[:admin_account_id])
end
def admin_logged_in?
current_admin_account.present?
end
end
end