diff --git a/frontend/src/components/settings/CredentialProfilesPage.tsx b/frontend/src/components/settings/CredentialProfilesPage.tsx index 7a3bb19..cbfd955 100644 --- a/frontend/src/components/settings/CredentialProfilesPage.tsx +++ b/frontend/src/components/settings/CredentialProfilesPage.tsx @@ -119,7 +119,7 @@ export function CredentialProfilesPage({ tenantId }: CredentialProfilesPageProps enabled: !!tenantId, }) - const profiles = data?.profiles ?? [] + const profiles = Array.isArray(data) ? data : (data?.profiles ?? []) const routerosProfiles = profiles.filter((p) => p.credential_type === 'routeros') const snmpProfiles = profiles.filter((p) => p.credential_type.startsWith('snmp_')) @@ -401,8 +401,8 @@ export function CredentialProfilesPage({ tenantId }: CredentialProfilesPageProps
updateForm({ security_name: e.target.value })} + value={form.username ?? ''} + onChange={(e) => updateForm({ username: e.target.value })} placeholder={ editingProfile ? 'Leave blank to keep current' : 'snmpuser' } @@ -473,8 +473,8 @@ export function CredentialProfilesPage({ tenantId }: CredentialProfilesPageProps
- updateForm({ privacy_passphrase: e.target.value }) + updateForm({ priv_passphrase: e.target.value }) } placeholder={ editingProfile ? 'Leave blank to keep current' : '' diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index 2644ef8..af34c96 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -491,9 +491,8 @@ export interface CredentialProfileCreate { security_level?: string auth_protocol?: string auth_passphrase?: string - privacy_protocol?: string - privacy_passphrase?: string - security_name?: string + priv_protocol?: string + priv_passphrase?: string } export interface CredentialProfileUpdate extends Partial {} @@ -505,7 +504,7 @@ export const credentialProfilesApi = { `/api/tenants/${tenantId}/credential-profiles`, { params: credentialType ? { credential_type: credentialType } : undefined }, ) - .then((r) => r.data), + .then((r) => r.data.profiles), get: (tenantId: string, profileId: string) => api