move components where they belong
This commit is contained in:
@@ -1,45 +0,0 @@
|
||||
<template lang="pug">
|
||||
v-container
|
||||
v-card-title.d-block.text-h5.text-center(v-text="$t('setup.completed')")
|
||||
v-card-text(v-html="$t('setup.completed_description', user)")
|
||||
v-alert.mb-3.mt-1(v-if='isHttp' outlined type='warning' color='red' show-icon :icon='mdiAlert') {{$t('setup.https_warning')}}
|
||||
v-alert.mb-3.mt-1(outlined type='warning' color='red' show-icon :icon='mdiAlert') {{$t('setup.copy_password_dialog')}}
|
||||
v-card-actions
|
||||
v-btn(text @click='next' color='primary' :loading='loading' :disabled='loading') {{$t('setup.start')}}
|
||||
v-icon(v-text='mdiArrowRight')
|
||||
</template>
|
||||
<script>
|
||||
import { mdiArrowRight, mdiAlert } from '@mdi/js'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
isHttp: { type: Boolean, default: false },
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
mdiArrowRight, mdiAlert,
|
||||
loading: false,
|
||||
user: {
|
||||
email: 'admin',
|
||||
password: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
next () {
|
||||
window.location='/admin'
|
||||
},
|
||||
async start (user) {
|
||||
this.user = { ...user }
|
||||
this.loading = true
|
||||
|
||||
try {
|
||||
await this.$axios.$get('/ping')
|
||||
this.loading = false
|
||||
} catch (e) {
|
||||
setTimeout(() => this.start(user), 1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,52 +0,0 @@
|
||||
<template lang="pug">
|
||||
v-container
|
||||
v-card-title.text-h5 Database
|
||||
v-card-text
|
||||
v-form
|
||||
v-btn-toggle(text color='primary' v-model='db.dialect')
|
||||
v-btn(value='sqlite' text) sqlite
|
||||
v-btn(value='postgres' text) postgres
|
||||
v-btn(value='mariadb' text) mariadb
|
||||
template(v-if='db.dialect === "sqlite"')
|
||||
v-text-field(v-model='db.storage' label='Path')
|
||||
template(v-if='db.dialect !== "sqlite"')
|
||||
v-text-field(v-model='db.host' label='Hostname' :rules="[$validators.required('hostname')]")
|
||||
v-text-field(v-model='db.database' label='Database' :rules="[$validators.required('database')]")
|
||||
v-text-field(v-model='db.username' label='Username' :rules="[$validators.required('username')]")
|
||||
v-text-field(type='password' v-model='db.password' label='Password' :rules="[$validators.required('password')]")
|
||||
|
||||
v-card-actions
|
||||
v-btn(text @click='checkDb' color='primary' :loading='loading' :disabled='loading') {{$t('common.next')}}
|
||||
v-icon(v-text='mdiArrowRight')
|
||||
</template>
|
||||
<script>
|
||||
import { mdiArrowRight } from '@mdi/js'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
mdiArrowRight,
|
||||
db: {
|
||||
dialect: 'sqlite',
|
||||
storage: './gancio.sqlite',
|
||||
host: 'localhost',
|
||||
database: 'gancio'
|
||||
},
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async checkDb () {
|
||||
this.loading = true
|
||||
try {
|
||||
await this.$axios.$post('/setup/db', { db: this.db })
|
||||
this.$root.$message('DB Connection OK!', { color: 'success' })
|
||||
this.$emit('complete', this.db)
|
||||
} catch (e) {
|
||||
this.$root.$message(e.response.data, { color: 'error' })
|
||||
}
|
||||
this.loading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -18,9 +18,9 @@ v-container.pa-6
|
||||
Completed(ref='completed' :isHttp='isHttp')
|
||||
</template>
|
||||
<script>
|
||||
import DbStep from './DbStep'
|
||||
import Settings from '../../components/admin/Settings'
|
||||
import Completed from './Completed'
|
||||
import DbStep from '@/components/DbStep'
|
||||
import Settings from '@/components/admin/Settings'
|
||||
import Completed from '@/components/Completed'
|
||||
|
||||
export default {
|
||||
components: { DbStep, Settings, Completed },
|
||||
|
||||
Reference in New Issue
Block a user