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

Problem with selecting node in a multinode configuration #487

Closed mcebey1891 closed 1 year ago

mcebey1891 commented 1 year ago

Hi, I have a problem related to this. I followed this thread and I have the Node field with its options visible, but they appear in gray and cannot be chosen. The Node field appears in the results with the correct node names. I am using the latest Docker version of Homer7. My mapping:

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

And My configuration is:

  "database_data": {
    "ims": {
      "host": "X.X.X.X",
      "name": "homer_data",
      "node": "IMS",
      "pass": "homerSeven",
      "user": "root"
    },
    "ngn": {
      "host": "Y.Y.Y.Y",
      "name": "homer_data",
      "node": "NGN",
      "pass": "homerSeven",
      "user": "root"
    }

The result is this: Captura desde 2022-09-09 09-52-59

Thanks, Mariano

mcebey1891 commented 1 year ago

Hi, This is not a solution but it is how I have it working now. In case it helps someone, this is the code in the mapping section:

    {
        "id": "node",
        "name": "Node",
        "type": "string",
        "index": "none",
        "form_type": "multiselect",
        "form_default": [
            {
                "value": "ims",
                "disabled": false,
                "name": "IMS"
            },
            {
                "value": "ngn",
                "disabled": false,
                "name": "NGN"
            }
        ],
        "_form_api": "/database/node/list",
        "system_param": true,
        "mapping": "param.location.node",
        "position": 24,
        "skip": false,
        "hide": false
    }

Since I only have two plot sources I put them in the "form_default" section and override the "from_api" section.

lmangani commented 1 year ago

@AlexeyOplachko could you confirm if this is still an issue?

mcebey1891 commented 1 year ago

Since when adding a new site you have to add the option manually in the mapping, I understand that it is still an issue. The above is a patch that works for few sites. An extra problem is that in the configuration I named the nodes in uppercase but the filter puts them in lowercase so you have to iterate a bit so that the filter takes the values ​​accordingly.

AlexeyOplachko commented 1 year ago

Verified, in current version form_api based nodes work as expected, no "disabled" options