fix(lint): resolve remaining ESLint errors (unused vars, any types, react-refresh)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* Simpler than the Standard DnsPanel: no TTL, no MX/TXT types, no advanced settings.
|
||||
*/
|
||||
|
||||
import { useState, useEffect } from 'react'
|
||||
import { useState } from 'react'
|
||||
import { Server, Globe, Plus, Pencil, Trash2 } from 'lucide-react'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Input } from '@/components/ui/input'
|
||||
|
||||
@@ -42,19 +42,26 @@ export function LanDhcpPanel({ tenantId, deviceId, active }: ConfigPanelProps) {
|
||||
const [leaseTime, setLeaseTime] = useState('')
|
||||
|
||||
// Sync from browse data
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
useEffect(() => {
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
if (lanEntry) setLanAddress(lanEntry.address ?? '')
|
||||
}, [lanEntry])
|
||||
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
useEffect(() => {
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
if (poolEntry) setPoolRange(poolEntry.ranges ?? '')
|
||||
}, [poolEntry])
|
||||
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
useEffect(() => {
|
||||
if (networkEntry) {
|
||||
/* eslint-disable react-hooks/set-state-in-effect */
|
||||
setDhcpGateway(networkEntry.gateway ?? '')
|
||||
setDhcpDns(networkEntry['dns-server'] ?? '')
|
||||
setLeaseTime(networkEntry['lease-time'] ?? '')
|
||||
/* eslint-enable react-hooks/set-state-in-effect */
|
||||
}
|
||||
}, [networkEntry])
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ export function WifiSimplePanel({ tenantId, deviceId, active, routerosVersion }:
|
||||
const [formState, setFormState] = useState<Record<string, Record<string, string>>>({})
|
||||
|
||||
// Sync form state from browse data
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
useEffect(() => {
|
||||
const newState: Record<string, Record<string, string>> = {}
|
||||
wireless.entries.forEach((entry) => {
|
||||
@@ -60,6 +61,7 @@ export function WifiSimplePanel({ tenantId, deviceId, active, routerosVersion }:
|
||||
}
|
||||
})
|
||||
if (Object.keys(newState).length > 0) {
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
setFormState((prev) => ({ ...prev, ...newState }))
|
||||
}
|
||||
}, [wireless.entries, isV7])
|
||||
|
||||
Reference in New Issue
Block a user