Sort of! I think what's happening is that the saved global script is being executed prior to the script that's attempting to be validated (and any other global scripts too for that matter) and so if there is an issue in the previous script saving will be necessary, as it will throw the script error. This was brought to our attention in a previous thread and there is a git issue open in the global scripts' repo about it, but that repo is private.
I should have added that the HttpBuilder is adding a Content-Type: application/json header if no Content-Type is supplied, which is probably a bad behavior for a GET. I would still suggest pointing these at a Linux system with a listening netcat, though, so that you could see exactly how the HTTP requests were differing.
I was able to use that URL with a header of Content-Type: text/plain
And oddly no API key required, but that probably means there's some limiter. You may want to remove the image from your initial post, since you included your API key and where it goes.
Edit: I have made it such that in the next version no Content-Type header will be added to GET requests if missing.
Thanks for that, the PageStart variable is read in as what it should be, but seems to be overwritten when I'm reading in the Settings parameters (no matter where I put it on the page), so even when this is at the bottom of the page:
<ma-json-store xid="PageConfigXID" value="Settings"></ma-json-store><!-- page configuration data -->
The value goes from 2 to 0 with this URL: http://mango2:8080/ui/richard-overview-angular?page=2
Any idea how to make the value stick ... ?
Scratch that - I've used two repeats - if the PageStart value doesn't exists - it displays the page as normal, but if it does exist, it does sends it to the second repeat and uses that value for the calculation of where to start the page. Kinda goes against the DRY prinicipal, but works effectively ....
@richard-mortimer I believe when you did | number:1 and | number:0 was more than sufficient. alternatively just use point.value.toFixed(1) and point.value.toFixed() repectively
Thanks - the colon in the | number:1 was interfering with the ternary operator and getting it confused; so, while I could pipe it through, I couldn't modify the final number based on which direction it took - the point.value.toFixed(1) did the correct thing for me ...
The architecture seems to be ok in this way but my problem is on master side, I've no idea about how to use the returning masterControlEnabled=0 from the slave to the master in order to switch off the upgrade request from the master to the slave.
To a full list, that's a very large question! I assume you mean scripting data sources, meta points, event handlers, excel reports and such. Scripts can invoke Java code, so they can do most anything! The most authoritative documentation for the possibilities within the Mango codebase would be our Github: https://github.com/infiniteautomation/ma-core-public
I need to make some scripts verifying the last login time of some users
You have a couple options of varying complexity.
Query for user login events and check that the users in question have logged in at whatever is the appropriate time period. While there is not an events script utility yet, I have answered questions about querying the events from scripts before on the forum. for instance this thread which sends an email of the last day's DATA_POINT type event: https://forum.infiniteautomation.com/topic/3147/email-last-day-s-events
Have an event handler on user login events zero out a virtual data point that increments on some interval and has a limit detector that sends an email they've not logged in for X period of time. Since all user login events would be handled by the same event handler it will take some scripting to parse which user has logged in from the evt.message or use a no update detector on that point and set it to the login time when they login.
Put a button on a dashboard that they have to hit to zero out their time-since-active incrementing virtual point which has the limit detector, like (2), or the button updates a point with a no update detector.
Script for (2), in an event handler for user login events to get the username:
//English translation only, some other regex or string splitting if other language
var username = /User (.*?) logged in/.exec(event.message);
I'd be curious as to the other reasons, to see whether there would be valid reasons to suggest a change to this?
If you change the suffix as I suggested you will see the change anywhere that the point value is displayed, i.e. on any dashboard (without explicitly formatting it), on any report, on any email, on any built in Mango page such as Watchlists etc.
You also get the benefits that <ma-point-value> provides such as the popup Craig mentioned, the flash on change, the unreliable indicator, the event indicator and the red cross hatching when the data point is disabled etc.
Sorry for the question :)
A bug in my class caused this error.
No worries! Thanks for sharing the resolution. Sorry I didn't have the time to take a peak when this was posted. I don't generally click people's links. Better to paste the class and sample data on the forum I think.