Browse Source

Finished account page

pull/8/head
astria 4 months ago
parent
commit
07bba3f72c
  1. 129
      backend/logs/access.log
  2. 30
      frontend/src/pages/Account.jsx

129
backend/logs/access.log

@ -9367,3 +9367,132 @@
[2025-08-25 16:31:35.595] [undefined] POST(/): try to post comment [2025-08-25 16:31:35.595] [undefined] POST(/): try to post comment
[2025-08-25 16:31:35.613] [undefined] POST(/): successfully post comment with status 200 [2025-08-25 16:31:35.613] [undefined] POST(/): successfully post comment with status 200
[2025-08-25 16:31:43.544] [undefined] GET(/see-later): 'See Later' playlist retrieved for user with id 1 with status 200 [2025-08-25 16:31:43.544] [undefined] GET(/see-later): 'See Later' playlist retrieved for user with id 1 with status 200
[2025-08-25 16:33:03.444] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:33:03.450] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:33:03.518] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:33:03.521] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:33:03.531] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:33:12.849] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:33:12.854] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:33:12.858] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:33:12.864] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:33:12.872] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:33:20.914] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:33:20.920] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:33:20.923] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:33:20.926] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:33:20.935] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:33:44.580] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:33:44.584] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:33:44.587] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:33:44.591] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:33:44.604] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:34:12.270] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:34:12.275] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:34:12.277] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:34:12.281] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:34:12.289] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:34:20.285] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:34:20.288] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:34:20.291] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:34:20.297] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:34:20.304] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:34:43.954] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:34:43.957] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:34:43.965] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:34:43.968] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:34:43.974] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:34:57.459] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:34:57.464] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:34:57.473] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:34:57.484] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:34:57.492] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:35:10.632] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:35:10.636] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:35:10.641] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:35:10.645] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:35:10.652] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:35:24.943] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:35:24.946] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:35:24.955] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:35:24.961] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:35:24.971] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:35:31.244] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:35:31.247] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:35:31.256] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:35:31.259] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:35:31.264] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:35:36.240] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:35:54.271] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:35:54.276] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:35:54.285] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:35:54.290] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:35:54.298] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:36:05.609] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:36:05.613] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:36:05.622] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:36:05.625] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:36:05.634] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:36:25.106] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:36:25.110] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:36:25.117] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:36:25.121] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:36:25.128] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:36:45.734] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:36:45.737] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:36:45.745] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:36:45.750] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:36:45.763] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:37:01.446] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:37:01.450] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:37:01.456] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:37:01.460] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:37:01.466] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:37:19.303] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:37:19.306] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:37:19.315] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:37:19.321] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:37:19.331] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:37:47.523] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:37:47.527] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:37:47.535] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:37:47.539] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:37:47.546] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:37:54.710] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:37:54.715] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:37:54.722] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:37:54.730] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:37:54.741] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:38:10.787] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:38:10.791] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:38:10.798] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:38:10.801] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:38:10.809] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:38:31.050] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:38:31.056] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:38:31.064] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:38:31.071] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:38:31.079] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:38:39.658] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:38:39.662] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:38:39.671] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:38:39.675] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:38:39.682] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:38:43.858] [undefined] GET(/:id): Playlist retrieved with id 1 with status 200
[2025-08-25 16:38:44.656] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:38:44.661] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:38:44.671] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:38:44.675] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:38:44.681] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:38:48.152] [undefined] GET(/:id): try to get video 1
[2025-08-25 16:38:48.157] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200
[2025-08-25 16:38:48.173] [undefined] GET(/:id): successfully get video 1 with status 200
[2025-08-25 16:38:48.241] [undefined] GET(/:id/similar): try to get similar videos for video 1
[2025-08-25 16:38:48.260] [undefined] GET(/:id/similar): successfully get similar videos for video 1 with status 200
[2025-08-25 16:38:48.293] [undefined] GET(/:id/views): try to add views for video 1
[2025-08-25 16:38:48.304] [undefined] GET(/:id/views): successfully added views for video 1 with status 200
[2025-08-25 16:38:49.367] [undefined] GET(/:id/channel): try to retrieve channel of user 1
[2025-08-25 16:38:49.370] [undefined] GET(/:id/history): try to retrieve history of user 1
[2025-08-25 16:38:49.379] [undefined] GET(/:id/channel): successfully retrieved channel of user 1 with status 200
[2025-08-25 16:38:49.382] [undefined] GET(/:id/history): successfully retrieved history of user 1 with status 200
[2025-08-25 16:38:49.422] [undefined] GET(/user/:id): Playlists retrieved for user with id 1 with status 200

30
frontend/src/pages/Account.jsx

@ -46,7 +46,7 @@ export default function Account() {
const [editMode, setEditMode] = useState(false); const [editMode, setEditMode] = useState(false);
const nonEditModeClasses = "text-2xl font-bold text-white p-2 focus:text-white focus:outline-none w-full font-montserrat"; const nonEditModeClasses = "text-lg lg:text-2xl font-bold text-white p-2 focus:text-white focus:outline-none w-full font-montserrat";
const editModeClasses = nonEditModeClasses + " glassmorphism"; const editModeClasses = nonEditModeClasses + " glassmorphism";
const handlePlaylistClick = (playlistId) => { const handlePlaylistClick = (playlistId) => {
@ -95,11 +95,11 @@ export default function Account() {
<div className="min-w-screen min-h-screen bg-linear-to-br from-left-gradient to-right-gradient"> <div className="min-w-screen min-h-screen bg-linear-to-br from-left-gradient to-right-gradient">
<Navbar isSearchPage={false} alerts={alerts} onCloseAlert={onCloseAlert} /> <Navbar isSearchPage={false} alerts={alerts} onCloseAlert={onCloseAlert} />
<main className="px-36 pt-[118px] flex justify-between items-start"> <main className="px-5 lg:px-36 pt-[48px] lg:pt-[118px] lg:flex justify-between items-start">
{/* Left side */} {/* Left side */}
{/* Profile / Edit profile */} {/* Profile / Edit profile */}
<form className="glassmorphism w-1/3 p-10"> <form className="glassmorphism lg:w-1/3 p-10">
<div className="relative w-1/3 aspect-square overflow-hidden mb-3 mx-auto" onMouseEnter={() => setIsPictureEditActive(true)} onMouseLeave={() => setIsPictureEditActive(false)} > <div className="relative w-1/3 aspect-square overflow-hidden mb-3 mx-auto" onMouseEnter={() => setIsPictureEditActive(true)} onMouseLeave={() => setIsPictureEditActive(false)} >
<label htmlFor="image"> <label htmlFor="image">
<img <img
@ -114,7 +114,7 @@ export default function Account() {
</label> </label>
<input type="file" accept="image/*" id="image" className="absolute inset-0 w-full h-full opacity-0 cursor-pointer" disabled={!editMode} /> <input type="file" accept="image/*" id="image" className="absolute inset-0 w-full h-full opacity-0 cursor-pointer" disabled={!editMode} />
</div> </div>
<label htmlFor="name" className="text-2xl text-white mb-1 block font-montserrat"> <label htmlFor="name" className="text-xl lg:text-2xl text-white mb-1 block font-montserrat">
Nom d'utilisateur Nom d'utilisateur
</label> </label>
<input <input
@ -127,7 +127,7 @@ export default function Account() {
disabled={!editMode} disabled={!editMode}
/> />
<label htmlFor="email" className="text-2xl text-white mb-1 mt-4 block font-montserrat"> <label htmlFor="email" className="text-xl lg:text-2xl text-white mb-1 mt-4 block font-montserrat">
Adresse e-mail Adresse e-mail
</label> </label>
<input <input
@ -142,7 +142,7 @@ export default function Account() {
{editMode && ( {editMode && (
<> <>
<label htmlFor="password" className="text-2xl text-white mb-1 mt-4 block font-montserrat"> <label htmlFor="password" className="text-xl lg:text-2xl text-white mb-1 mt-4 block font-montserrat">
Mot de passe Mot de passe
</label> </label>
<input <input
@ -155,7 +155,7 @@ export default function Account() {
disabled={!editMode} disabled={!editMode}
/> />
<label htmlFor="confirm-password" className="text-2xl text-white mb-1 mt-4 block font-montserrat"> <label htmlFor="confirm-password" className="text-xl lg:text-2xl text-white mb-1 mt-4 block font-montserrat">
Confirmer le mot de passe Confirmer le mot de passe
</label> </label>
<input <input
@ -178,14 +178,14 @@ export default function Account() {
<div> <div>
<button <button
type="button" type="button"
className="bg-primary p-3 rounded-sm text-white font-montserrat text-2xl font-black cursor-pointer" className="bg-primary p-3 rounded-sm text-white font-montserrat text-lg text-2xl font-black cursor-pointer"
onClick={handleUpdateUser} onClick={handleUpdateUser}
> >
Enregistrer Enregistrer
</button> </button>
<button <button
type="button" type="button"
className="bg-red-500 p-3 rounded-sm text-white font-montserrat text-2xl font-black cursor-pointer ml-3" className="bg-red-500 p-3 rounded-sm text-white font-montserrat text-lg lg:text-2xl font-bold cursor-pointer ml-3"
onClick={() => setEditMode(!editMode)} onClick={() => setEditMode(!editMode)}
> >
Annuler Annuler
@ -194,7 +194,7 @@ export default function Account() {
) : ( ) : (
<button <button
type="button" type="button"
className="bg-primary p-3 rounded-sm text-white font-montserrat text-2xl font-black cursor-pointer" className="bg-primary p-3 rounded-sm text-white font-montserrat text-lg lg:text-2xl font-bold cursor-pointer"
onClick={() => setEditMode(!editMode)} onClick={() => setEditMode(!editMode)}
> >
Modifier le profil Modifier le profil
@ -206,13 +206,13 @@ export default function Account() {
{ /* Right side */} { /* Right side */}
<div className="w-2/3 flex flex-col items-start pl-10"> <div className="lg:w-2/3 flex flex-col items-start lg:pl-10 mt-8 lg:mt-0">
{/* Channel */} {/* Channel */}
{userChannel ? ( {userChannel ? (
<div className="glassmorphism p-10 w-full flex justify-between"> <div className="glassmorphism p-10 w-full flex justify-between">
<p className="text-3xl text-white mb-2 font-montserrat font-bold">{userChannel.channel.name}</p> <p className="text-xl lg:text-3xl text-white mb-2 font-montserrat font-bold">{userChannel.channel.name}</p>
<button> <button>
<span onClick={() => navigation(`/manage-channel/${userChannel.channel.id}`)} className="bg-primary p-3 rounded-sm text-white font-montserrat text-2xl font-semibold cursor-pointer"> <span onClick={() => navigation(`/manage-channel/${userChannel.channel.id}`)} className="bg-primary p-3 rounded-sm text-white font-montserrat text-lg lg:text-2xl font-semibold cursor-pointer">
Gérer la chaîne Gérer la chaîne
</span> </span>
</button> </button>
@ -235,7 +235,7 @@ export default function Account() {
Créer une playlist Créer une playlist
</button> </button>
</div> </div>
<div className="grid grid-cols-3 gap-8 mt-8" > <div className="grid grid-cols-1 lg:grid-cols-3 gap-8 mt-8" >
{ {
userPlaylists && userPlaylists.map((playlist, index) => ( userPlaylists && userPlaylists.map((playlist, index) => (
<PlaylistCard playlist={playlist} key={index} onClick={handlePlaylistClick} /> <PlaylistCard playlist={playlist} key={index} onClick={handlePlaylistClick} />
@ -244,7 +244,7 @@ export default function Account() {
</div> </div>
{/* History */} {/* History */}
<h2 className="font-montserrat font-bold text-3xl text-white mt-10" >Historique</h2> <h2 className="font-montserrat font-bold text-3xl text-white mt-10" >Historique</h2>
<div className="grid grid-cols-3 gap-8 mt-8" > <div className="grid grid-cols-1 lg:grid-cols-3 gap-8 mt-8" >
{ {
userHistory && userHistory.map((video, index) => ( userHistory && userHistory.map((video, index) => (
<VideoCard video={video} /> <VideoCard video={video} />

Loading…
Cancel
Save