File size: 2,612 Bytes
fde6c6f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
import sys
from pathlib import Path
# Add project root to 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()
# Test 1: Check if app.py was updated correctly
print("1. Testing app.py structure:")
try:
with open('app.py', 'r') as f:
content = f.read()
# Check for key components
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()
# Test 2: Check Ollama provider timeout
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()
# Test 3: Check for debug panel restoration
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()
|