This commit is contained in:
j3d1 2023-05-11 12:30:57 +02:00
parent bbbf15cfb3
commit 9381d229c5
18 changed files with 197 additions and 136 deletions

View file

@ -19,7 +19,7 @@
</tr>
</thead>
<tbody>
<tr v-for="friend in friends" :key="friend.name">
<tr v-for="friend in friendslist" :key="friend.name">
<td>{{ friend.name }}</td>
<td class="d-none d-md-table-cell">{{ friend.server.join(', ') }}</td>
<td class="table-action">
@ -34,6 +34,10 @@
</tbody>
</table>
</div>
<div class="card">
<button class="btn" @click="fetchFriends">Refresh</button>
<router-link to="/inventory/new" class="btn btn-primary">Add</router-link>
</div>
</div>
</div>
</div>
@ -54,31 +58,36 @@ export default {
},
data() {
return {
friends: [],
friends: {},
}
},
computed: {
username() {
return this.$route.params.username
},
inventory_items() {
return this.local_items.concat(this.eleon_items)
friendslist() {
return Object.keys(this.friends).map((friend) => {
return {
name: friend,
server: this.friends[friend]
}
})
}
},
methods: {
...mapActions(['getFriends', "getFriendServer"]),
},
mounted() {
this.getFriends().then((friends) => {
friends.map((friend) => {
this.getFriendServer({username: friend}).then((server) => {
this.friends.push({
name: friend,
server: server
fetchFriends() {
this.getFriends().then((friends) => {
friends.map((friend) => {
this.getFriendServer({username: friend}).then((server) => {
this.friends[friend] = server
})
})
})
})
}
},
mounted() {
this.fetchFriends()
}
}
</script>

View file

@ -12,9 +12,9 @@
<h5 class="card-title mb-0">Profile Details</h5>
</div>
<div class="card-body text-center">
<!--<img src="/static/assets/img/avatars/avatar.png"
<img src="/assets/img/avatars/avatar.png"
alt="Christina Mason" class="img-fluid rounded-circle mb-2" width="128"
height="128"/>-->
height="128"/>
<h5 class="card-title mb-0">
{{ user.username }}
</h5>
@ -94,8 +94,8 @@
<div class="card-body h-100">
<div class="d-flex align-items-start">
<!--<img src="/static/assets/img/avatars/avatar-5.png" width="36" height="36"
class="rounded-circle mr-2" alt="Vanessa Tucker">-->
<img src="/assets/img/avatars/avatar-5.png" width="36" height="36"
class="rounded-circle mr-2" alt="Vanessa Tucker">
<div class="flex-grow-1">
<small class="float-right text-navy">5m ago</small>
<strong>Vanessa Tucker</strong> started following <strong>Christina
@ -107,8 +107,8 @@
<hr/>
<div class="d-flex align-items-start">
<!--<img src="/static/assets/img/avatars/avatar.png" width="36" height="36"
class="rounded-circle mr-2" alt="Charles Hall">-->
<img src="/assets/img/avatars/avatar.png" width="36" height="36"
class="rounded-circle mr-2" alt="Charles Hall">
<div class="flex-grow-1">
<small class="float-right text-navy">30m ago</small>
<strong>Charles Hall</strong> posted something on <strong>Christina
@ -132,8 +132,8 @@
<hr/>
<div class="d-flex align-items-start">
<!--<img src="/static/assets/img/avatars/avatar-4.png" width="36" height="36"
class="rounded-circle mr-2" alt="Christina Mason">-->
<img src="/assets/img/avatars/avatar-4.png" width="36" height="36"
class="rounded-circle mr-2" alt="Christina Mason">
<div class="flex-grow-1">
<small class="float-right text-navy">1h ago</small>
<strong>Christina Mason</strong> posted a new blog<br/>
@ -144,8 +144,8 @@
<hr/>
<div class="d-flex align-items-start">
<!--<img src="/static/assets/img/avatars/avatar-2.png" width="36" height="36"
class="rounded-circle mr-2" alt="William Harris">-->
<img src="/assets/img/avatars/avatar-2.png" width="36" height="36"
class="rounded-circle mr-2" alt="William Harris">
<div class="flex-grow-1">
<small class="float-right text-navy">3h ago</small>
<strong>William Harris</strong> posted two photos on <strong>Christina
@ -154,12 +154,12 @@
<div class="row g-0 mt-1">
<div class="col-6 col-md-4 col-lg-4 col-xl-3">
<!--<img src="/static/assets/img/photos/unsplash-1.jpg"
class="img-fluid pr-2" alt="Unsplash">-->
<img src="/assets/img/photos/unsplash-1.jpg"
class="img-fluid pr-2" alt="Unsplash">
</div>
<div class="col-6 col-md-4 col-lg-4 col-xl-3">
<!--<img src="/static/assets/img/photos/unsplash-2.jpg"
class="img-fluid pr-2" alt="Unsplash">-->
<img src="/assets/img/photos/unsplash-2.jpg"
class="img-fluid pr-2" alt="Unsplash">
</div>
</div>
@ -171,8 +171,8 @@
<hr/>
<div class="d-flex align-items-start">
<!--<img src="/static/assets/img/avatars/avatar-2.png" width="36" height="36"
class="rounded-circle mr-2" alt="William Harris">-->
<img src="/assets/img/avatars/avatar-2.png" width="36" height="36"
class="rounded-circle mr-2" alt="William Harris">
<div class="flex-grow-1">
<small class="float-right text-navy">1d ago</small>
<strong>William Harris</strong> started following <strong>Christina
@ -181,8 +181,8 @@
<div class="d-flex align-items-start mt-1">
<a class="pr-3" href="#">
<!--<img src="/static/assets/img/avatars/avatar-4.png" width="36"
height="36" class="rounded-circle mr-2" alt="Christina Mason">-->
<img src="/assets/img/avatars/avatar-4.png" width="36"
height="36" class="rounded-circle mr-2" alt="Christina Mason">
</a>
<div class="flex-grow-1">
<div class="border text-sm text-muted p-2 mt-1">
@ -196,8 +196,8 @@
<hr/>
<div class="d-flex align-items-start">
<!--<img src="/static/assets/img/avatars/avatar-4.png" width="36" height="36"
class="rounded-circle mr-2" alt="Christina Mason">-->
<img src="/assets/img/avatars/avatar-4.png" width="36" height="36"
class="rounded-circle mr-2" alt="Christina Mason">
<div class="flex-grow-1">
<small class="float-right text-navy">1d ago</small>
<strong>Christina Mason</strong> posted a new blog<br/>
@ -207,8 +207,8 @@
<hr/>
<div class="d-flex align-items-start">
<!--<img src="/static/assets/img/avatars/avatar.png" width="36" height="36"
class="rounded-circle mr-2" alt="Charles Hall">-->
<img src="/assets/img/avatars/avatar.png" width="36" height="36"
class="rounded-circle mr-2" alt="Charles Hall">
<div class="flex-grow-1">
<small class="float-right text-navy">1d ago</small>
<strong>Charles Hall</strong> started following <strong>Christina
@ -223,7 +223,6 @@
</div>
</div>
</div>
</div>
</main>
</BaseLayout>

View file

@ -79,7 +79,7 @@
<div class="col-md-4">
<div class="text-center">
<img alt="Charles Hall"
src="/static/assets/img/avatars/avatar.png"
src="/assets/img/avatars/avatar.png"
class="rounded-circle img-responsive mt-2" width="128"
height="128"/>
<div class="mt-2">