[dns/ddclient] Support hiding unused standard fields per service (optional_hiding)

Abierto Apto para principiantes
#5,943 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript, php
Área
frontend, web-dev

Línea de trabajo

Lee forms/dialogAccount.xml y views/OPNsense/DynDNS/index.volt, especialmente el comportamiento actual de optional_setting. Actualiza esos archivos para admitir clases optional_hiding en campos específicos de cada servicio. El trabajo estará terminado cuando los campos marcados para un proveedor seleccionado estén ocultos, los demás campos estándar sigan visibles y el comportamiento actual de optional_setting siga funcionando.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

**Is your feature request related to a problem? Please describe.✱
During work on pull request #5935 for os-ddclient, it became obvious that several modern token-based DynDNS providers do not use standard fields like username, zone, or wildcard or even force ssl. Currently, dialogAccount.xml only supports optional_setting to show extra fields for specific services, while unused standard fields remain visible.
For example:
• DuckDNS (duckdns): Does not use username or zone (only the token in password), which frequently causes users to accidentally enter a username and break updates.
• Cloudflare (cloudflare): Leaves username blank when using API tokens.
• In an extreme case, a token-only provider (e.g. Ionos) only requires a single token field (today provided in field 'password') or update URL (today provided in field 'server') and does not use username, zone, or wildcard at all. All other fields are in fact ignored but may confuse users whether they are required for their case or not.

Describe the solution you'd like
Introduce a symmetrical opt-out mechanism (optional_hiding) in dialogAccount.xml and index.volt that mirrors the existing optional_setting pattern without adding new model fields or translation strings:

In /usr/local/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml:
<style>optional_hiding service_duckdns</style>
In /usr/local/opnsense/mvc/app/views/OPNsense/DynDNS/index.volt:

$(".optional_setting").closest("tr").hide();
$(".optional_setting.service_" + $(this).val()).closest("tr").show();

$(".optional_hiding").closest("tr").show();
$(".optional_hiding.service_" + `$(this).val()).closest("tr").hide();'

Full example: In fact this would enable to opt out all not required fields with a
<style>optional_hiding service_provider1 service_provider2 </style>:

 <field>
        <id>account.username</id>
        <label>Username</label>
        <type>text</type>
        <help>Username or login to use</help>
        <style>optional_hiding service_ionos-v4 service_ionos-v6</style>
    </field>

**Describe alternatives you've considered✱
If we want to keep the necessary changes small: N/A.
A wider scope would consider a 'full flexibility' by allowing to addcomplete new Fields and shifting eg the today 'Password' entry to a new field 'Token' but this would result in a larger architecture change of the current model which is questionable whether worth the effort

**Additional context✱
This could enhance clarity for users when configuring their dedicated service provider parameters and limit the form to exit this fields which are relevant

Lenguaje dominante
PHP
Estrellas
1.2k
Forks
917
Merge medio
1 d 15 h
PR fusionados (30 d)
20

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de opnsense/plugins

Todos los issues de opnsense/plugins

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.