text: Vue.use(vuelidate.default),API("App").getConfigurations(function(e,s,r){if(!$.isEmptyObject(e)||!r||!r.body)return vue.message="It seems that the API server doesn't work properly (yet).",void $(".errors").css({fontWeight:600});vue.registry=r.body.docker_registry,vue.hostname=r.body.docker_hostname,vue.username=r.body.docker_username,vue.password=r.body.docker_password,vue.ngcEmail=r.body.ngc_email,vue.ngcPassword=r.body.ngc_password,vue.ngcKey=r.body.ngc_apikey,vue.k8sConfig=r.body.k8s_config,vue.rescaleKey=r.body.rescale_key,vue.localGPUs=r.body.local_gpus,config.set(r.body),app.refreshMenus(r.body);var o=$("#input-rescale-platform").hide().val(r.body.rescale_platform);o.formSelect(),o.closest(".form-group").fadeIn(),$(".errors").show()});var vue=new Vue({el:".form-signin",data:{registry:"",hostname:"",username:"",password:"",ngcEmail:"",ngcPassword:"",ngcKey:"",k8sConfig:"",rescaleKey:"",localGPUs:0,message:""},methods:{error:function(e){this.message=e||"The username or password is incorrect",$("#input-username").focus()},submit:function(){if(setTimeout(function(){$(".btn-primary").blur()},500),!$(".btn-primary").attr("disabled")){$(".btn-primary").attr("disabled","disabled"),$("form p.errors").show();var e=models.AccountInfo.constructFromObject({docker_registry:this.registry,docker_hostname:this.hostname,docker_username:this.username,docker_password:this.password,ngc_email:this.ngcEmail,ngc_password:this.ngcPassword,ngc_apikey:this.ngcKey,k8s_config:this.k8sConfig,rescale_platform:$("#input-rescale-platform option:selected").val(),rescale_key:this.rescaleKey});API("App").postConfigurations(e,function(e,s,r){if($(".btn-primary").removeAttr("disabled"),!$.isEmptyObject(e))return vue.error(e.response.body.message),-1<e.response.body.message.indexOf("Docker registry")&&$("#input-username").focus(),-1<e.response.body.message.indexOf("NGC Email")&&$("#input-ngc-email").focus(),void(-1<e.response.body.message.indexOf("NGC API Key")&&$("#input-ngc-key").focus());r&&r.body&&r.body.token?(auth.clear(),auth.login(r,vue.error,function(){alert("Saved successfully"),window.location.reload()})):vue.error("Invalid parameters")})}}}});$(document).ready(function(){$("#menu-system, #menu-settings").addClass("active"),$("#input-username").focus(),$(".errors").parent().show()});