$(function(){var c=true,b=location.href.substring(location.href.lastIndexOf("/")+1);$.log(b);var e={upgrade:{init:"UniFi Controller is being upgraded ...",starting:"Upgrading and restarting ..."},restore:{init:"UniFi Controller is being restored ...",starting:"Restoring and restarting ..."}},f=function(){$(".waiting-progress").html(e[b].starting);c=false;setTimeout(d,1E3)},d=function(){$.post("/status",function(a,g,h){a=h.status==200&&a&&a.meta&&a.meta.up;$.log("connected ? ",a);g=!c;if(c&&!a)f();
else if(g&&a)location.href="/";else setTimeout(d,1E3)})};$.jpost.fnReflectConnectionStatus=function(a){a||f()};$("h1.section-title").html(e[b].init);setTimeout(function(){$.jcmd("system",b,{},function(){d()})},1E3)});
