Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update frontend/src/components/ErrorBoundary.jsx
Browse files
frontend/src/components/ErrorBoundary.jsx
CHANGED
|
@@ -40,46 +40,40 @@ export class ErrorBoundary extends React.Component {
|
|
| 40 |
render() {
|
| 41 |
if (this.state.hasError) {
|
| 42 |
return (
|
| 43 |
-
<div className="min-h-screen flex flex-col items-center justify-center bg-slate-
|
| 44 |
-
<div className="bg-
|
| 45 |
-
<div className="w-
|
| 46 |
-
<span className="material-symbols-outlined text-
|
| 47 |
</div>
|
| 48 |
-
|
| 49 |
-
<
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
</p>
|
| 52 |
|
| 53 |
-
{this.state.error?.message && (
|
| 54 |
-
<div className="mb-5 p-3 bg-red-50 border border-red-200 rounded-xl text-left">
|
| 55 |
-
<div className="text-xs font-bold text-red-800 mb-1 flex items-center gap-1">
|
| 56 |
-
<span className="material-symbols-outlined text-[14px]">error</span>
|
| 57 |
-
System Notice:
|
| 58 |
-
</div>
|
| 59 |
-
<p className="text-xs font-mono text-red-700 break-words leading-relaxed max-h-24 overflow-y-auto">
|
| 60 |
-
{this.state.error.message}
|
| 61 |
-
</p>
|
| 62 |
-
</div>
|
| 63 |
-
)}
|
| 64 |
-
|
| 65 |
<div className="flex flex-col gap-3">
|
| 66 |
-
<button
|
| 67 |
-
onClick={() => {
|
| 68 |
-
this.setState({ hasError: false, error: null });
|
| 69 |
-
}}
|
| 70 |
-
className="w-full bg-blue-600 hover:bg-blue-700 text-white font-semibold py-3 px-6 rounded-xl transition-all shadow-md shadow-blue-600/20 border-0 cursor-pointer text-sm"
|
| 71 |
-
>
|
| 72 |
-
Resume Current View
|
| 73 |
-
</button>
|
| 74 |
<button
|
| 75 |
onClick={() => {
|
| 76 |
this.setState({ hasError: false, error: null });
|
| 77 |
window.location.reload();
|
| 78 |
}}
|
| 79 |
-
className="w-full bg-
|
| 80 |
>
|
|
|
|
| 81 |
Refresh Page
|
| 82 |
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
<button
|
| 84 |
onClick={() => {
|
| 85 |
sessionStorage.clear();
|
|
@@ -87,7 +81,7 @@ export class ErrorBoundary extends React.Component {
|
|
| 87 |
localStorage.removeItem('wss_refresh_token');
|
| 88 |
window.location.href = '/login';
|
| 89 |
}}
|
| 90 |
-
className="w-full text-slate-
|
| 91 |
>
|
| 92 |
Clear Session & Return to Login
|
| 93 |
</button>
|
|
|
|
| 40 |
render() {
|
| 41 |
if (this.state.hasError) {
|
| 42 |
return (
|
| 43 |
+
<div className="min-h-screen flex flex-col items-center justify-center bg-slate-900 p-6 text-center font-sans">
|
| 44 |
+
<div className="bg-slate-800 border border-slate-700 shadow-2xl rounded-2xl p-8 max-w-md w-full animate-fade-in text-white">
|
| 45 |
+
<div className="w-14 h-14 rounded-full bg-amber-500/10 text-amber-400 border border-amber-500/20 flex items-center justify-center mx-auto mb-4">
|
| 46 |
+
<span className="material-symbols-outlined text-3xl">warning</span>
|
| 47 |
</div>
|
| 48 |
+
|
| 49 |
+
<h2 className="text-xl font-bold text-slate-100 mb-2">
|
| 50 |
+
Something Went Wrong
|
| 51 |
+
</h2>
|
| 52 |
+
|
| 53 |
+
<p className="text-sm text-slate-400 mb-6 leading-relaxed">
|
| 54 |
+
Sorry, due to a temporary technical issue, this page could not be displayed properly. Please refresh the page or contact our support team if the problem persists.
|
| 55 |
</p>
|
| 56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
<div className="flex flex-col gap-3">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
<button
|
| 59 |
onClick={() => {
|
| 60 |
this.setState({ hasError: false, error: null });
|
| 61 |
window.location.reload();
|
| 62 |
}}
|
| 63 |
+
className="w-full bg-indigo-600 hover:bg-indigo-500 text-white font-semibold py-3 px-6 rounded-xl transition-all shadow-md shadow-indigo-600/20 border-0 cursor-pointer text-sm flex items-center justify-center gap-2"
|
| 64 |
>
|
| 65 |
+
<span className="material-symbols-outlined text-[18px]">refresh</span>
|
| 66 |
Refresh Page
|
| 67 |
</button>
|
| 68 |
+
|
| 69 |
+
<a
|
| 70 |
+
href="mailto:support@larshield.io?subject=LarShield%20System%20Issue%20Report"
|
| 71 |
+
className="w-full bg-slate-700 hover:bg-slate-600 text-slate-200 font-semibold py-2.5 px-6 rounded-xl transition-all border-0 cursor-pointer text-sm no-underline flex items-center justify-center gap-2"
|
| 72 |
+
>
|
| 73 |
+
<span className="material-symbols-outlined text-[18px]">support_agent</span>
|
| 74 |
+
Contact Support Team
|
| 75 |
+
</a>
|
| 76 |
+
|
| 77 |
<button
|
| 78 |
onClick={() => {
|
| 79 |
sessionStorage.clear();
|
|
|
|
| 81 |
localStorage.removeItem('wss_refresh_token');
|
| 82 |
window.location.href = '/login';
|
| 83 |
}}
|
| 84 |
+
className="w-full text-slate-400 hover:text-slate-200 text-xs font-medium py-1 transition-all border-0 bg-transparent cursor-pointer mt-1"
|
| 85 |
>
|
| 86 |
Clear Session & Return to Login
|
| 87 |
</button>
|