Fetch some data when user enters some other data

I have a popup dialog like this:

Popup dialog

  • Red and green sections are editable but the blue one is read-only
  • Blue section content is fetched from the IP and port previously entered by user
  • Green section is entered by user according to the content of blue section

Now I wonder:

  • Is there a better UI/UX design for what I intend to do?
  • When to fetch Available IDs according to IP and port? For example, when users finishes editing IP and port?
  • Is it more preferable to develop a button for fetching IDs by user click?