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:
@@ -1,8 +1,19 @@
|
||||
module Admin
|
||||
class DashboardController < Admin::BaseController
|
||||
def index
|
||||
@teams = Team.includes(:matches).order(:name)
|
||||
@active_sessions = StreamSession.where(status: %w[live reconnecting connecting]).includes(:match)
|
||||
@stats = DashboardStats.new.call
|
||||
@host = HostMetrics.new.sample!
|
||||
@active_sessions = StreamSession
|
||||
.where(status: DashboardStats::ACTIVE_STATUSES)
|
||||
.includes(match: :team)
|
||||
.order(started_at: :desc)
|
||||
@teams = Team.includes(:matches).order(:name).limit(8)
|
||||
end
|
||||
|
||||
def metrics
|
||||
host = HostMetrics.new.sample!
|
||||
stats = DashboardStats.new.call
|
||||
render json: { host: host, stats: stats, at: Time.current.iso8601 }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user