From 259f6c425e26646ece286f36c8b71385d96eb93a Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Sat, 21 Feb 2026 17:35:19 +0000 Subject: [PATCH] Autosave: 20260221-173519 --- ai/config.php | 45 ++++++--- assets/css/custom.css | 20 ++++ customer-display.php | 2 +- debug_395.txt | 31 ------ debug_sessions.log | 1 - index.php | 19 ++-- login_debug.log | 5 - post_debug.log | 205 +------------------------------------- search_debug.log | 15 --- simulate_import.php | 44 ++++++++ test_ai_config.php | 9 ++ test_import.csv | 3 + test_translate_action.php | 11 ++ 13 files changed, 136 insertions(+), 274 deletions(-) delete mode 100644 debug_395.txt delete mode 100644 debug_sessions.log delete mode 100644 login_debug.log delete mode 100644 search_debug.log create mode 100644 simulate_import.php create mode 100644 test_ai_config.php create mode 100644 test_import.csv create mode 100644 test_translate_action.php diff --git a/ai/config.php b/ai/config.php index c5e204e..b77c60c 100644 --- a/ai/config.php +++ b/ai/config.php @@ -4,9 +4,19 @@ function get_ai_env($key) { $val = getenv($key); - if ($val !== false && $val !== '') return $val; - if (isset($_ENV[$key]) && $_ENV[$key] !== '') return $_ENV[$key]; - if (isset($_SERVER[$key]) && $_SERVER[$key] !== '') return $_SERVER[$key]; + if ($val !== false && $val !== '') { + error_log("get_ai_env: $key from getenv: " . $val); + return $val; + } + if (isset($_ENV[$key]) && $_ENV[$key] !== '') { + error_log("get_ai_env: $key from \$_ENV: " . $_ENV[$key]); + return $_ENV[$key]; + } + if (isset($_SERVER[$key]) && $_SERVER[$key] !== '') { + error_log("get_ai_env: $key from \$_SERVER: " . $_SERVER[$key]); + return $_SERVER[$key]; + } + error_log("get_ai_env: $key not found in environment"); return null; } @@ -14,6 +24,7 @@ $projectUuid = get_ai_env('PROJECT_UUID'); $projectId = get_ai_env('PROJECT_ID'); if (!$projectUuid || !$projectId) { + error_log("PROJECT_UUID or PROJECT_ID missing, starting .env search"); $possiblePaths = [ __DIR__ . '/../../.env', __DIR__ . '/../.env', @@ -24,18 +35,22 @@ if (!$projectUuid || !$projectId) { foreach ($possiblePaths as $path) { if (file_exists($path) && is_readable($path)) { - $lines = @file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: []; - foreach ($lines as $line) { - $line = trim($line); - if ($line === '' || $line[0] === '#') continue; - if (!str_contains($line, '=')) continue; - - [$k, $v] = array_map('trim', explode('=', $line, 2)); - $v = trim($v, "\"' "); - - if (!$projectUuid && $k === 'PROJECT_UUID') $projectUuid = $v; - if (!$projectId && $k === 'PROJECT_ID') $projectId = $v; + error_log("Trying .env path: $path"); + $env = @parse_ini_file($path); + if ($env) { + if (!$projectUuid && !empty($env['PROJECT_UUID'])) { + $projectUuid = $env['PROJECT_UUID']; + error_log("Found PROJECT_UUID in $path: " . $projectUuid); + } + if (!$projectId && !empty($env['PROJECT_ID'])) { + $projectId = $env['PROJECT_ID']; + error_log("Found PROJECT_ID in $path: " . $projectId); + } + } else { + error_log("Failed to parse_ini_file: $path"); } + } else { + error_log("Path not found or not readable: $path"); } if ($projectUuid && $projectId) break; } @@ -50,7 +65,7 @@ return [ 'project_id' => $projectId, 'project_uuid' => $projectUuid, 'project_header' => 'project-uuid', - 'default_model' => 'gpt-5-mini', + 'default_model' => 'gpt-4o-mini', 'timeout' => 30, 'verify_tls' => true, ]; diff --git a/assets/css/custom.css b/assets/css/custom.css index 6a5a1b6..8359aed 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -110,6 +110,26 @@ body { top: 0; transition: all 0.3s; z-index: 1000; + overflow-y: auto; + overflow-x: hidden; +} + +/* Custom scrollbar for sidebar */ +.sidebar::-webkit-scrollbar { + width: 6px; +} + +.sidebar::-webkit-scrollbar-track { + background: transparent; +} + +.sidebar::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.2); + border-radius: 3px; +} + +.sidebar::-webkit-scrollbar-thumb:hover { + background: rgba(255, 255, 255, 0.3); } /* Base positioning for desktop */ diff --git a/customer-display.php b/customer-display.php index c4f6da3..a39ec4f 100644 --- a/customer-display.php +++ b/customer-display.php @@ -35,7 +35,7 @@ if (empty($slides)) { Customer Display - +