Files
labFusion/frontend/src/components/OfflineMode.js
GSRN d8dcca386e
Some checks failed
Frontend (React) / test (18) (push) Failing after 1m46s
Frontend (React) / test (20) (push) Failing after 1m37s
Frontend (React) / lighthouse (push) Has been skipped
Frontend (React) / build (push) Has been skipped
Docker Build and Push / build-and-push (push) Failing after 44s
Integration Tests / integration-tests (push) Failing after 2m39s
LabFusion CI/CD Pipeline / service-adapters (push) Successful in 1m7s
Integration Tests / performance-tests (push) Has been skipped
LabFusion CI/CD Pipeline / frontend (push) Successful in 8m37s
LabFusion CI/CD Pipeline / integration-tests (push) Has been skipped
LabFusion CI/CD Pipeline / api-gateway (push) Failing after 1m30s
LabFusion CI/CD Pipeline / api-docs (push) Successful in 1m46s
Frontend (React) / test (16) (push) Failing after 1m38s
fix: Refactor imports in OfflineMode, Settings, and API services
### Summary of Changes
- Removed unused imports from `OfflineMode.js` and `Settings.js` to streamline the code.
- Cleaned up the import statements in `api.js` by eliminating the unused `formatServiceData` and `formatEventData` functions.

### Expected Results
- Improved code clarity and maintainability by adhering to clean code principles and reducing unnecessary dependencies.
2025-09-16 09:04:19 +02:00

42 lines
1.2 KiB
JavaScript

import React from 'react';
import { Alert, Button, Space } from 'antd';
import { ReloadOutlined } from '@ant-design/icons';
const OfflineMode = ({ onRetry }) => {
return (
<Alert
message="Offline Mode"
description={
<div>
<p>The frontend is running in offline mode because backend services are not available.</p>
<p>To enable full functionality:</p>
<ol style={{ margin: '8px 0', paddingLeft: '20px' }}>
<li>Start the backend services: <code>docker-compose up -d</code></li>
<li>Or start individual services for development</li>
<li>Refresh this page once services are running</li>
</ol>
<Space style={{ marginTop: 12 }}>
<Button
type="primary"
icon={<ReloadOutlined />}
onClick={onRetry}
>
Retry Connection
</Button>
<Button
onClick={() => window.open('http://localhost:8083', '_blank')}
>
Check API Documentation
</Button>
</Space>
</div>
}
type="info"
showIcon
style={{ marginBottom: 16 }}
/>
);
};
export default OfflineMode;