Files
Warracker/test.html
sassanix c267517de2 Fixed uploads to load the invoices
1. **Simplified nginx configuration:**
   - Changed from `root /data` back to `alias /data/uploads/` which is the correct way to map `/uploads/` to `/data/uploads/`
   - Removed potentially conflicting location blocks
   - Fixed the error handling to not redirect upload 404s to the index page

2. **Improved startup script:**
   - Added checking and reporting of directory permissions
   - Added explicit chmod during startup

3. **Simplified Flask route:**
   - Removed all the complex debugging code
   - Returned to a simple `send_from_directory` call

4. **Added a basic test file:**
   - Created ping.html to test basic nginx functionality
2025-03-03 07:59:44 -04:00

76 lines
2.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Image Test</title>
<style>
body {
font-family: Arial, sans-serif;
padding: 20px;
max-width: 800px;
margin: 0 auto;
}
.test-box {
border: 1px solid #ccc;
padding: 20px;
margin: 20px 0;
}
h1 {
color: #333;
}
img {
max-width: 100%;
border: 1px dashed #999;
}
.success {
color: green;
font-weight: bold;
}
.failure {
color: red;
font-weight: bold;
}
</style>
</head>
<body>
<h1>Image Loading Test</h1>
<div class="test-box">
<h2>Test 1: Direct IMG Tag</h2>
<p>Testing image: <span id="image-path">/uploads/20250303033711_dummy-invoice-1018x1440.png</span></p>
<div>
<img src="/uploads/20250303033711_dummy-invoice-1018x1440.png" alt="Invoice Image" id="test-image">
</div>
<p id="status">Loading...</p>
</div>
<div class="test-box">
<h2>Test 2: Text File Test</h2>
<p>Testing text file from uploads directory:</p>
<iframe src="/uploads/debug-test.txt" style="width:100%; height:100px; border:1px solid #ccc;"></iframe>
</div>
<div class="test-box">
<h2>Test 3: Directory Listing</h2>
<p>Testing directory listing:</p>
<iframe src="/uploads/" style="width:100%; height:200px; border:1px solid #ccc;"></iframe>
</div>
<script>
// Check if image loads
const img = document.getElementById('test-image');
const status = document.getElementById('status');
img.onload = function() {
status.textContent = "SUCCESS: Image loaded successfully!";
status.className = "success";
};
img.onerror = function() {
status.textContent = "FAILURE: Image failed to load.";
status.className = "failure";
};
</script>
</body>
</html>