last_seen für den baruser hinzugefügt. so werden nur die leute im gerücht angezegit, welche in den letzten 72 stunden vom bardienst schulden hinzugefügt bekommen haben.
This commit is contained in:
parent
2061dfddec
commit
b97acbef14
|
@ -6,7 +6,9 @@
|
|||
Willst du wirklich??
|
||||
</v-card-title>
|
||||
<v-card-text v-if="stornoMessage">
|
||||
Willst du wirklich den Betrag {{(stornoMessage.amount/100).toFixed(2)}}€ von {{stornoMessage.user.firstname}}
|
||||
Willst du wirklich den Betrag
|
||||
{{ (stornoMessage.amount / 100).toFixed(2) }}€ von
|
||||
{{ stornoMessage.user.firstname }}
|
||||
{{ stornoMessage.user.lastname }} stornieren?
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
|
@ -69,7 +71,7 @@
|
|||
</v-list-item-group>
|
||||
</v-navigation-drawer>
|
||||
<div v-for="user in users" :key="users.indexOf(user)">
|
||||
<div v-if="isFiltered(user)">
|
||||
<div v-if="isFiltered(user) && calcLastSeen(user)">
|
||||
<v-container>
|
||||
<v-card :loading="user.loading">
|
||||
<v-card-title>
|
||||
|
@ -357,6 +359,15 @@ export default {
|
|||
' hinzugefügt.'
|
||||
}
|
||||
return text
|
||||
},
|
||||
calcLastSeen(user) {
|
||||
if (user.last_seen) {
|
||||
let date = new Date()
|
||||
if (((date - user.last_seen)/1000/60/60) < 72) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//const main = 'https://192.168.5.128:5000/'
|
||||
//const main = 'http://localhost:5000/'
|
||||
const main = 'http://192.168.5.118:5000/'
|
||||
const main = 'http://localhost:5000/'
|
||||
//const main = 'http://192.168.5.118:5000/'
|
||||
//const main = 'https://groeger-clan.duckdns.org:5000/'
|
||||
|
||||
const url = {
|
||||
|
|
|
@ -28,7 +28,9 @@ const mutations = {
|
|||
let existuser = state.users.find(a => {
|
||||
return user === a.username
|
||||
})
|
||||
|
||||
if (users[user].last_seen != null || users[user].last_seen != undefined) {
|
||||
users[user].last_seen = new Date(users[user].last_seen.year, users[user].last_seen.month -1, users[user].last_seen.day, users[user].last_seen.hour, users[user].last_seen.minute, users[user].last_seen.second)
|
||||
}
|
||||
if (existuser) {
|
||||
existuser.sername = users[user].username
|
||||
existuser.firstname = users[user].firstname
|
||||
|
@ -37,6 +39,7 @@ const mutations = {
|
|||
existuser.amount = users[user].amount
|
||||
existuser.type = users[user].type
|
||||
existuser.limit = users[user].limit
|
||||
existuser.last_seen = users[user].last_seen
|
||||
} else {
|
||||
state.users.push({
|
||||
username: users[user].username,
|
||||
|
@ -46,7 +49,8 @@ const mutations = {
|
|||
amount: users[user].amount,
|
||||
type: users[user].type,
|
||||
loading: false,
|
||||
limit: users[user].limit
|
||||
limit: users[user].limit,
|
||||
last_seen: users[user].last_seen
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -59,6 +63,8 @@ const mutations = {
|
|||
})
|
||||
)
|
||||
if (data.loading !== undefined) state.users[index].loading = data.loading
|
||||
if (data.last_seen !== undefined) state.users[index].last_seen = data.last_seen
|
||||
console.log('user', state.users[index])
|
||||
},
|
||||
sortUsers: state => {
|
||||
state.users = state.users.sort((a, b) => {
|
||||
|
@ -206,7 +212,7 @@ const actions = {
|
|||
}
|
||||
}
|
||||
try {
|
||||
commit('updateUser', { username: data.username, loading: false })
|
||||
commit('updateUser', { username: data.username, loading: false, last_seen: new Date() })
|
||||
} catch {
|
||||
// error
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue