Lots of updates
This commit is contained in:
@@ -89,4 +89,54 @@ module ApplicationHelper
|
||||
|
||||
raw html
|
||||
end
|
||||
|
||||
# Helper methods for job queue status colors
|
||||
def job_queue_status_color(status)
|
||||
case status.to_s
|
||||
when 'healthy'
|
||||
'bg-green-500'
|
||||
when 'warning'
|
||||
'bg-yellow-500'
|
||||
when 'critical'
|
||||
'bg-red-500'
|
||||
when 'error'
|
||||
'bg-gray-500'
|
||||
else
|
||||
'bg-blue-500'
|
||||
end
|
||||
end
|
||||
|
||||
def job_queue_status_text_color(status)
|
||||
case status.to_s
|
||||
when 'healthy'
|
||||
'text-green-600'
|
||||
when 'warning'
|
||||
'text-yellow-600'
|
||||
when 'critical'
|
||||
'text-red-600'
|
||||
when 'error'
|
||||
'text-gray-600'
|
||||
else
|
||||
'text-blue-600'
|
||||
end
|
||||
end
|
||||
|
||||
# Parse user agent string into readable components
|
||||
def parse_user_agent(user_agent)
|
||||
return nil if user_agent.blank?
|
||||
|
||||
client = DeviceDetector.new(user_agent)
|
||||
|
||||
{
|
||||
name: client.name,
|
||||
version: client.full_version,
|
||||
os_name: client.os_name,
|
||||
os_version: client.os_full_version,
|
||||
device_type: client.device_type || "desktop",
|
||||
device_name: client.device_name,
|
||||
bot: client.bot?,
|
||||
bot_name: client.bot_name,
|
||||
raw: user_agent
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user