pixelfed/public/js/installer.js

2 lines
65 KiB
JavaScript
Raw Normal View History

2022-06-27 01:12:50 +00:00
/*! For license information please see installer.js.LICENSE.txt */
2023-01-31 06:02:21 +00:00
(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[1496],{36001:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>i});const i={data:function(){return{proceedCheck:!1}},computed:{adminUsername:{get:function(){return this.$store.state.config.admin_username},set:function(t){this.$store.commit("setConfigValue",{key:"admin_username",value:t})}},adminEmail:{get:function(){return this.$store.state.config.admin_email},set:function(t){this.$store.commit("setConfigValue",{key:"admin_email",value:t})}},adminPassword:{get:function(){return this.$store.state.config.admin_password},set:function(t){this.$store.commit("setConfigValue",{key:"admin_password",value:t})}}},watch:{$route:"init"},mounted:function(){this.init()},methods:{init:function(){void 0!==this.$store.state.config.requirements||this.$router.push("/installer")},proceed:function(){var t=this;this.proceedCheck=!0,setTimeout((function(){t.proceedCheck=!1,t.$router.push("/installer/review")}),750)}}}},18909:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>i});const i={data:function(){return{isLoaded:!1,proceedCheck:!1,step:1}},computed:{domain:{get:function(){return this.$store.state.config.domain},set:function(t){this.$store.commit("setConfigValue",{key:"domain",value:t})}},name:{get:function(){return this.$store.state.config.name},set:function(t){this.$store.commit("setConfigValue",{key:"name",value:t})}},description:{get:function(){return this.$store.state.config.description},set:function(t){this.$store.commit("setConfigValue",{key:"description",value:t})}},db_driver:{get:function(){return this.$store.state.config.db_driver},set:function(t){this.$store.commit("setConfigValue",{key:"db_driver",value:t})}},db_port:{get:function(){return this.$store.state.config.db_port},set:function(t){this.$store.commit("setConfigValue",{key:"db_port",value:t})}},db_host:{get:function(){return this.$store.state.config.db_host},set:function(t){this.$store.commit("setConfigValue",{key:"db_host",value:t})}},db_name:{get:function(){return this.$store.state.config.db_name},set:function(t){this.$store.commit("setConfigValue",{key:"db_name",value:t})}},db_username:{get:function(){return this.$store.state.config.db_username},set:function(t){this.$store.commit("setConfigValue",{key:"db_username",value:t})}},db_password:{get:function(){return this.$store.state.config.db_password},set:function(t){this.$store.commit("setConfigValue",{key:"db_password",value:t})}}},watch:{$route:"init"},mounted:function(){this.init()},methods:{init:function(){var t=this;void 0!==this.$store.state.config.requirements?(this.domain&&this.name&&this.description||(this.step=1),this.precheckDatabase(!1)&&(this.step=2),setTimeout((function(){t.isLoaded=!0}),300)):this.$router.push("/installer")},goBack:function(){1!==this.step?this.step--:this.$router.push("/installer/requirements")},checkFields:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;switch(t){case 1:if(!this.domain||!this.name||!this.description)return void this.throwNotComplete();this.step=2;break;case 2:if(!(this.db_driver&&this.db_host&&this.db_port&&this.db_name&&this.db_username&&this.db_password))return void this.throwNotComplete();this.precheckDatabase()}},proceed:function(){var t=this;switch(this.step){case 1:this.proceedCheck=!0,setTimeout((function(){t.proceedCheck=!1,t.checkFields(1)}),750);break;case 2:this.proceedCheck=!0,setTimeout((function(){t.proceedCheck=!1,t.checkFields(2)}),750)}},throwNotComplete:function(){swal("Oops!","Please fill out the fields on this page before proceeding!","warning")},precheckDatabase:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];axios.post("/installer/precheck/database",{db_driver:this.db_driver,db_host:this.db_host,db_port:this.db_port,db_user:this.db_user,db_name:this.db_name,db_username:this.db_username,db_password:this.db_password}).then((function(s){if(!e)return!0;t.proceedCheck=!0,setTimeout((function(){t.proceedCheck=!1,t.$router.push("/installer/services")}),750)})).catch((function(t){if(e){if(t.hasOwnProperty("error")){var s=t.error;if(s