fix(ci): resolve all lint and test failures
- Go: nil-safe profile cache in SNMPCollector, updated test assertion - ESLint: fix conditional useQuery hook in SNMPMetricsSection - ESLint: remove unused CREDENTIAL_TYPE_LABELS, ChevronDown/Right, EmptyState import, advancedOpen state - TypeScript: replace empty interface with type alias Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -15,14 +15,14 @@ interface SNMPMetricsSectionProps {
|
||||
* and are shown by InterfaceGauges. Custom OID charting is Phase 20 (PROF-03).
|
||||
*/
|
||||
export function SNMPMetricsSection({ tenantId, snmpProfileId }: SNMPMetricsSectionProps) {
|
||||
if (!snmpProfileId) return null
|
||||
|
||||
const { data: profile } = useQuery({
|
||||
queryKey: ['snmp-profile', tenantId, snmpProfileId],
|
||||
queryFn: () => snmpProfilesApi.get(tenantId, snmpProfileId!),
|
||||
enabled: !!snmpProfileId,
|
||||
enabled: !!snmpProfileId && !!tenantId,
|
||||
})
|
||||
|
||||
if (!snmpProfileId) return null
|
||||
|
||||
return (
|
||||
<div className="rounded-sm border border-border-default bg-panel px-3 py-2">
|
||||
<div className="flex items-center gap-2 mb-1">
|
||||
|
||||
@@ -35,11 +35,6 @@ interface CredentialProfilesPageProps {
|
||||
type CredentialType = 'routeros' | 'snmp_v2c' | 'snmp_v3'
|
||||
type SecurityLevel = 'no_auth_no_priv' | 'auth_no_priv' | 'auth_priv'
|
||||
|
||||
const CREDENTIAL_TYPE_LABELS: Record<CredentialType, string> = {
|
||||
routeros: 'RouterOS',
|
||||
snmp_v2c: 'SNMP v2c',
|
||||
snmp_v3: 'SNMP v3',
|
||||
}
|
||||
|
||||
const SECURITY_LEVELS: { value: SecurityLevel; label: string }[] = [
|
||||
{ value: 'no_auth_no_priv', label: 'No Auth, No Privacy' },
|
||||
|
||||
@@ -10,8 +10,6 @@ import {
|
||||
X,
|
||||
Network,
|
||||
Copy,
|
||||
ChevronDown,
|
||||
ChevronRight,
|
||||
} from 'lucide-react'
|
||||
import {
|
||||
snmpProfilesApi,
|
||||
@@ -33,7 +31,6 @@ import {
|
||||
SelectValue,
|
||||
} from '@/components/ui/select'
|
||||
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs'
|
||||
import { EmptyState } from '@/components/ui/empty-state'
|
||||
import { OIDTreeBrowser } from '@/components/settings/OIDTreeBrowser'
|
||||
import { ProfileTestPanel } from '@/components/settings/ProfileTestPanel'
|
||||
|
||||
@@ -208,7 +205,6 @@ export function SNMPProfileEditorPage({ tenantId }: SNMPProfileEditorPageProps)
|
||||
const [pollGroups, setPollGroups] = useState<Record<PollGroupKey, PollGroup>>(buildEmptyPollGroups)
|
||||
const [activePollGroup, setActivePollGroup] = useState<PollGroupKey>('standard')
|
||||
const [selectedOids, setSelectedOids] = useState<Set<string>>(new Set())
|
||||
const [advancedOpen, setAdvancedOpen] = useState(false)
|
||||
|
||||
// ─── MIB state ─────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
@@ -495,7 +495,7 @@ export interface CredentialProfileCreate {
|
||||
priv_passphrase?: string
|
||||
}
|
||||
|
||||
export interface CredentialProfileUpdate extends Partial<CredentialProfileCreate> {}
|
||||
export type CredentialProfileUpdate = Partial<CredentialProfileCreate>
|
||||
|
||||
export const credentialProfilesApi = {
|
||||
list: (tenantId: string, credentialType?: string) =>
|
||||
|
||||
Reference in New Issue
Block a user