|
import sys |
|
from pathlib import Path |
|
|
|
|
|
project_root = Path(__file__).parent |
|
sys.path.append(str(project_root)) |
|
|
|
def test_ui_fixes(): |
|
"""Test the UI fixes and improvements""" |
|
print("=== UI Fixes Test ===") |
|
print() |
|
|
|
|
|
print("1. Testing app.py structure:") |
|
try: |
|
with open('app.py', 'r') as f: |
|
content = f.read() |
|
|
|
|
|
required_components = [ |
|
'st.session_state.ngrok_url_temp', |
|
'Test Ollama Connection', |
|
'Advanced System Monitor', |
|
'π‘ Test Ollama Connection', |
|
'is_sending' |
|
] |
|
|
|
missing_components = [] |
|
for component in required_components: |
|
if component not in content: |
|
missing_components.append(component) |
|
|
|
if missing_components: |
|
print(f" β Missing components: {missing_components}") |
|
else: |
|
print(" β
All required UI components present") |
|
|
|
except Exception as e: |
|
print(f" β Error reading app.py: {e}") |
|
|
|
print() |
|
|
|
|
|
print("2. Testing Ollama provider timeout:") |
|
try: |
|
with open('core/providers/ollama.py', 'r') as f: |
|
content = f.read() |
|
|
|
if 'timeout: int = 60' in content: |
|
print(" β
Ollama timeout increased to 60 seconds") |
|
else: |
|
print(" β Ollama timeout not updated") |
|
|
|
except Exception as e: |
|
print(f" β Error reading Ollama provider: {e}") |
|
|
|
print() |
|
|
|
|
|
print("3. Testing debug panel restoration:") |
|
try: |
|
with open('app.py', 'r') as f: |
|
content = f.read() |
|
|
|
debug_features = [ |
|
'Advanced System Monitor', |
|
'System Controls', |
|
'Provider Status', |
|
'Session Statistics' |
|
] |
|
|
|
missing_features = [] |
|
for feature in debug_features: |
|
if feature not in content: |
|
missing_features.append(feature) |
|
|
|
if missing_features: |
|
print(f" β Missing debug features: {missing_features}") |
|
else: |
|
print(" β
All debug panel features restored") |
|
|
|
except Exception as e: |
|
print(f" β Error checking debug panel: {e}") |
|
|
|
print() |
|
print("π UI Fixes Test Completed!") |
|
|
|
if __name__ == "__main__": |
|
test_ui_fixes() |
|
|