Add image upload functionality to profile page

The changes add file upload capabilities to the user profile page,
including: - File input control for selecting images - Basic image
upload handling infrastructure - Better layout with two-column design -
More robust date display

The subject line alone captures the key functional change.
This commit is contained in:
2025-08-13 10:57:32 +02:00
parent 523620be06
commit 54dbc4465d
4 changed files with 253 additions and 120 deletions

View File

@@ -1,21 +1,32 @@
<template>
<v-container
class="fill-height d-flex flex-column align-center justify-center text-center"
class="fill-height d-flex align-center justify-center text-center"
>
<v-avatar color="primary" size="170">
<img :src="data.image ? data.image : ''" :alt="data.name" />
</v-avatar>
<h3 class="mt-10">Último login:</h3>
<p>{{ data.last_login }}</p>
<h3>Username:</h3>
<p>{{ data.username }}</p>
<h3>Nombre:</h3>
<p>{{ data.name }} {{ data.last_name }}</p>
<h3>Correo:</h3>
<p>{{ data.email }}</p>
<h3>Listas:</h3>
<div class="full-height flex-column mr-5">
<v-avatar class="ma-10" color="primary" size="170">
<img :src="data.image ? data.image : ''" :alt="data.name" />
</v-avatar>
<v-file-input
accept="image/*"
label="File input"
@click="uploadImage"
@input="handleFileInput"
type="file"
/>
</div>
<div class="full-height flex-column">
<h3>Último login:</h3>
<p>{{ data?.last_login ? data.last_login : "Nunca" }}</p>
<h3>Username:</h3>
<p>{{ data.username }}</p>
<h3>Nombre:</h3>
<p>{{ data.name }} {{ data.last_name }}</p>
<h3>Correo:</h3>
<p>{{ data.email }}</p>
<h3>Listas:</h3>
<p>{{ listasStore.listas.length }}</p>
<p>{{ listasStore.listas.length }}</p>
</div>
</v-container>
</template>
@@ -29,6 +40,16 @@ import { useSystemStore } from "~/stores/system";
import { useListasStore } from "~/stores/listas";
const listasStore = useListasStore();
const systemStore = useSystemStore();
const { handleFileInput, files } = useFileStorage();
const uploadImage = async () => {
// TODO Implement image upload logic
console.log("files", files.value);
};
const openImageDialog = () => {
// TODO Implement image dialog logic
};
onMounted(async () => {
await listasStore.getData();