An online poker tracker for PokerTH (https://pokerth.net). Continuation of https://github.com/Pik-9/PokerTH-Tracker https://finda.fish
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

102 lines
2.1 KiB

<template>
<v-container>
<v-row>
<v-col>
<TablesizeChooser />
</v-col>
</v-row>
<v-row>
<v-col>
<v-data-table
:headers="headers"
:items="statData"
item-key="name"
:sort-by="['rank']"
>
<template v-slot:body.prepend>
<tr>
<td colspan=2></td>
<td>
<v-switch v-model="filterHands" :label="$t('table-filter-hands')" />
</td>
<td></td>
</tr>
</template>
</v-data-table>
</v-col>
</v-row>
</v-container>
</template>
<script>
import TablesizeChooser from '~/components/tablesize-chooser.vue';
export default {
middleware: 'auth',
components: {
TablesizeChooser,
},
computed: {
statData() {
const ret = [];
Object.entries(this.allStats).forEach(([playerName, playerStats]) => {
ret.push({
name: playerName,
verdict: playerStats.verdict,
pokerth: playerStats.pokerth,
...playerStats[this.$store.getters.tablesizeDescription],
});
});
return ret;
},
headers() {
return [
{
text: this.$t('table-pth-rank'),
value: 'pokerth.rank_pos',
},
{
text: this.$t('table-username'),
value: 'name',
},
{
text: this.$t('table-obs-hands'),
value: 'observedHands',
sortable: false,
filter: (value) => (this.filterHands ? value > 150 : true),
},
{
text: this.$t('table-verdict'),
value: 'verdict',
sortable: false,
},
];
},
},
data() {
return {
filterHands: true,
allStats: {
fullring: {},
shorthand: {},
headsup: {},
},
};
},
async mounted() {
try {
this.allStats = await this.$axios.$get('/api/table');
} catch (err) {
if (err.response.status === 401) {
this.$auth.logout();
}
}
},
};
</script>