Due to the volume of requests being fired, either the browser or server will introduce
some limitation somewhere that cannot easily be trapped, as a result, widgets
were being loaded inconsistently.
The way forward is to use the $.ajax timeout feature that allows requests
to be cancelled if queued up indefinitely by the browser. Due to the way this
generic new ajaxGet function is wrapped by a Promise, we don't have to add
error handling unless we wish to override it. The widget manager will take
care of failed promises both during load and during the tick routine.
* Add Ipsec Leases widget to display a list of mobile IPsec users, their online status and their IP addresses.
* Add translations to IpsecLeases Widget.
* Remove nested promises and improve error handling.
* Fix small error that userCountsRow was added twice.
* IpsecLeases fix sorting of users by online status.
* Add IpsecTunnels widget that shows the online/offline status, phase 1 description, local and remote address of each configured IPsec Tunnel.
* Create new method dataHasChanged() in IpsecLeases class, that detects if collected leases have changed. If not, the UI is not updated. Since detecting data changes should be less expensive than updating the whole UI every time, the performance should be better. The console log statements can be used to verify the functionality.
* Also track if the number of leases have changed. Lower tickTimeout to 2 seconds since only updating changed data seems very efficient. This makes the widget update almost in real time without having a big performance impact.
* Generalize dataHasChanged method to compare strings in a deep comparison instead of comparing explicit keys in a shallow comparison. Rewrite IpsecTunnels to use the same methods as IpsecLeases. Comment out console statements.
* Remove debugging statements from code.
While cloning model fields, the identifier for these new fields should also be set, which is currently being arranged in the ArrayField->add() method.
This commit makes sure we set the identifiers for one level below the array field type, which is good enough for current implementations, eventually this should be a recursive action or needs a way to push the identifiers directly on clone.
re-arrange the code a bit as well to remove the need for the $new_record array.