• ThomasEinasto

    Dear Mango community,

    I have updated MangoES yesterday to version 3.6.0-beta.3. This version I am failing to create a JSON store entry. So a general test on the ma-json-store is done by going to examples -> Utilities -> JSON Store.

    After opening the example I get a not-found error which is fine and should work as expected.

    Failed to load resource: the server responded with a status of 404 (Not Found) /rest/v1/json-data/test:1
    

    But after trying to save this example to JSON store ( not dashboard page but a random entry of objects ) I get an error which did not occur on previous version.

    mangoUi~ngMango~ngMangoServices.js?v=2c18dd48ed559cc129bd:78 POST http://192.168.0.119/rest/v1/json-data/test?editPermission=user&name=&publicData=false&readPermission=user 422 (Unprocessable Entity)
    
    (anonymous) @ mangoUi~ngMango~ngMangoServices.js?v=2c18dd48ed559cc129bd:78
    (anonymous) @ mangoUi~ngMango~ngMangoServices.js?v=2c18dd48ed559cc129bd:78
    (anonymous) @ mangoUi~ngMango~ngMangoServices.js?v=2c18dd48ed559cc129bd:78
    (anonymous) @ mangoUi~ngMango~ngMangoServices.js?v=2c18dd48ed559cc129bd:78
    (anonymous) @ mangoUi~ngMango~ngMangoServices.js?v=2c18dd48ed559cc129bd:78
    $digest @ mangoUi~ngMango~ngMangoServices.js?v=2c18dd48ed559cc129bd:78
    $apply @ mangoUi~ngMango~ngMangoServices.js?v=2c18dd48ed559cc129bd:78
    (anonymous) @ mangoUi~ngMango~ngMangoServices.js?v=2c18dd48ed559cc129bd:78
    dispatch @ mangoUi~ngMango~ngMangoServices.js?v=2c18dd48ed559cc129bd:39
    O.handle @ mangoUi~ngMango~ngMangoServices.js?v=2c18dd48ed559cc129bd:39
    mangoUi~ngMango~ngMangoServices.js?v=2c18dd48ed559cc129bd:78 
    
    Possibly unhandled rejection: {"data":{"xid":"test","name":"","modelType":"JSON_DATA","validationMessages":[{"level":"ERROR","message":"Required value","property":"name"}],"publicData":false,"jsonData":{"name":"Hello","phone":"5536","address":"Random address"},"readPermission":"user","editPermission":"user","id":-1},"status":422,"config":{"method":"POST","transformResponse":[null],"jsonpCallbackParam":"callback","data":{"name":"","readPermission":"user","editPermission":"user","publicData":false,"jsonData":{"name":"Hello","phone":"5536","address":"Random address"},"dataPath":null,"xid":"test"},"url":"/rest/v1/json-data/test","params":{"name":"","readPermission":"user","editPermission":"user","publicData":false},"headers":{"Accept":"application/json, text/plain, */*","X-Requested-With":"XMLHttpRequest","Content-Type":"application/json;charset=utf-8","X-XSRF-TOKEN":"7b9794fd-1330-47be-9265-e0d433554619"},"cached":false,"timeout":30000},"statusText":"Unprocessable Entity","xhrStatus":"complete","mangoStatusText":"Validation error, property ''name'' — Required value","mangoStatusTextShort":"Validation error","mangoStatusTextFirstValidationMsg":"Required value","resource":{"name":"","readPermission":"user","editPermission":"user","publicData":false,"jsonData":"...","dataPath":null,"xid":"test"}}
    

    Logged in as superadmin and using the latest Mango version.

    Can somebody comment on why I get (Unprocessable Entity) error while trying to create a JSON store entry?

    When navigated to JSON store page and trying to create a new entry there, I am successful in creating an entry there.

    Thanks,
    Thomas

    posted in User help read more
  • ThomasEinasto

    Thanks @phildunlap with your fast support once again.

    posted in User help read more
  • ThomasEinasto

    Dear guys,

    I would like to use the PID controller datasource but cant seem to find the documentation about PID controller modes states.

    There is documentation about what modes exist within this datasource but no documentation about what exact values these should be in the multi-state point 'PID Controller System Modes'.

    Maybe someone can point me to the right direction... Also there seems to be an error with PID Point properties section of documentation as this points to SSH Point properties help not PID point...

    Using: MangoES
    Version: 3.5 latest

    Thanks,
    Thomas

    posted in User help read more
  • ThomasEinasto

    As reading through the help :

    When point value changes is the default logging setting. The point value and its time of occurrence is written to the database only if the value of the point actually changes. This setting provides the best compromise of quality of historical information vs storage space efficiency. For Numeric points, a Tolerance, or "deadband", can also be provided; the value will be logged if the absolute value of the difference between the present value and the previous value equals or exceeds the given tolerance.

    I would suggest to use The When point timestamp changes setting which is similar in behaviour to the on value change setting, but the timestamp of the sample is compared instead of the value to save all triggers to Mango database.

    Thomas

    posted in User help read more
  • ThomasEinasto

    Hi @phildunlap ,

    Thanks for pointing me to the right direction. I forgot to add permissions to the newly created JSONStore. After adding permissions correctly no error is present.

    Thanks!

    Thomas

    posted in User help read more
  • ThomasEinasto

    Dear Mango Forum,

    Looking through new patch notes there is a line : Restrict json-data POST endpoint to only let users with the global Create JSON Data permission to create new entries.

    I noticed that the new UI permissions page is not updated but legacy version does have : Permission to create a JSON data entry. By default it has superadmin rights. As my user has user rights I added next to the superadmin group also an user group.

    Still having trouble creating JSONstore entities to the database with this group of users. After trying to save the entity I get following error to the browser console:

    POST http://mango-instance/rest/v1/json-data/SavedReportData-10?editPermission=&name=SavedReportData-10&publicData=false&readPermission=user 422 (Unprocessable Entity)
    
    Possibly unhandled rejection: {"data":{"xid":"SavedReportData-10","name":"SavedReportData-10","modelType":"JSON_DATA","validationMessages":[{"level":"ERROR","message":"Must have edit permission to save data","property":"editPermission"}],"publicData":false,"jsonData":{"reportNo":10,"approved":"testingstation","name":"fds","address":"dfsadfs","equipment":"dfsadf"},"readPermission":"user","editPermission":"","id":-1},"status":422,"config":{"method":"POST","transformResponse":[null],"jsonpCallbackParam":"callback","data":{"xid":"SavedReportData-10","name":"SavedReportData-10","readPermission":"user","editPermission":"","publicData":false,"jsonData":{"reportNo":10,"approved":"testingstation","name":"fds","address":"dfsadfs","equipment":"dfsadf"},"isNew":true,"dataPath":null},"url":"/rest/v1/json-data/SavedReportData-10","params":{"name":"SavedReportData-10","readPermission":"user","editPermission":"","publicData":false},"headers":{"Accept":"application/json, text/plain, */*","X-Requested-With":"XMLHttpRequest","Content-Type":"application/json;charset=utf-8","X-XSRF-TOKEN":"e09a9bb1-b155-4291-a8f5-b0a11fb8b847"},"cached":false,"timeout":30000},"statusText":"Unprocessable Entity","xhrStatus":"complete","mangoStatusText":"Validation error — Validation error","resource":{"xid":"SavedReportData-10","name":"SavedReportData-10","readPermission":"user","editPermission":"","publicData":false,"jsonData":"...","isNew":true,"dataPath":null}}
    

    Before changing the permissions the user was not allowed and had following error in console:

    POST http://mango-instance/rest/v1/json-data/SavedReportData-11?editPermission=&name=SavedReportData-11&publicData=false&readPermission=user 403 (Forbidden)
    
    Possibly unhandled rejection: {"data":{"cause":"PermissionException: User BennetGrupp does not have permission to create a JSON data entry","mangoStatusCode":4004,"mangoStatusName":"ACCESS_DENIED","localizedMessage":"User BennetGrupp does not have permission to create a JSON data entry"},"status":403,"config":{"method":"POST","transformResponse":[null],"jsonpCallbackParam":"callback","data":{"xid":"SavedReportData-11","name":"SavedReportData-11","readPermission":"user","editPermission":"","publicData":false,"jsonData":{"reportNo":11,"name":"dasdas","approved":"testingstation","address":"asdas","equipment":"dasd"},"isNew":true,"dataPath":null},"url":"/rest/v1/json-data/SavedReportData-11","params":{"name":"SavedReportData-11","readPermission":"user","editPermission":"","publicData":false},"headers":{"Accept":"application/json, text/plain, */*","X-Requested-With":"XMLHttpRequest","Content-Type":"application/json;charset=utf-8","X-XSRF-TOKEN":"e09a9bb1-b155-4291-a8f5-b0a11fb8b847"},"cached":false,"timeout":30000},"statusText":"Forbidden","xhrStatus":"complete","mangoStatusText":"User BennetGrupp does not have permission to create a JSON data entry","resource":{"xid":"SavedReportData-11","name":"SavedReportData-11","readPermission":"user","editPermission":"","publicData":false,"jsonData":"...","isNew":true,"dataPath":null}}
    

    Creating JSONstore entities with superadmin works. I would prefer not to give user admin access as permissions are quite needed :). This would be great to solve as I am using JSONStore with JSPDF, AMCharts and ma-statistics to create pdf exports of the data and all settings of these exports are in the JsonStores which the user modifies through the session.

    Mango version: Latest 3.5.0b3 updated 21.09.2018.
    Running on MangoES.
    Used browser: Chrome

    Thanks,
    Thomas

    posted in User help read more
  • ThomasEinasto

    I would also suggest searching the forum as there are many posts regarding this functionality and explanation on how to achieve this in Angular.

    Here is one.
    https://forum.infiniteautomation.com/topic/3639/ma-serial-chart-can-not-run/4

    posted in User help read more
  • ThomasEinasto

    @mattfox said

    instead and with the point attribute use: {{parseInt(point.value)}} for only one decimal place use {{ point.value.toFixed(1)}}

    Oh, you can use javascript functions inside the brackets of html ? I thought that you can only do basic math functions inside the brackets.

    Good to know @MattFox :)

    posted in How-To read more
  • ThomasEinasto

    Thats due to elements having position:absolute.

    I would suggest using flex while building your page as it would make your pages more flexible and compatible with mobile devices and smaller devices which have less pixels on screen.

    See for an example on how @Jared-Wiltshire has made the admin home page here : https://github.com/infiniteautomation/ma-dashboards/blob/main/UI/web-src/ui/views/home.html

    See these for understanding flexing

    https://material.angularjs.org/latest/layout/options
    https://material.angularjs.org/1.1.4/layout/children

    Thomas

    posted in How-To read more