chore(cockpit/js): clean up js code