|
|
@@ -1,4 +1,5 @@ |
|
|
|
<template> |
|
|
|
<template v-if="!loading"> |
|
|
|
<sidebar :active="active"></sidebar> |
|
|
|
<transition name="fade" mode="out-in"> |
|
|
|
<div v-if="active === ''" id="main"> |
|
|
@@ -27,7 +28,7 @@ |
|
|
|
</div> |
|
|
|
<PastOrders :orders="orders" v-else-if="active === '#orders'" id="main"> |
|
|
|
</PastOrders> |
|
|
|
<NewOrder :orders="orders" v-else-if="active === '#new-order'" id="main"> |
|
|
|
<NewOrder :token="token" v-else-if="active === '#new-order'" id="main"> |
|
|
|
</NewOrder> |
|
|
|
<div id="main" v-else-if="active === '#exit'"> |
|
|
|
<section class="logout-pane"> |
|
|
@@ -38,6 +39,7 @@ |
|
|
|
<settings :token="token" :user="user" class="settings-page" id="main" v-else-if="active === '#settings'"></settings> |
|
|
|
</transition> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import Sidebar from './sidebar.vue' |
|
|
@@ -45,6 +47,19 @@ import Settings from './settings.vue' |
|
|
|
import PastOrders from './orders.vue' |
|
|
|
import NewOrder from './services.vue' |
|
|
|
|
|
|
|
/* function getServices() { */ |
|
|
|
|
|
|
|
/* } */ |
|
|
|
/* function getServices() { */ |
|
|
|
/* fetch("/panel/services", { */ |
|
|
|
/* method: 'GET', */ |
|
|
|
/* headers: {'Content-Type': 'application/json', */ |
|
|
|
/* 'Accept': 'application/json', */ |
|
|
|
/* 'X-XSRF-TOKEN': this.token} */ |
|
|
|
/* }).then(response => { */ |
|
|
|
/* response.json().then(data => {this.services = data}) */ |
|
|
|
/* }) */ |
|
|
|
/* } */ |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
@@ -52,8 +67,18 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return {active: window.location.hash, user: '', |
|
|
|
token: '', orders: '',} |
|
|
|
token: '', orders: '', loading: true} |
|
|
|
}, |
|
|
|
methods: {}, |
|
|
|
beforeCreate() { |
|
|
|
fetch("/panel/services", { |
|
|
|
method: 'GET', |
|
|
|
headers: {'Content-Type': 'application/json', |
|
|
|
'Accept': 'application/json', |
|
|
|
'X-XSRF-TOKEN': this.token} |
|
|
|
}).then(response => { |
|
|
|
response.json().then(data => {this.services = data; this.loading = false}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |