refactor: Code cleanup and documentation updates
Bug fixes: - Fix ticket ID extraction using URLSearchParams instead of split() - Add error handling for query result in get_users.php - Make Discord webhook URLs dynamic (use HTTP_HOST) Code cleanup: - Remove debug console.log statements from dashboard.js and ticket.js - Add getTicketIdFromUrl() helper function to both JS files Documentation: - Update Claude.md: fix web server (nginx not Apache), add new notes - Update README.md: add keyboard shortcuts, update setup instructions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -234,12 +234,16 @@ $priorityColors = [
|
||||
"4" => 6736490 // --priority-4: #66bb6a
|
||||
];
|
||||
|
||||
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
|
||||
$host = $_SERVER['HTTP_HOST'] ?? 't.lotusguild.org';
|
||||
$ticketUrl = "{$protocol}://{$host}/ticket/{$ticket_id}";
|
||||
|
||||
$discord_data = [
|
||||
"content" => "",
|
||||
"embeds" => [[
|
||||
"title" => "New Ticket Created: #" . $ticket_id,
|
||||
"description" => $title,
|
||||
"url" => "http://t.lotusguild.org/ticket/" . $ticket_id,
|
||||
"url" => $ticketUrl,
|
||||
"color" => $priorityColors[$priority],
|
||||
"fields" => [
|
||||
["name" => "Priority", "value" => $priority, "inline" => true],
|
||||
|
||||
Reference in New Issue
Block a user