Skip to content

Fill the domain field in Commands window #3913

@badlop

Description

@badlop

This is a minor suggestion for a small improvement.

Is your feature request related to a problem? Please describe.

This is the current behaviour:

  1. Click on the Settings icon
  2. Click on Services
  3. Converse shows a field already filled with the current domain, and its results
  4. Of course, the user can enter a different domain in the field and click the button
  5. Now click on Commands
  6. Converse shows an empty field for the user to enter some domain or JID

Describe the solution you'd like

It would be great if Converse fills the field in step 6 with the server domain, just like it already does with the field in step 3.

Describe alternatives you've considered

Right now, for my personal usage in my local test server, I simply force "localhost" like this:

diff --git a/src/plugins/adhoc-views/templates/ad-hoc.js b/src/plugins/adhoc-views/templates/ad-hoc.js
index 78b119cf1..fcb0272d6 100644
--- a/src/plugins/adhoc-views/templates/ad-hoc.js
+++ b/src/plugins/adhoc-views/templates/ad-hoc.js
@@ -18,6 +18,7 @@ export default (el) => {
     const i18n_fetch_commands = __('List available commands');
     const i18n_jid_placeholder = __('XMPP Address');
     const i18n_no_commands_found = __('No commands found');
+    const input_jid = __('localhost');
     return html`
         ${el.alert ? html`<div class="alert alert-${el.alert_type}" role="alert">${el.alert}</div>` : ''}
         ${el.note ? html`<p class="form-help">${el.note}</p>` : ''}
@@ -31,6 +32,7 @@ export default (el) => {
                         .getAutoCompleteList="${getAutoCompleteList}"
                         required
                         placeholder="${i18n_jid_placeholder}"
+                        value="${input_jid}"
                         name="jid"
                     >
                     </converse-autocomplete>

Additional context

Tested using Converse.js 12.0.0 and git master, with ejabberd git master and Chrome 143.0.7499.169.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions