Spaces:
Running
Running
Update data directory handling to use current working directory for persistence, enhance logging for evaluation saving and results retrieval, and add debug information display in the debug.html template.
4042660 | <html> | |
| <head> | |
| <title>Debug Information</title> | |
| <style> | |
| body { | |
| font-family: monospace; | |
| padding: 20px; | |
| background-color: #f5f5f5; | |
| } | |
| .debug-container { | |
| background-color: white; | |
| padding: 20px; | |
| border-radius: 5px; | |
| box-shadow: 0 0 10px rgba(0,0,0,0.1); | |
| max-width: 1000px; | |
| margin: 0 auto; | |
| } | |
| h1 { | |
| border-bottom: 2px solid #eee; | |
| padding-bottom: 10px; | |
| } | |
| .section { | |
| margin-bottom: 30px; | |
| } | |
| .section h2 { | |
| background-color: #f0f0f0; | |
| padding: 10px; | |
| border-radius: 5px; | |
| } | |
| .debug-item { | |
| border-bottom: 1px solid #eee; | |
| padding: 10px 0; | |
| } | |
| .key { | |
| font-weight: bold; | |
| color: #333; | |
| display: inline-block; | |
| width: 200px; | |
| } | |
| .value { | |
| font-family: monospace; | |
| background-color: #f9f9f9; | |
| padding: 3px 6px; | |
| border-radius: 3px; | |
| color: #0066cc; | |
| display: inline-block; | |
| white-space: pre-wrap; | |
| word-break: break-all; | |
| max-width: 700px; | |
| } | |
| .error { | |
| color: red; | |
| background-color: #fff0f0; | |
| padding: 10px; | |
| border-radius: 5px; | |
| margin: 10px 0; | |
| border-left: 4px solid red; | |
| } | |
| .success { | |
| color: green; | |
| background-color: #f0fff0; | |
| padding: 10px; | |
| border-radius: 5px; | |
| margin: 10px 0; | |
| border-left: 4px solid green; | |
| } | |
| .back-link { | |
| margin-top: 20px; | |
| display: inline-block; | |
| padding: 8px 15px; | |
| background-color: #0066cc; | |
| color: white; | |
| text-decoration: none; | |
| border-radius: 4px; | |
| } | |
| .back-link:hover { | |
| background-color: #0055aa; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="debug-container"> | |
| <h1>Debug Information</h1> | |
| <div class="section"> | |
| <h2>System Information</h2> | |
| {% if debug_info %} | |
| {% for key, value in debug_info.items() %} | |
| <div class="debug-item"> | |
| <span class="key">{{ key }}</span>: <span class="value">{{ value }}</span> | |
| </div> | |
| {% endfor %} | |
| {% endif %} | |
| </div> | |
| <div class="section"> | |
| <h2>Session Data</h2> | |
| {% if session %} | |
| {% for key, value in session.items() %} | |
| <div class="debug-item"> | |
| <span class="key">{{ key }}</span>: <span class="value">{{ value }}</span> | |
| </div> | |
| {% endfor %} | |
| {% else %} | |
| <div class="error">No session data available</div> | |
| {% endif %} | |
| </div> | |
| <div class="section"> | |
| <h2>Files Available</h2> | |
| <div class="debug-item"> | |
| <span class="key">documents.csv</span>: | |
| <span class="value"> | |
| {% if documents_exists %} | |
| <span class="success">File exists</span> | |
| {% else %} | |
| <span class="error">File does not exist</span> | |
| {% endif %} | |
| </span> | |
| </div> | |
| <div class="debug-item"> | |
| <span class="key">evaluations.csv</span>: | |
| <span class="value"> | |
| {% if evaluations_exists %} | |
| <span class="success">File exists</span> | |
| {% else %} | |
| <span class="error">File does not exist</span> | |
| {% endif %} | |
| </span> | |
| </div> | |
| </div> | |
| <div class="section"> | |
| <h2>Document Data</h2> | |
| {% if documents %} | |
| <div class="success">Found {{ documents|length }} document(s) available for evaluation</div> | |
| {% for doc in documents %} | |
| <div class="debug-item"> | |
| <span class="key">Document {{ loop.index }}</span>: | |
| <span class="value">{{ doc.filename }} ({{ doc.description }})</span> | |
| </div> | |
| {% endfor %} | |
| {% else %} | |
| <div class="error">No documents found or all documents have been evaluated</div> | |
| {% endif %} | |
| </div> | |
| <div class="section"> | |
| <h2>Evaluations</h2> | |
| {% if evaluations %} | |
| <div class="success">Found {{ evaluations|length }} evaluation(s)</div> | |
| {% for eval in evaluations %} | |
| <div class="debug-item"> | |
| <span class="key">Evaluation {{ loop.index }}</span>: | |
| <span class="value">{{ eval.document_title }} by {{ eval.investigator_name }}</span> | |
| </div> | |
| {% endfor %} | |
| {% else %} | |
| <div class="error">No evaluations found</div> | |
| {% endif %} | |
| </div> | |
| <div class="section"> | |
| <h2>Recent Errors</h2> | |
| {% if errors %} | |
| {% for error in errors %} | |
| <div class="error">{{ error }}</div> | |
| {% endfor %} | |
| {% else %} | |
| <div class="success">No errors recorded</div> | |
| {% endif %} | |
| </div> | |
| <a href="{{ url_for('index') }}" class="back-link">Back to Home</a> | |
| </div> | |
| </body> | |
| </html> |