mirror of
https://github.com/kaythomas0/noisedash.git
synced 2025-11-11 10:56:20 +00:00
Start dockerizing, fix app bar bugs
This commit is contained in:
6
.dockerignore
Normal file
6
.dockerignore
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
dist
|
||||||
|
log
|
||||||
|
node_modules
|
||||||
|
samples
|
||||||
|
sessions
|
||||||
|
db.sqlite3
|
||||||
10
Dockerfile
Normal file
10
Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
FROM node:14-alpine
|
||||||
|
LABEL maintainer="me@kevinthomas.dev"
|
||||||
|
WORKDIR /var/noisedash
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm install
|
||||||
|
COPY . .
|
||||||
|
ENV NODE_ENV production
|
||||||
|
RUN npm run build
|
||||||
|
EXPOSE 1432
|
||||||
|
CMD [ "node", "server/bin/www.js" ]
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"Server": {
|
"Server": {
|
||||||
"listeningPort": 3000,
|
"listeningPort": 1432,
|
||||||
"sessionFileStorePath": "sessions",
|
"sessionFileStorePath": "sessions",
|
||||||
"sampleUploadPath": "samples",
|
"sampleUploadPath": "samples",
|
||||||
"sessionSecret": "cats",
|
"sessionSecret": "cats",
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
</v-list-item-title>
|
</v-list-item-title>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
<v-list-item
|
<v-list-item
|
||||||
|
:disabled="!loggedIn"
|
||||||
@click="logout"
|
@click="logout"
|
||||||
>
|
>
|
||||||
<v-list-item-icon>
|
<v-list-item-icon>
|
||||||
@@ -54,6 +55,7 @@
|
|||||||
<v-switch
|
<v-switch
|
||||||
v-model="$vuetify.theme.dark"
|
v-model="$vuetify.theme.dark"
|
||||||
label="Dark Mode"
|
label="Dark Mode"
|
||||||
|
:disabled="!loggedIn"
|
||||||
@change="toggleDarkMode"
|
@change="toggleDarkMode"
|
||||||
/>
|
/>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ export default {
|
|||||||
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
drawyer: false,
|
drawyer: false,
|
||||||
isAdmin: false
|
isAdmin: false,
|
||||||
|
loggedIn: false
|
||||||
}),
|
}),
|
||||||
methods: {
|
methods: {
|
||||||
home () {
|
home () {
|
||||||
@@ -24,10 +25,12 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCurrentUser () {
|
getCurrentUser () {
|
||||||
|
this.loggedIn = false
|
||||||
this.drawyer = true
|
this.drawyer = true
|
||||||
this.$http.get('/users/current')
|
this.$http.get('/users/current')
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
|
this.loggedIn = true
|
||||||
this.isAdmin = response.data.user.isAdmin
|
this.isAdmin = response.data.user.isAdmin
|
||||||
this.$vuetify.theme.dark = response.data.user.darkMode
|
this.$vuetify.theme.dark = response.data.user.darkMode
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,12 +47,12 @@ router.beforeEach((to, from, next) => {
|
|||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
next('/login')
|
next('/register')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error(error.response)
|
console.error(error.response)
|
||||||
next('/login')
|
next('/register')
|
||||||
})
|
})
|
||||||
} else if (to.name === 'Admin') {
|
} else if (to.name === 'Admin') {
|
||||||
instance.get('/admin')
|
instance.get('/admin')
|
||||||
@@ -71,14 +71,14 @@ router.beforeEach((to, from, next) => {
|
|||||||
instance.get('/setup')
|
instance.get('/setup')
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (!response.data.setup) {
|
if (!response.data.setup) {
|
||||||
next('/')
|
next('/login')
|
||||||
} else {
|
} else {
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error(error.response)
|
console.error(error.response)
|
||||||
next('/')
|
next('/login')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
next()
|
next()
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ module.exports = {
|
|||||||
'vuetify'
|
'vuetify'
|
||||||
],
|
],
|
||||||
devServer: {
|
devServer: {
|
||||||
proxy: 'http://localhost:3000'
|
proxy: 'http://localhost:1432'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user