Giter Site home page Giter Site logo

Comments (7)

rdwebdesign avatar rdwebdesign commented on July 17, 2024

I'm not sure if this issue should be handle in the web interface or in FTL.

In v5, the first step executed by PHP is to split the input into an array of domains:

https://github.com/pi-hole/AdminLTE/blob/41682f17b72d3fb83837a7a08fa68b3e37cd35b7/scripts/pi-hole/php/groups.php#L534

In this case, the expected value for the domain field ($_POST['domain']) is a string with one or more domains separated by spaces.

The current v6 web interface doesn't use a server side code here. It sends the whole text to the API. FTL doesn't seems to take care of spaces or line breaks and the whole string is used.

from ftl.

yubiuser avatar yubiuser commented on July 17, 2024

FTL doesn't seems to take care of spaces or line breaks and the whole string is used.

Exactly, FTL expects one domain to be added per request. I think the web interface needs to iterate over the input data and split it. Can this be done in JS?

from ftl.

rdwebdesign avatar rdwebdesign commented on July 17, 2024

Can this be done in JS?

Yes, but this will send multiple API requests (one for each domain) and FTL will reload the list after each request.

I was thinking if this should be done in FTL, to handle multi-domain inputs (from web interface or command line) in a single step and reload the lists only once.

from ftl.

yubiuser avatar yubiuser commented on July 17, 2024

API requests (one for each domain) and FTL will reload the list after each request

I see the issue here. Agree, this should be handled by FTL

from ftl.

DL6ER avatar DL6ER commented on July 17, 2024

#1629 adds handling in FTL. I'm currently developing away from my test environment and am not keen to break it from remote so this PR is - so far - entirely untested (you are welcomed to do this :-) ).

This will need a subsequent web change. Sending a space-separated domain seems a dirty hack. The PR above makes FTL accept either a string or an array of strings for domains, clients, group names and lists. The web interface will need to split the input itself and send a proper array to the API in this case.

from ftl.

rdwebdesign avatar rdwebdesign commented on July 17, 2024

Sending a space-separated domain seems a dirty hack.

I never said we should do that. I just said this is how it is done in v5.


OK, now the web interface will accept a domain or a list of domains separated by spaces (maybe we could also accept line breaks). The javascript code will need to split the "domain" field and send the result as an array.

from ftl.

github-actions avatar github-actions commented on July 17, 2024

This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.

from ftl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.