From a9b8b92ce4991741ef05ea6b7ead48d82ccd66a9 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 31 Aug 2020 16:57:13 +0200 Subject: [PATCH] Show user connection IP and date in admin Signed-off-by: Thomas Citharel --- js/src/graphql/user.ts | 4 ++++ js/src/i18n/en_US.json | 4 +++- js/src/i18n/fr_FR.json | 4 +++- js/src/types/current-user.model.ts | 4 ++++ js/src/views/Admin/AdminUserProfile.vue | 16 ++++++++++++++-- lib/graphql/schema/user.ex | 10 ++++++++++ 6 files changed, 38 insertions(+), 4 deletions(-) diff --git a/js/src/graphql/user.ts b/js/src/graphql/user.ts index 88a06d693..85c31a998 100644 --- a/js/src/graphql/user.ts +++ b/js/src/graphql/user.ts @@ -188,6 +188,10 @@ export const GET_USER = gql` email confirmedAt confirmationSentAt + lastSignInAt + lastSignInIp + currentSignInIp + currentSignInAt locale disabled defaultActor { diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index 2374a960c..fa34de2af 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -791,5 +791,7 @@ "+ Post a public message": "+ Post a public message", "A cookie is a small file containing information that is sent to your computer when you visit a website. When you visit the site again, the cookie allows that site to recognize your browser. Cookies may store user preferences and other information. You can configure your browser to refuse all cookies. However, this may result in some website features or services partially working. Local storage works the same way but allows you to store more data.": "A cookie is a small file containing information that is sent to your computer when you visit a website. When you visit the site again, the cookie allows that site to recognize your browser. Cookies may store user preferences and other information. You can configure your browser to refuse all cookies. However, this may result in some website features or services partially working. Local storage works the same way but allows you to store more data.", "A place to publish something to the whole world, your community or just your group members.": "A place to publish something to the whole world, your community or just your group members.", - "No posts found": "No posts found" + "No posts found": "No posts found", + "Last sign-in": "Last sign-in", + "Last IP adress": "Last IP adress" } diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index 6f3ebe422..28595f163 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -796,5 +796,7 @@ "+ Create an event": "+ Créer un événement", "+ Post a public message": "+ Poster un message public", "A place to publish something to the whole world, your community or just your group members.": "Un endroit pour publier quelque chose à l'intention du monde entier, de votre communauté ou simplement des membres de votre groupe.", - "No posts found": "Aucun billet trouvé" + "No posts found": "Aucun billet trouvé", + "Last sign-in": "Dernière connexion", + "Last IP adress": "Dernière addresse IP" } diff --git a/js/src/types/current-user.model.ts b/js/src/types/current-user.model.ts index 574ecd078..f8f028e24 100644 --- a/js/src/types/current-user.model.ts +++ b/js/src/types/current-user.model.ts @@ -26,6 +26,10 @@ export interface IUser extends ICurrentUser { settings: IUserSettings; locale: string; provider?: string; + lastSignInAt: string; + lastSignInIp: string; + currentSignInIp: string; + currentSignInAt: string; } export enum IAuthProvider { diff --git a/js/src/views/Admin/AdminUserProfile.vue b/js/src/views/Admin/AdminUserProfile.vue index 846751cb1..aa1b9c881 100644 --- a/js/src/views/Admin/AdminUserProfile.vue +++ b/js/src/views/Admin/AdminUserProfile.vue @@ -59,6 +59,7 @@