-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_orders.html
More file actions
110 lines (99 loc) · 3.93 KB
/
debug_orders.html
File metadata and controls
110 lines (99 loc) · 3.93 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Orders Debug</title>
<style>
body {
font-family: monospace;
background: #1a1a1a;
color: #fff;
padding: 20px;
}
.log {
margin: 5px 0;
padding: 5px;
border-left: 3px solid #333;
background: #222;
}
.log.info { border-color: #0066cc; }
.log.success { border-color: #00cc66; }
.log.warning { border-color: #cc6600; }
.log.error { border-color: #cc0000; }
button {
background: #333;
color: #fff;
border: 1px solid #555;
padding: 10px 20px;
cursor: pointer;
margin: 10px 5px;
}
button:hover {
background: #444;
}
#logs {
max-height: 500px;
overflow-y: auto;
border: 1px solid #333;
padding: 10px;
margin: 20px 0;
}
</style>
</head>
<body>
<h1>Orders Debug Console</h1>
<p>Open the browser console to see detailed logs from the UserOrdersTab component.</p>
<div>
<button onclick="clearLogs()">Clear Logs</button>
<button onclick="checkConsole()">Check Console</button>
<button onclick="window.location.href='http://localhost:8081'">Go to App</button>
</div>
<div id="logs"></div>
<script>
const logsContainer = document.getElementById('logs');
function addLog(message, type = 'info') {
const logDiv = document.createElement('div');
logDiv.className = `log ${type}`;
logDiv.innerHTML = `[${new Date().toLocaleTimeString()}] ${message}`;
logsContainer.appendChild(logDiv);
logsContainer.scrollTop = logsContainer.scrollHeight;
}
function clearLogs() {
logsContainer.innerHTML = '';
console.clear();
addLog('Logs cleared', 'info');
}
function checkConsole() {
addLog('Check the browser console (F12) for detailed logs from the UserOrdersTab component', 'info');
addLog('Look for logs starting with: 🔍 [UserOrdersTab], 🔍 [fetchOrders], 🔍 [fetchOpenOrders]', 'info');
}
// Intercept console logs to show them here as well
const originalLog = console.log;
const originalError = console.error;
const originalWarn = console.warn;
console.log = function(...args) {
originalLog.apply(console, args);
const message = args.map(arg => typeof arg === 'object' ? JSON.stringify(arg, null, 2) : arg).join(' ');
if (message.includes('[UserOrdersTab]') || message.includes('[fetchOrders]') || message.includes('[fetchOpenOrders]')) {
addLog(message, 'info');
}
};
console.error = function(...args) {
originalError.apply(console, args);
const message = args.map(arg => typeof arg === 'object' ? JSON.stringify(arg, null, 2) : arg).join(' ');
if (message.includes('[UserOrdersTab]') || message.includes('[fetchOrders]') || message.includes('[fetchOpenOrders]')) {
addLog(message, 'error');
}
};
console.warn = function(...args) {
originalWarn.apply(console, args);
const message = args.map(arg => typeof arg === 'object' ? JSON.stringify(arg, null, 2) : arg).join(' ');
if (message.includes('[UserOrdersTab]') || message.includes('[fetchOrders]') || message.includes('[fetchOpenOrders]')) {
addLog(message, 'warning');
}
};
addLog('Debug page loaded. Go to the app and check the Orders tab.', 'success');
</script>
</body>
</html>