-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_simple.html
More file actions
152 lines (140 loc) · 4.7 KB
/
test_simple.html
File metadata and controls
152 lines (140 loc) · 4.7 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CLAMS Agent Test Page</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 50px auto;
padding: 20px;
background-color: #f5f5f5;
}
.container {
background: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
h1 {
color: #1976d2;
text-align: center;
}
.status {
margin: 20px 0;
padding: 15px;
border-radius: 4px;
}
.success {
background-color: #e8f5e8;
border: 1px solid #4caf50;
color: #2e7d32;
}
.error {
background-color: #ffebee;
border: 1px solid #f44336;
color: #c62828;
}
button {
background-color: #1976d2;
color: white;
border: none;
padding: 10px 20px;
border-radius: 4px;
cursor: pointer;
margin: 10px 5px;
}
button:hover {
background-color: #1565c0;
}
#results {
margin-top: 20px;
padding: 15px;
background-color: #f9f9f9;
border-radius: 4px;
border: 1px solid #ddd;
}
</style>
</head>
<body>
<div class="container">
<h1>🤖 CLAMS Agent Test Page</h1>
<div class="status success">
<strong>✅ Basic Page Loading:</strong> This simple HTML page is loading correctly!
</div>
<div>
<h3>Test Server Endpoints:</h3>
<button onclick="testHealth()">Test /api/health</button>
<button onclick="testPipelines()">Test /api/pipelines</button>
<button onclick="testAssets()">Test Assets Loading</button>
</div>
<div id="results"></div>
<div style="margin-top: 30px;">
<h3>Next Steps:</h3>
<p>If this page loads correctly, the Flask server is working. The React app issue might be:</p>
<ul>
<li>JavaScript compilation errors</li>
<li>React component rendering issues</li>
<li>Missing dependencies or imports</li>
<li>Browser caching old assets</li>
</ul>
</div>
</div>
<script>
function displayResult(title, success, data) {
const results = document.getElementById('results');
const className = success ? 'success' : 'error';
const icon = success ? '✅' : '❌';
results.innerHTML += `
<div class="status ${className}">
<strong>${icon} ${title}:</strong><br>
<pre>${JSON.stringify(data, null, 2)}</pre>
</div>
`;
}
async function testHealth() {
try {
const response = await fetch('/api/health');
const data = await response.json();
displayResult('Health Check', response.ok, data);
} catch (error) {
displayResult('Health Check', false, error.message);
}
}
async function testPipelines() {
try {
const response = await fetch('/api/pipelines');
const data = await response.json();
displayResult('Pipelines API', response.ok, data);
} catch (error) {
displayResult('Pipelines API', false, error.message);
}
}
async function testAssets() {
try {
// Test CSS
const cssResponse = await fetch('/assets/index-07d7a772.css');
const cssSuccess = cssResponse.ok;
// Test JS
const jsResponse = await fetch('/assets/index-12c223a0.js');
const jsSuccess = jsResponse.ok;
displayResult('Assets Loading', cssSuccess && jsSuccess, {
css: cssSuccess ? 'OK' : 'FAILED',
javascript: jsSuccess ? 'OK' : 'FAILED'
});
} catch (error) {
displayResult('Assets Loading', false, error.message);
}
}
// Auto-test on load
window.onload = function() {
console.log('Simple test page loaded successfully');
setTimeout(() => {
testHealth();
}, 1000);
};
</script>
</body>
</html>