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

オープン 初心者向け
#5,943 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, php
領域
frontend, web-dev

調査の方向性

forms/dialogAccount.xml と views/OPNsense/DynDNS/index.volt を読み、特に既存の optional_setting の動作を確認してください。サービス固有のフィールドに optional_hiding クラスを使えるよう、これらのファイルを更新してください。選択したプロバイダー向けに指定されたフィールドが非表示になり、その他の標準フィールドは表示されたままで、既存の optional_setting の動作も引き続き機能すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
PHP
スター
1.2k
フォーク
917
平均マージ
1日 15時間
マージ済み PR(30日)
20

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

opnsense/plugins のほかの issue

opnsense/plugins の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。