diff --git a/src/components/LoginForm.vue b/src/components/LoginForm.vue index ea97e8a7f79afe0f2ccaeb8ad4e8835af3c7551c..8cafe669c326b7c29ff0eb0b8ee65f21a2f72da1 100644 --- a/src/components/LoginForm.vue +++ b/src/components/LoginForm.vue @@ -45,6 +45,7 @@ export default { console.log('LOGIN TOKEN OK') await localStorage.setItem('token', response.message) this.$parent.close() + this.$router.push({ name: 'Account' }) this.$router.go() } else { this.errorMessage = 'Username or password incorect' diff --git a/src/components/ModelTable.vue b/src/components/ModelTable.vue deleted file mode 100644 index 325a331e450894b1733b947afaa114d7733279c2..0000000000000000000000000000000000000000 --- a/src/components/ModelTable.vue +++ /dev/null @@ -1,67 +0,0 @@ -<template> - <b-table :data="models" :loading="isLoading" striped hoverable> - <template slot-scope="props"> - <b-table-column field="name" label="Model name" searchable sortable> - {{ props.row.name }} <b-icon v-if="props.row.isVerified" icon="check"/> - </b-table-column> - - <b-table-column field="vote" label="Votes" sortable> - {{ props.row.votes }} - </b-table-column> - - <b-table-column field="date" label="Last modification" centered sortable> - {{ new Date(props.row.lastModified).toLocaleDateString() }} - </b-table-column> - - <b-table-column field="date" label="Added" centered sortable> - {{ new Date(props.row.added).toLocaleDateString() }} - </b-table-column> - - <b-table-column label="" centered> - <b-button class="actionButton" icon-left="eye" type="is-info" tag="router-link" :to="{ name: 'Model', query: { id: props.row.id } }" outlined/> - <b-button class="actionButton" icon-left="pencil" type="is-warning" tag="router-link" :to="{ name: 'ModelEdit', params: {model: props.row} }" outlined/> - <b-button class="actionButton" icon-left="delete" type="is-danger" @click="removePrompt(props.row.id, props.row.name)" outlined/> - </b-table-column> - </template> - </b-table> -</template> - -<script> -import { api } from '@/api.js' - -export default { - name: 'ModelTable', - data () { - return { - isLoading: true, - models: [] - } - }, - async mounted () { - this.models = await api.getUserModels() - this.isLoading = false - }, - methods: { - removePrompt (id, name) { - this.$buefy.dialog.confirm({ - message: 'Delete ' + name + ' ?', - cancelText: 'Abort', - confirmText: 'Delete', - type: 'is-danger', - hasIcon: true, - onConfirm: async () => { - await api.removeModel(id) - this.$buefy.toast.open(name + ' deleted') - this.models = await api.getUserModels() - } - }) - } - } -} -</script> - -<style scoped> -.actionButton { - margin-left:8px; -} -</style> diff --git a/src/components/RegisterForm.vue b/src/components/RegisterForm.vue index 4c62020a472cf41378b0e9d6e85d69a1f4bd3aff..69896193d4392e6158380fa0ced4641765276aa5 100644 --- a/src/components/RegisterForm.vue +++ b/src/components/RegisterForm.vue @@ -56,6 +56,7 @@ export default { } else { await localStorage.setItem('token', response.message) this.$parent.close() + this.$router.push({ name: 'Account' }) this.$router.go() } }