Breaking out the code to a script tab seems to have interacted poorly with some code. Put it in librenms.js for now to avoid issues.