Blocca la seconda diretta sullo stesso utente, registra gli abusi in admin e presenta la copertina come grafica caricata dalla società, con demo Team MLTV. Co-authored-by: Cursor <cursoragent@cursor.com>
37 lines
1.0 KiB
Ruby
37 lines
1.0 KiB
Ruby
module Admin
|
|
class DashboardController < Admin::BaseController
|
|
def index
|
|
@stats = DashboardStats.new.call
|
|
@host = HostMetrics.new.sample!
|
|
@active_sessions = StreamSession
|
|
.where(status: DashboardStats::ACTIVE_STATUSES)
|
|
.includes(:stream_node, match: :team)
|
|
.order(started_at: :desc)
|
|
@teams = Team.includes(:matches).order(:name).limit(8)
|
|
@recent_concurrency_violations = StreamConcurrencyViolation.recent.limit(8)
|
|
@concurrency_violation_lookback = StreamConcurrencyViolation.lookback.count
|
|
end
|
|
|
|
def metrics
|
|
host = HostMetrics.new.sample!
|
|
stats = DashboardStats.new.call
|
|
render json: {
|
|
host: host,
|
|
stats: stats,
|
|
ops_summary: ops_summary,
|
|
at: Time.current.iso8601
|
|
}
|
|
end
|
|
|
|
private
|
|
|
|
def ops_summary
|
|
{
|
|
open_critical: Ops::Incident.critical_open.count,
|
|
open_warning: Ops::Incident.open.where(severity: "warning").count,
|
|
open_total: Ops::Incident.open.count
|
|
}
|
|
end
|
|
end
|
|
end
|