Add full Oculog codebase
This commit is contained in:
89
server/frontend/public/index.html
Normal file
89
server/frontend/public/index.html
Normal file
@@ -0,0 +1,89 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5, user-scalable=yes, viewport-fit=cover" />
|
||||
<meta name="theme-color" content="#fc2922" />
|
||||
<meta name="description" content="Oculog - Server Metrics Observability Platform" />
|
||||
<link rel="icon" type="image/png" href="/oculog-logo.png" />
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<title>Oculog - Server Metrics Dashboard</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
<script>
|
||||
// Suppress external script errors before React loads
|
||||
(function() {
|
||||
const originalError = window.onerror;
|
||||
window.onerror = function(message, source, lineno, colno, error) {
|
||||
// Suppress errors from browser extensions and external scripts
|
||||
if (
|
||||
message === 'Script error.' ||
|
||||
(typeof message === 'string' && (
|
||||
message.includes('ethereum') ||
|
||||
message.includes('web3') ||
|
||||
message.includes('window.ethereum') ||
|
||||
message.includes('selectedAddress') ||
|
||||
message.includes('undefined is not an object')
|
||||
)) ||
|
||||
(source && (
|
||||
source.includes('chrome-extension://') ||
|
||||
source.includes('moz-extension://') ||
|
||||
source.includes('safari-extension://') ||
|
||||
source === ''
|
||||
))
|
||||
) {
|
||||
return true; // Suppress the error
|
||||
}
|
||||
// Call original handler if it exists
|
||||
if (originalError) {
|
||||
return originalError.apply(this, arguments);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
// Also suppress React error overlay by intercepting its creation
|
||||
const originalCreateElement = document.createElement;
|
||||
document.createElement = function(tagName) {
|
||||
const element = originalCreateElement.call(document, tagName);
|
||||
|
||||
// If creating an iframe that might be the error overlay
|
||||
if (tagName.toLowerCase() === 'iframe') {
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.type === 'attributes' && mutation.attributeName === 'src') {
|
||||
const src = element.getAttribute('src') || '';
|
||||
if (src.includes('react-error-overlay')) {
|
||||
// Check if it's an external error
|
||||
setTimeout(function() {
|
||||
try {
|
||||
const iframeDoc = element.contentDocument || element.contentWindow?.document;
|
||||
if (iframeDoc) {
|
||||
const iframeText = iframeDoc.body?.textContent || '';
|
||||
if (
|
||||
iframeText.includes('Script error') ||
|
||||
iframeText.includes('ethereum') ||
|
||||
iframeText.includes('selectedAddress')
|
||||
) {
|
||||
element.remove();
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// Cross-origin, can't access
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
observer.observe(element, { attributes: true, attributeFilter: ['src'] });
|
||||
}
|
||||
|
||||
return element;
|
||||
};
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
BIN
server/frontend/public/oculog-logo.png
Normal file
BIN
server/frontend/public/oculog-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 533 KiB |
Reference in New Issue
Block a user