@@ -28,6 +29,7 @@
{{ item.name }}
+ {{ item.owner }}
{{ item.availability_policy }}
@@ -75,7 +77,7 @@
- Refresh
+ Refresh
Add
@@ -102,14 +104,29 @@ export default {
...BIcons
},
computed: {
- ...mapGetters(["inventory_items", "loaded_items"]),
- ...mapState(["user"]),
+ ...mapGetters(["inventory_items"]),
+ username() {
+ return this.$route.params.username
+ }
},
methods: {
- ...mapActions(["fetchInventoryItems", "deleteInventoryItem"]),
+ ...mapActions(["apiFederatedGet", "getFriends", "getFriendServer"]),
+ ...mapMutations(["setInventoryItems"]),
+ async getInventoryItems() {
+ try {
+ const servers = await this.getFriends().then(friends => friends.map(friend => this.getFriendServer({username: friend})))
+ const urls = servers.map(server => server.then(s => `http://${s}/api/inventory_items/`))
+ urls.map(url => url.then(u => this.apiFederatedGet(u).then(items => {
+ this.setInventoryItems({url: u, items})
+ }).catch(e => {
+ }))) // TODO: handle error
+ } catch (e) {
+ console.error(e)
+ }
+ },
},
async mounted() {
- await this.fetchInventoryItems()
+ await this.getInventoryItems()
}
}
diff --git a/frontend/src/views/Profile.vue b/frontend/src/views/Profile.vue
new file mode 100644
index 0000000..50ecade
--- /dev/null
+++ b/frontend/src/views/Profile.vue
@@ -0,0 +1,257 @@
+
+
+
+
+
+
Profile
+
+
+
+
+
+
+
+
+ {{ user.username }}
+
+
+ {{ user.email }}
+
+
+
+
+
+
+
+
Bio
+
+ {{ user.bio }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5m ago
+ Vanessa Tucker started following Christina
+ Mason
+ Today 7:51 pm
+
+
+
+
+
+
+
+
+
30m ago
+
Charles Hall posted something on
Christina
+ Mason 's timeline
+
Today 7:21 pm
+
+
+ Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem
+ quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam
+ nunc, blandit vel, luctus
+ pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt
+ tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis
+ ante.
+
+
+
+ Like
+
+
+
+
+
+
+
+ 1h ago
+ Christina Mason posted a new blog
+
+ Today 6:35 pm
+
+
+
+
+
+
+
+
3h ago
+
William Harris posted two photos on
Christina
+ Mason 's timeline
+
Today 5:12 pm
+
+
+
+
+ Like
+
+
+
+
+
+
+
+
1d ago
+
William Harris started following
Christina
+ Mason
+
Yesterday 3:12 pm
+
+
+
+
+
+
+
+ Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id,
+ lorem. Maecenas nec odio et ante tincidunt tempus.
+
+
+
+
+
+
+
+
+
+
+ 1d ago
+ Christina Mason posted a new blog
+ Yesterday 2:43 pm
+
+
+
+
+
+
+
+ 1d ago
+ Charles Hall started following Christina
+ Mason
+ Yesterdag 1:51 pm
+
+
+
+
+
Load more
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/views/Settings.vue b/frontend/src/views/Settings.vue
new file mode 100644
index 0000000..d143c7e
--- /dev/null
+++ b/frontend/src/views/Settings.vue
@@ -0,0 +1,209 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/vite.config.js b/frontend/vite.config.js
index c199937..ed6b2f1 100644
--- a/frontend/vite.config.js
+++ b/frontend/vite.config.js
@@ -3,6 +3,7 @@ import {fileURLToPath, URL} from 'node:url'
import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
+// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {