fix: Dashboard and NetworkServices use live domain/cell_name from ConfigContext
- Dashboard: SERVICES array (Cell Home, Calendar, Files, Webmail) now builds URLs from useConfig() domain + cell_name instead of hardcoded 'mycell.cell' - NetworkServices: imports useConfig() and cellAPI; shows current DNS zone and DHCP range in page header; fetches service_configs.network to display configured DHCP range and NTP servers alongside live operational data Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import {
|
||||
Server,
|
||||
Users,
|
||||
Shield,
|
||||
Mail,
|
||||
Calendar,
|
||||
FolderOpen,
|
||||
import {
|
||||
Server,
|
||||
Users,
|
||||
Shield,
|
||||
Mail,
|
||||
Calendar,
|
||||
FolderOpen,
|
||||
Wifi,
|
||||
Activity,
|
||||
CheckCircle,
|
||||
@@ -17,16 +17,17 @@ import {
|
||||
RotateCcw
|
||||
} from 'lucide-react';
|
||||
import { cellAPI, servicesAPI } from '../services/api';
|
||||
|
||||
const SERVICES = [
|
||||
{ name: 'Cell Home', url: 'http://mycell.cell', desc: 'Main UI — no login needed' },
|
||||
{ name: 'Calendar', url: 'http://calendar.cell', desc: 'Login: your WireGuard username' },
|
||||
{ name: 'Files', url: 'http://files.cell', desc: 'Login: admin / admin123' },
|
||||
{ name: 'Webmail', url: 'http://mail.cell', desc: 'Login: admin@rainloop.net / 12345' },
|
||||
];
|
||||
import { useConfig } from '../contexts/ConfigContext';
|
||||
|
||||
function Dashboard({ isOnline }) {
|
||||
const navigate = useNavigate();
|
||||
const { domain = 'cell', cell_name = 'mycell' } = useConfig();
|
||||
const SERVICES = [
|
||||
{ name: 'Cell Home', url: `http://${cell_name}.${domain}`, desc: 'Main UI — no login needed' },
|
||||
{ name: 'Calendar', url: `http://calendar.${domain}`, desc: 'Login: your WireGuard username' },
|
||||
{ name: 'Files', url: `http://files.${domain}`, desc: 'Login: admin / admin123' },
|
||||
{ name: 'Webmail', url: `http://mail.${domain}`, desc: 'Login: admin@rainloop.net / 12345' },
|
||||
];
|
||||
const [cellStatus, setCellStatus] = useState(null);
|
||||
const [servicesStatus, setServicesStatus] = useState(null);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
|
||||
Reference in New Issue
Block a user