added optional startup script. Created dismissable alert

pull/1/head
androiddrew 7 years ago
parent 50d113dce8
commit e9e2d7cb81

@ -0,0 +1,32 @@
<template>
<div>
<b-alert variant="success"
:show="dismissSecs"
dismissible
@dismissed="dismissAlert"
@dismiss-count-down="countDownChanged">
{{ message }}. This alert will dismiss after {{dismissCountDown}} seconds...
</b-alert>
</div>
</template>
<script>
export default {
props: ['message'],
data () {
return {
dismissSecs: 5,
dismissCountDown: 5
}
},
methods: {
countDownChanged (dismissCountDown){
this.dismissCountDown = dismissCountDown
},
dismissAlert(){
this.dismissCountDown = 0
this.$emit('alert-closed')
}
}
}
</script>

@ -5,6 +5,7 @@
<h1>Books</h1>
<hr>
<br><br>
<alert :message="message" v-if="showMessage" v-on:alert-closed="showMessage = !showMessage"></alert>
<button type="button" class="btn btn-success btn-sm" v-b-modal.book-modal>Add Book</button>
<br><br>
<table class="table table-hover">
@ -79,17 +80,23 @@
<script>
import Alert from '@/components/Alert'
import { mapState, mapActions} from 'vuex'
export default {
name: 'Books',
components: {
alert: Alert,
},
data() {
return {
addBookForm: {
title: '',
author: '',
read: [],
}
},
message: '',
showMessage: false,
}
},
methods:{
@ -111,7 +118,8 @@ export default {
// this is an alternative way to call actions
// this.$store.dispatch('POST_BOOK', payload)
this.POST_BOOK(payload)
this.message = 'book added!'
this.showMessage = true
this.initForm()
},
onReset() {
@ -131,4 +139,4 @@ export default {
}
</script>
</script>

@ -0,0 +1,15 @@
import os
import subprocess
import sys
# subprocess.run('npm --version', shell=True)
#
# subprocess.check_call('node --version', shell=True)
os.chdir('./client')
if sys.platform == 'win32':
npm_proc = subprocess.Popen('start cmd.exe /k "npm run serve"', shell=True)
wsgi_proc = subprocess.Popen('start cmd.exe /k "serve.exe "', shell=True)
sys.exit(0)
else:
sys.exit(1)
Loading…
Cancel
Save