mirror of
https://github.com/crater-invoice/crater.git
synced 2025-12-16 02:12:54 -05:00
add validation on installation wizard
This commit is contained in:
@@ -97,7 +97,6 @@
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">{{ $t('wizard.database.password') }}</label>
|
||||
<span class="text-danger"> *</span>
|
||||
<base-input
|
||||
v-model.trim="databaseData.database_password"
|
||||
type="password"
|
||||
@@ -154,7 +153,7 @@ export default {
|
||||
database_name: null,
|
||||
database_username: null,
|
||||
database_password: null,
|
||||
app_url: null
|
||||
app_url: window.location.origin
|
||||
},
|
||||
loading: false,
|
||||
connections: [
|
||||
@@ -207,8 +206,8 @@ export default {
|
||||
}
|
||||
this.loading = false
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
window.toastr['error']('Something went wrong')
|
||||
console.log(e.response)
|
||||
window.toastr['error'](e.response.data.message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<base-input
|
||||
:invalid="$v.mailConfigData.mail_password.$error"
|
||||
v-model.trim="mailConfigData.mail_password"
|
||||
type="mail_password"
|
||||
type="password"
|
||||
name="name"
|
||||
@input="$v.mailConfigData.mail_password.$touch()"
|
||||
/>
|
||||
|
||||
@@ -67,8 +67,8 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
loading: false,
|
||||
tab: 'step_1',
|
||||
step: 1
|
||||
tab: 'step_3',
|
||||
step: 3
|
||||
}
|
||||
},
|
||||
created () {
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<base-button
|
||||
v-if="requirements"
|
||||
v-if="hasNext"
|
||||
:loading="loading"
|
||||
class="pull-right mt-4"
|
||||
icon="arrow-right"
|
||||
@@ -46,7 +46,7 @@
|
||||
{{ $t('wizard.continue') }}
|
||||
</base-button>
|
||||
<base-button
|
||||
v-else
|
||||
v-if="!requirements"
|
||||
:loading="loading"
|
||||
class="pull-right mt-4"
|
||||
color="theme"
|
||||
@@ -74,6 +74,20 @@ export default {
|
||||
isShow: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
hasNext () {
|
||||
if (this.requirements) {
|
||||
let isRequired = true
|
||||
for (const key in this.requirements) {
|
||||
if (!this.requirements[key]) {
|
||||
isRequired = false
|
||||
}
|
||||
}
|
||||
return this.requirements && this.phpSupportInfo.supported && isRequired
|
||||
}
|
||||
return false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
listToggle () {
|
||||
this.isShow = !this.isShow
|
||||
|
||||
Reference in New Issue
Block a user