• G
    gary

    Thank you, @Jared-Wiltshire. That's excellent, I shall give that a go.

    posted in User help read more
  • G
    gary

    Hi,

    I have previous experience using AngularJS and would like some of my work to be reused. How can I register an AngularJS directive for use in a custom dashboard?

    Regards,

    Gary

    posted in User help read more
  • G
    gary

    @hrivers In my experience with the Mango API, sometimes you need to include the header 'x-xsrf-token' as well as the cookies.

    Try this modification:

    $headers = array(
    'Accept: application/json',
    'Content-Type: application/json', //multipart/form-data
    'Connection: keep-alive',
    'Cache-Control: no-cache',
    'Cookie: XSRF-TOKEN='.$xsrf_token.';MANGO8080='.$mango8080,
    'x-xsrf-token: ' . $xsrf_token             //ADDED
    );
    
    

    Gary

    posted in Dashboard Designer & Custom AngularJS Pages read more
  • G
    gary

    It sounds like this is not really a Mango related question but a web development related one.

    You probably want to use localStorage. Alternatively you could use cookies but I think you're most likely to want to use localStorage. Cookies are sent to the server with every HTTP request, which would be pointless in the case of a Mango dashboard.

    These APIs allow you to store data on the client machine for use at a later time. They have limitations and risks. The user can remove this data and it can expire when the user closes their browser or after a predefined period of time. You shouldn't store anything sensitive on the client side and when retrieving data, it should be treated with the same caution as any other input because it is easy for a malicious user to manipulate.

    Gary

    posted in Dashboard Designer & Custom AngularJS Pages read more
  • G
    gary

    Ok, thanks Joel. That's great to know. It sounds like v3 will be a big advance forward for Mango.

    posted in User help read more
  • G
    gary

    Hi,

    I am creating a system that allows the dynamic addition of monitored devices. Through the Mango API I have successfully created data sources and data points. Some of the points created should have event detectors. All event detectors are state detectors in my system.

    There doesn't seem to be any end points listed in the Swagger documentation for creating event detectors. So, how do I create event detectors using the Mango API?

    Regards,

    Gary

    posted in User help read more
  • G
    gary

    @phildunlap Thank you. I will give it a try.

    posted in User help read more
  • G
    gary

    Hi,

    Swagger shows some details of two API end points that potentially could be used. I'm not sure if I need to PUT to /rest/v1/data-sources/{XID} or POST to /rest/v1/data-sources . I have spent most time trying the PUT option as it is conceptually more appropriate but I get the same result either way.

    My attempts have been met with 500 Server Error because I have not uploaded a correctly specified JSON object. I need an explanation of the JSON schema to upload. I tried to create a copy of an existing datasource by uploading the exported JSON for the original with a modified parameter values. The format is not the same as the Swagger documentation specifies so I wasn't surprised I didn't get it to work.

    The swagger documentation doesn't make it obvious how to specify that it is a HTTP listener that I wish to create. There are parameters specific to this type that I want to set including IP white list and device ID white list.

    Can anyone fill in the gaps please?

    Thanks,

    Gary

    posted in User help read more