Upload 91 files
Browse files- static/js/app.js +20 -7
static/js/app.js
CHANGED
|
@@ -2055,6 +2055,8 @@ async function loadSystemHealth() {
|
|
| 2055 |
getToast().error('Failed to load system health');
|
| 2056 |
}
|
| 2057 |
}
|
|
|
|
|
|
|
| 2058 |
|
| 2059 |
async function loadProviderHealth() {
|
| 2060 |
try {
|
|
@@ -2117,6 +2119,8 @@ async function loadProviderHealth() {
|
|
| 2117 |
getToast().error('Failed to load provider health');
|
| 2118 |
}
|
| 2119 |
}
|
|
|
|
|
|
|
| 2120 |
|
| 2121 |
async function triggerSelfHeal() {
|
| 2122 |
try {
|
|
@@ -2136,7 +2140,10 @@ async function triggerSelfHeal() {
|
|
| 2136 |
getToast().error('Failed to trigger self-healing');
|
| 2137 |
}
|
| 2138 |
}
|
|
|
|
|
|
|
| 2139 |
|
|
|
|
| 2140 |
async function testAPIEndpoints() {
|
| 2141 |
const resultsDiv = document.getElementById('api-test-results');
|
| 2142 |
if (!resultsDiv) return;
|
|
@@ -2207,6 +2214,8 @@ async function testAPIEndpoints() {
|
|
| 2207 |
resultsDiv.innerHTML = html;
|
| 2208 |
getToast().success(`API tests completed: ${passed} passed, ${failed} failed`);
|
| 2209 |
}
|
|
|
|
|
|
|
| 2210 |
|
| 2211 |
async function checkDatabaseHealth() {
|
| 2212 |
try {
|
|
@@ -2229,6 +2238,8 @@ async function checkDatabaseHealth() {
|
|
| 2229 |
getToast().error('Failed to check database health');
|
| 2230 |
}
|
| 2231 |
}
|
|
|
|
|
|
|
| 2232 |
|
| 2233 |
async function testNetworkConnectivity() {
|
| 2234 |
const output = document.getElementById('diagnostic-output');
|
|
@@ -2260,6 +2271,8 @@ async function testNetworkConnectivity() {
|
|
| 2260 |
}
|
| 2261 |
getToast().success('Network connectivity test completed');
|
| 2262 |
}
|
|
|
|
|
|
|
| 2263 |
|
| 2264 |
async function loadRecentLogs() {
|
| 2265 |
try {
|
|
@@ -2296,20 +2309,20 @@ async function loadRecentLogs() {
|
|
| 2296 |
document.getElementById('recent-logs-content').innerHTML = '<p style="color: var(--danger);">Failed to load logs</p>';
|
| 2297 |
}
|
| 2298 |
}
|
|
|
|
|
|
|
| 2299 |
|
| 2300 |
// Export diagnostic functions to window
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2301 |
window.runDiagnostic = runDiagnostic;
|
| 2302 |
window.refreshDiagnosticStatus = refreshDiagnosticStatus;
|
| 2303 |
window.downloadDiagnosticLog = downloadDiagnosticLog;
|
| 2304 |
window.toggleAutoRefresh = toggleAutoRefresh;
|
| 2305 |
window.switchDiagnosticTab = switchDiagnosticTab;
|
| 2306 |
-
window.loadSystemHealth = loadSystemHealth;
|
| 2307 |
-
window.loadProviderHealth = loadProviderHealth;
|
| 2308 |
-
window.triggerSelfHeal = triggerSelfHeal;
|
| 2309 |
-
window.testAPIEndpoints = testAPIEndpoints;
|
| 2310 |
-
window.checkDatabaseHealth = checkDatabaseHealth;
|
| 2311 |
-
window.testNetworkConnectivity = testNetworkConnectivity;
|
| 2312 |
-
window.loadRecentLogs = loadRecentLogs;
|
| 2313 |
|
| 2314 |
// ===== AI TOOLS LOADER =====
|
| 2315 |
function loadAITools() {
|
|
|
|
| 2055 |
getToast().error('Failed to load system health');
|
| 2056 |
}
|
| 2057 |
}
|
| 2058 |
+
// Export to window immediately
|
| 2059 |
+
window.loadSystemHealth = loadSystemHealth;
|
| 2060 |
|
| 2061 |
async function loadProviderHealth() {
|
| 2062 |
try {
|
|
|
|
| 2119 |
getToast().error('Failed to load provider health');
|
| 2120 |
}
|
| 2121 |
}
|
| 2122 |
+
// Export to window immediately
|
| 2123 |
+
window.loadProviderHealth = loadProviderHealth;
|
| 2124 |
|
| 2125 |
async function triggerSelfHeal() {
|
| 2126 |
try {
|
|
|
|
| 2140 |
getToast().error('Failed to trigger self-healing');
|
| 2141 |
}
|
| 2142 |
}
|
| 2143 |
+
// Export immediately after definition
|
| 2144 |
+
window.triggerSelfHeal = triggerSelfHeal;
|
| 2145 |
|
| 2146 |
+
// Update the actual implementation (replacing placeholder)
|
| 2147 |
async function testAPIEndpoints() {
|
| 2148 |
const resultsDiv = document.getElementById('api-test-results');
|
| 2149 |
if (!resultsDiv) return;
|
|
|
|
| 2214 |
resultsDiv.innerHTML = html;
|
| 2215 |
getToast().success(`API tests completed: ${passed} passed, ${failed} failed`);
|
| 2216 |
}
|
| 2217 |
+
// Export to window immediately
|
| 2218 |
+
window.testAPIEndpoints = testAPIEndpoints;
|
| 2219 |
|
| 2220 |
async function checkDatabaseHealth() {
|
| 2221 |
try {
|
|
|
|
| 2238 |
getToast().error('Failed to check database health');
|
| 2239 |
}
|
| 2240 |
}
|
| 2241 |
+
// Export to window immediately
|
| 2242 |
+
window.checkDatabaseHealth = checkDatabaseHealth;
|
| 2243 |
|
| 2244 |
async function testNetworkConnectivity() {
|
| 2245 |
const output = document.getElementById('diagnostic-output');
|
|
|
|
| 2271 |
}
|
| 2272 |
getToast().success('Network connectivity test completed');
|
| 2273 |
}
|
| 2274 |
+
// Export to window immediately
|
| 2275 |
+
window.testNetworkConnectivity = testNetworkConnectivity;
|
| 2276 |
|
| 2277 |
async function loadRecentLogs() {
|
| 2278 |
try {
|
|
|
|
| 2309 |
document.getElementById('recent-logs-content').innerHTML = '<p style="color: var(--danger);">Failed to load logs</p>';
|
| 2310 |
}
|
| 2311 |
}
|
| 2312 |
+
// Export to window immediately
|
| 2313 |
+
window.loadRecentLogs = loadRecentLogs;
|
| 2314 |
|
| 2315 |
// Export diagnostic functions to window
|
| 2316 |
+
// Note: loadSystemHealth, loadProviderHealth, triggerSelfHeal, testAPIEndpoints,
|
| 2317 |
+
// checkDatabaseHealth, testNetworkConnectivity, loadRecentLogs, and handleAIToolsIframeLoad
|
| 2318 |
+
// are exported immediately after their definitions above (not here to avoid overwriting)
|
| 2319 |
+
|
| 2320 |
+
// Export diagnostic functions to window (actual implementations)
|
| 2321 |
window.runDiagnostic = runDiagnostic;
|
| 2322 |
window.refreshDiagnosticStatus = refreshDiagnosticStatus;
|
| 2323 |
window.downloadDiagnosticLog = downloadDiagnosticLog;
|
| 2324 |
window.toggleAutoRefresh = toggleAutoRefresh;
|
| 2325 |
window.switchDiagnosticTab = switchDiagnosticTab;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2326 |
|
| 2327 |
// ===== AI TOOLS LOADER =====
|
| 2328 |
function loadAITools() {
|