Crude UserCP deck display

This commit is contained in:
Jörn-Michael Miehe 2019-05-13 17:35:32 +02:00
parent c2f077c198
commit 3f6b91f5ca
4 changed files with 33 additions and 8 deletions

View file

@ -57,8 +57,7 @@ class FFTCGDB
logger.error err.message if err
@db.run '''INSERT INTO users VALUES(1,'jmm','$2b$13$jgDdHHDWqq1RV6PXxf7aOO6AbxqY6tbxIADyIO0FeXt2BlKQCCMzS',NULL);'''
@db.run '''INSERT INTO decks VALUES(1,1,'{"name":"frosch"}');'''
@db.run '''INSERT INTO decks VALUES(2,1,'{"name":"frosch2"}');'''
@db.run '''INSERT INTO decks VALUES(1,1,'{"name":"Antipode Bomb Version 6.0","note":"As Seen In Tournament: The North American Water Cup","cards":[{"count":1,"serial":"1-192"},{"count":2,"serial":"7-132"},{"count":2,"serial":"8-037"},{"count":2,"serial":"8-139"},{"count":1,"serial":"5-036"},{"count":3,"serial":"4-048"},{"count":1,"serial":"2-026"},{"count":3,"serial":"8-043"},{"count":3,"serial":"4-021"},{"count":3,"serial":"3-033"},{"count":1,"serial":"8-014"},{"count":2,"serial":"8-006"},{"count":1,"serial":"8-042"},{"count":1,"serial":"6-027"},{"count":3,"serial":"5-019"},{"count":2,"serial":"2-019"},{"count":2,"serial":"5-032"},{"count":3,"serial":"4-026"},{"count":3,"serial":"1-057"},{"count":1,"serial":"1-048"},{"count":2,"serial":"8-036"},{"count":3,"serial":"8-005"},{"count":3,"serial":"2-005"},{"count":1,"serial":"7-017"},{"count":1,"serial":"8-007"}]}');'''
logger.info 'OK clear'

View file

@ -0,0 +1,9 @@
import oldCards from './ffdecks.json'
let CardsDB = {}
for (var i = 0; i < oldCards.cards.length; i++) {
CardsDB[oldCards.cards[i].serial_number] = oldCards.cards[i]
}
export default CardsDB

File diff suppressed because one or more lines are too long

View file

@ -4,11 +4,23 @@
<p>user logged in: {{ user.login }}</p>
<ul>
<li v-for="deck in decks" :key="deck.id">
{{ deck.id }}: {{ deck.content.name }}
</li>
</ul>
<v-expansion-panel>
<v-expansion-panel-content v-for="deck in decks" :key="deck.id">
<template v-slot:header>
<div>{{ deck.content.name }}</div>
</template>
<v-card>
<v-card-text>
{{ deck.content.note }}
<ul>
<li v-for="card in deck.content.cards" :key="card.serial">
{{ card.serial }}: {{ cardsdb[card.serial].name }}
</li>
</ul>
</v-card-text>
</v-card>
</v-expansion-panel-content>
</v-expansion-panel>
<v-btn @click.native="logout">Logout</v-btn>
</v-container>
@ -17,6 +29,7 @@
<script>
import * as Cookies from 'js-cookie'
import axios from '@/plugins/axios'
import CardsDB from '@/plugins/ffdecks'
import Header from '@/components/Header.vue'
@ -29,7 +42,8 @@ export default {
data: () => ({
user: '',
decks: ''
decks: '',
cardsdb: null
}),
methods: {
@ -52,6 +66,8 @@ export default {
},
mounted() {
this.cardsdb = CardsDB
axios
.post('/user/info', {
session: Cookies.get('session')