sipcapture / homer-app

HOMER 7.x Front-End and API Server
http://sipcapture.io
GNU Affero General Public License v3.0
204 stars 79 forks source link

Unable to select remote nodes from GUI #432

Closed jvb187 closed 3 years ago

jvb187 commented 3 years ago

I have followed the instructions for multi node setup, and I see the remote connection is successful in the docker logs, however the only node I am ever able to select is the LocalNode in the GUI.

Here is the relevant section of my config:

 "database_data": {
    "LocalNode": {
      "help": "Database settings",
      "host": "db",
      "name": "homer_data",
      "node": "LocalNode",
      "pass": "homerSeven",
      "user": "root"
    },
    "RemoteNode": {
      "help": "Remote database settings",
      "host": "192.168.240.59",
      "name": "homer_data",
      "node": "RemoteNode",
      "user": "root",
      "pass": "homerSeven"
    }

Here are the logs showing that the RemoteNode was successfully connected:

homer-webapp      | Database provisioning completed!
homer-webapp      | Successful ping: db, Type: data, Node: LocalNode 
homer-webapp      | PostgreSQL version: 11.12
homer-webapp      |  
homer-webapp      | Successful ping: 192.168.240.59, Type: data, Node: RemoteNode 
homer-webapp      |          ___              
homer-webapp      |         /__/\             
homer-webapp      |         \  \:\           
homer-webapp      |          \__\:\  
homer-webapp      |      ___ /  /::\     
homer-webapp      |     /__/\  /:/\:\     _____ _____    
homer-webapp      |     \  \:\/:/__\/    |___  |___  |   
homer-webapp      |      \  \::/            / /   / / 
homer-webapp      |       \  \:\           / /   / /          
homer-webapp      |        \  \:\         /_(_) /_/               
homer-webapp      |         \__\/         
homer-webapp      | 
homer-webapp      |  
homer-webapp      |  Version: homer-app 1.3.23 
homer-webapp      | ⇨ http server started on [::]:80

I then added Nodes to my search proto, but I am only ever able to see and choose LocalNode. Is there some other step that I am missing to have the remote nodes appear in the GUI? I am using the latest docker build (just set this up today for testing).

Thanks, Jeremy

adubovikov commented 3 years ago

can you please share your mapping for SIP call ?

adubovikov commented 3 years ago

look at this: https://github.com/sipcapture/homer-app/blob/master/migration/jsonschema/jsonschema.go#L319-L323

and activate _from_api, to retrieve the list automaticaly:

    "form_api": "/database/node/list",
jvb187 commented 3 years ago

I updated my mapping to the following:

{
        "id": "node",
        "name": "Node",
        "type": "string",
        "index": "none",
        "form_type": "multiselect",
        "form_default": [
            {
                "value": "localnode",
                "name": "Local node"
            }
        ],
        "form_api": "/database/node/list",
        "system_param": true,
        "mapping": "param.location.node",
        "position": 23,
        "skip": false,
        "hide": false
    },

I am still only seeing LocalNode in the Node selection drop down though. Is there something else I have to do to enable the node list api? When I try /api/database/node/list, I get {"message":"Not Found"}.

Thanks, Jeremy

adubovikov commented 3 years ago

rename form_default to -> "_form_default"

jvb187 commented 3 years ago

That did it.. thank you!

adubovikov commented 3 years ago

you are welcome

adubovikov commented 3 years ago

please star the main homer project as well :-)

https://github.com/sipcapture/homer/stargazers