move login to a separate page
This commit is contained in:
parent
1e5c3e521e
commit
f11add00d9
@ -1,35 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="min-vh-100 d-flex -align-items-stretch -justify-spcace-between">
|
|
||||||
<Sidebar />
|
|
||||||
<main class="container-fluid pt-3 pb-3">
|
|
||||||
<TopNav />
|
|
||||||
<router-view />
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
<ErrorBar />
|
<ErrorBar />
|
||||||
<Player />
|
<component :is="layout">
|
||||||
|
<router-view />
|
||||||
|
</component>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss">
|
|
||||||
main {
|
|
||||||
margin-bottom: 80px;
|
|
||||||
overflow-x: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import ErrorBar from './ErrorBar.vue'
|
import ErrorBar from './ErrorBar.vue'
|
||||||
import TopNav from './TopNav.vue'
|
import Default from '@/app/layout/Default.vue'
|
||||||
import Sidebar from './Sidebar.vue'
|
import Fullscreen from '@/app/layout/Fullscreen.vue'
|
||||||
import Player from '@/player/Player.vue'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
ErrorBar,
|
ErrorBar,
|
||||||
TopNav,
|
Default,
|
||||||
Sidebar,
|
Fullscreen,
|
||||||
Player,
|
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
layout(): string {
|
||||||
|
return (this as any).$route.meta.layout || 'Default'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
31
src/app/layout/Default.vue
Normal file
31
src/app/layout/Default.vue
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="min-vh-100 d-flex">
|
||||||
|
<Sidebar />
|
||||||
|
<main class="container-fluid pt-3 pb-3">
|
||||||
|
<TopNav />
|
||||||
|
<slot />
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
<Player />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<style lang="scss">
|
||||||
|
main {
|
||||||
|
margin-bottom: 80px;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script lang="ts">
|
||||||
|
import TopNav from '@/app/TopNav.vue'
|
||||||
|
import Sidebar from '@/app/Sidebar.vue'
|
||||||
|
import Player from '@/player/Player.vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
TopNav,
|
||||||
|
Sidebar,
|
||||||
|
Player,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
5
src/app/layout/Fullscreen.vue
Normal file
5
src/app/layout/Fullscreen.vue
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<template>
|
||||||
|
<main class="container-fluid">
|
||||||
|
<slot />
|
||||||
|
</main>
|
||||||
|
</template>
|
@ -1,6 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="row align-items-center h-100 mt-5">
|
||||||
<b-modal size="sm" hide-header hide-footer no-close-on-esc :visible="showModal">
|
<div v-if="!displayForm" class="mx-auto">
|
||||||
|
<span class="spinner-border " />
|
||||||
|
</div>
|
||||||
|
<div v-else class="mx-auto card " style="width: 22rem;">
|
||||||
|
<b-overlay rounded :show="busy" opacity="0.1">
|
||||||
|
<div class="card-body">
|
||||||
<form @submit.prevent="login">
|
<form @submit.prevent="login">
|
||||||
<div style="font-size: 4rem; color: #fff;" class="text-center">
|
<div style="font-size: 4rem; color: #fff;" class="text-center">
|
||||||
<Icon icon="person-circle" />
|
<Icon icon="person-circle" />
|
||||||
@ -20,10 +25,12 @@
|
|||||||
</template>
|
</template>
|
||||||
</b-alert>
|
</b-alert>
|
||||||
<button class="btn btn-primary btn-block" :disabled="busy" @click="login">
|
<button class="btn btn-primary btn-block" :disabled="busy" @click="login">
|
||||||
<b-spinner v-show="busy" small type="grow" /> Log in
|
<span v-show="false" class="spinner-border spinner-border-sm" /> Log in
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</b-modal>
|
</div>
|
||||||
|
</b-overlay>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>>
|
</template>>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -42,7 +49,7 @@
|
|||||||
rememberLogin: true,
|
rememberLogin: true,
|
||||||
busy: false,
|
busy: false,
|
||||||
error: null,
|
error: null,
|
||||||
showModal: false,
|
displayForm: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -52,8 +59,8 @@
|
|||||||
config: () => config
|
config: () => config
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
this.server = await this.$auth.server
|
this.server = this.$auth.server
|
||||||
this.username = await this.$auth.username
|
this.username = this.$auth.username
|
||||||
const success = await this.$auth.autoLogin()
|
const success = await this.$auth.autoLogin()
|
||||||
if (success) {
|
if (success) {
|
||||||
this.$store.commit('setLoginSuccess', {
|
this.$store.commit('setLoginSuccess', {
|
||||||
@ -62,7 +69,7 @@
|
|||||||
})
|
})
|
||||||
this.$router.replace(this.returnTo)
|
this.$router.replace(this.returnTo)
|
||||||
} else {
|
} else {
|
||||||
this.showModal = true
|
this.displayForm = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -14,9 +14,9 @@ import {
|
|||||||
BFormGroup,
|
BFormGroup,
|
||||||
BFormInput,
|
BFormInput,
|
||||||
BModal,
|
BModal,
|
||||||
|
BOverlay,
|
||||||
BProgress,
|
BProgress,
|
||||||
BSidebar,
|
BSidebar,
|
||||||
BSpinner,
|
|
||||||
DropdownPlugin,
|
DropdownPlugin,
|
||||||
} from 'bootstrap-vue'
|
} from 'bootstrap-vue'
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ Vue.component('BFormInput', BFormInput)
|
|||||||
Vue.component('BFormCheckbox', BFormCheckbox)
|
Vue.component('BFormCheckbox', BFormCheckbox)
|
||||||
Vue.component('BButton', BButton)
|
Vue.component('BButton', BButton)
|
||||||
Vue.component('BProgress', BProgress)
|
Vue.component('BProgress', BProgress)
|
||||||
Vue.component('BSpinner', BSpinner)
|
Vue.component('BOverlay', BOverlay)
|
||||||
Vue.use(DropdownPlugin)
|
Vue.use(DropdownPlugin)
|
||||||
|
|
||||||
const components = {
|
const components = {
|
||||||
|
@ -33,7 +33,10 @@ export function setupRouter(auth: AuthService) {
|
|||||||
component: Login,
|
component: Login,
|
||||||
props: (route) => ({
|
props: (route) => ({
|
||||||
returnTo: route.query.returnTo,
|
returnTo: route.query.returnTo,
|
||||||
})
|
}),
|
||||||
|
meta: {
|
||||||
|
layout: 'fullscreen'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'queue',
|
name: 'queue',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user