Skip to content

Commit ec032cd

Browse files
Yerazeclaude
andauthored
feat: add rsyslog server setting to network configuration (#2410)
Add rsyslog server field to Device Configuration > Network settings, allowing users to configure remote syslog server address. Backend protobuf support already existed — this adds the UI. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fb9fdb2 commit ec032cd

File tree

3 files changed

+37
-5
lines changed

3 files changed

+37
-5
lines changed

public/locales/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2824,6 +2824,8 @@
28242824
"network_config.dns_description": "DNS server address (e.g., 8.8.8.8).",
28252825
"network_config.ntp_server": "NTP Server",
28262826
"network_config.ntp_server_description": "Custom NTP server address (default: meshtastic.pool.ntp.org). Maximum 33 characters.",
2827+
"network_config.rsyslog_server": "Rsyslog Server",
2828+
"network_config.rsyslog_server_description": "Remote syslog server address (e.g., 192.168.1.100:514). Leave blank to disable.",
28272829
"network_config.save_button": "Save Network Config",
28282830

28292831
"config.network_saved": "Network configuration saved",

src/components/ConfigurationTab.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ const ConfigurationTab: React.FC<ConfigurationTabProps> = ({ nodes, channels = [
127127
const [wifiSsid, setWifiSsid] = useState('');
128128
const [wifiPsk, setWifiPsk] = useState('');
129129
const [ntpServer, setNtpServer] = useState('');
130+
const [rsyslogServer, setRsyslogServer] = useState('');
130131
const [addressMode, setAddressMode] = useState(0);
131132
const [ipv4Address, setIpv4Address] = useState('');
132133
const [ipv4Gateway, setIpv4Gateway] = useState('');
@@ -488,6 +489,7 @@ const ConfigurationTab: React.FC<ConfigurationTabProps> = ({ nodes, channels = [
488489
setWifiSsid(config.deviceConfig.network.wifiSsid || '');
489490
setWifiPsk(config.deviceConfig.network.wifiPsk || '');
490491
setNtpServer(config.deviceConfig.network.ntpServer || '');
492+
setRsyslogServer(config.deviceConfig.network.rsyslogServer || '');
491493
setAddressMode(config.deviceConfig.network.addressMode ?? 0);
492494
// Static IP config
493495
if (config.deviceConfig.network.ipv4Config) {
@@ -1015,6 +1017,7 @@ const ConfigurationTab: React.FC<ConfigurationTabProps> = ({ nodes, channels = [
10151017
wifiSsid,
10161018
wifiPsk,
10171019
ntpServer,
1020+
rsyslogServer,
10181021
addressMode,
10191022
// Static IP config - only include if using static address mode
10201023
ipv4Config: addressMode === 1 ? {
@@ -1702,6 +1705,7 @@ const ConfigurationTab: React.FC<ConfigurationTabProps> = ({ nodes, channels = [
17021705
// Update remaining network fields
17031706
if (net.wifiPsk !== undefined) setWifiPsk(net.wifiPsk);
17041707
if (net.ntpServer !== undefined) setNtpServer(net.ntpServer);
1708+
if (net.rsyslogServer !== undefined) setRsyslogServer(net.rsyslogServer);
17051709
if (net.ipv4Config) {
17061710
if (net.ipv4Config.ip !== undefined) setIpv4Address(net.ipv4Config.ip);
17071711
if (net.ipv4Config.gateway !== undefined) setIpv4Gateway(net.ipv4Config.gateway);
@@ -2295,6 +2299,8 @@ const ConfigurationTab: React.FC<ConfigurationTabProps> = ({ nodes, channels = [
22952299
setWifiPsk={setWifiPsk}
22962300
ntpServer={ntpServer}
22972301
setNtpServer={setNtpServer}
2302+
rsyslogServer={rsyslogServer}
2303+
setRsyslogServer={setRsyslogServer}
22982304
addressMode={addressMode}
22992305
setAddressMode={setAddressMode}
23002306
ipv4Address={ipv4Address}

src/components/configuration/NetworkConfigSection.tsx

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ interface NetworkConfigSectionProps {
1717
setWifiPsk: (value: string) => void;
1818
ntpServer: string;
1919
setNtpServer: (value: string) => void;
20+
rsyslogServer: string;
21+
setRsyslogServer: (value: string) => void;
2022
addressMode: number;
2123
setAddressMode: (value: number) => void;
2224
// Static IP config
@@ -42,6 +44,8 @@ const NetworkConfigSection: React.FC<NetworkConfigSectionProps> = ({
4244
setWifiPsk,
4345
ntpServer,
4446
setNtpServer,
47+
rsyslogServer,
48+
setRsyslogServer,
4549
addressMode,
4650
setAddressMode,
4751
ipv4Address,
@@ -60,7 +64,7 @@ const NetworkConfigSection: React.FC<NetworkConfigSectionProps> = ({
6064

6165
// Track initial values for change detection
6266
const initialValuesRef = useRef({
63-
wifiEnabled, wifiSsid, wifiPsk, ntpServer, addressMode,
67+
wifiEnabled, wifiSsid, wifiPsk, ntpServer, rsyslogServer, addressMode,
6468
ipv4Address, ipv4Gateway, ipv4Subnet, ipv4Dns
6569
});
6670

@@ -72,13 +76,14 @@ const NetworkConfigSection: React.FC<NetworkConfigSectionProps> = ({
7276
wifiSsid !== initial.wifiSsid ||
7377
wifiPsk !== initial.wifiPsk ||
7478
ntpServer !== initial.ntpServer ||
79+
rsyslogServer !== initial.rsyslogServer ||
7580
addressMode !== initial.addressMode ||
7681
ipv4Address !== initial.ipv4Address ||
7782
ipv4Gateway !== initial.ipv4Gateway ||
7883
ipv4Subnet !== initial.ipv4Subnet ||
7984
ipv4Dns !== initial.ipv4Dns
8085
);
81-
}, [wifiEnabled, wifiSsid, wifiPsk, ntpServer, addressMode,
86+
}, [wifiEnabled, wifiSsid, wifiPsk, ntpServer, rsyslogServer, addressMode,
8287
ipv4Address, ipv4Gateway, ipv4Subnet, ipv4Dns]);
8388

8489
// Reset to initial values (for SaveBar dismiss)
@@ -88,22 +93,23 @@ const NetworkConfigSection: React.FC<NetworkConfigSectionProps> = ({
8893
setWifiSsid(initial.wifiSsid);
8994
setWifiPsk(initial.wifiPsk);
9095
setNtpServer(initial.ntpServer);
96+
setRsyslogServer(initial.rsyslogServer);
9197
setAddressMode(initial.addressMode);
9298
setIpv4Address(initial.ipv4Address);
9399
setIpv4Gateway(initial.ipv4Gateway);
94100
setIpv4Subnet(initial.ipv4Subnet);
95101
setIpv4Dns(initial.ipv4Dns);
96-
}, [setWifiEnabled, setWifiSsid, setWifiPsk, setNtpServer, setAddressMode,
102+
}, [setWifiEnabled, setWifiSsid, setWifiPsk, setNtpServer, setRsyslogServer, setAddressMode,
97103
setIpv4Address, setIpv4Gateway, setIpv4Subnet, setIpv4Dns]);
98104

99105
// Update initial values after successful save
100106
const handleSave = useCallback(async () => {
101107
await onSave();
102108
initialValuesRef.current = {
103-
wifiEnabled, wifiSsid, wifiPsk, ntpServer, addressMode,
109+
wifiEnabled, wifiSsid, wifiPsk, ntpServer, rsyslogServer, addressMode,
104110
ipv4Address, ipv4Gateway, ipv4Subnet, ipv4Dns
105111
};
106-
}, [onSave, wifiEnabled, wifiSsid, wifiPsk, ntpServer, addressMode,
112+
}, [onSave, wifiEnabled, wifiSsid, wifiPsk, ntpServer, rsyslogServer, addressMode,
107113
ipv4Address, ipv4Gateway, ipv4Subnet, ipv4Dns]);
108114

109115
// Register with SaveBar
@@ -326,6 +332,24 @@ const NetworkConfigSection: React.FC<NetworkConfigSectionProps> = ({
326332
style={{ width: '400px' }}
327333
/>
328334
</div>
335+
336+
{/* Rsyslog Server */}
337+
<div className="setting-item">
338+
<label htmlFor="rsyslogServer">
339+
{t('network_config.rsyslog_server')}
340+
<span className="setting-description">{t('network_config.rsyslog_server_description')}</span>
341+
</label>
342+
<input
343+
id="rsyslogServer"
344+
type="text"
345+
value={rsyslogServer}
346+
onChange={(e) => setRsyslogServer(e.target.value)}
347+
placeholder="192.168.1.100:514"
348+
maxLength={33}
349+
className="setting-input"
350+
style={{ width: '400px' }}
351+
/>
352+
</div>
329353
</div>
330354
);
331355
};

0 commit comments

Comments
 (0)