From cf82684ce4ed9f8fe63b45512aafbec08705fdf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Tue, 8 Oct 2024 14:02:52 +0200 Subject: [PATCH] [feat] add displaymode setting user can choose, how users will be shown --- src/components/SettingWidget.vue | 59 ++++++++++++++++++++++++++++++++ src/index.ts | 8 +++++ src/models.ts | 9 +++++ src/pages/Settings.vue | 29 +++++++++++----- 4 files changed, 97 insertions(+), 8 deletions(-) create mode 100644 src/components/SettingWidget.vue diff --git a/src/components/SettingWidget.vue b/src/components/SettingWidget.vue new file mode 100644 index 0000000..857ecf9 --- /dev/null +++ b/src/components/SettingWidget.vue @@ -0,0 +1,59 @@ + + diff --git a/src/index.ts b/src/index.ts index 1d85f99..414d774 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,6 +16,14 @@ const plugin: FG_Plugin.Plugin = { widget: defineAsyncComponent(() => import('./components/Widget.vue')), }, ], + settingWidgets: [ + { + priority: 1, + name: 'userSettings', + permissions: [], + widget: defineAsyncComponent(() => import('./components/SettingWidget.vue')), + }, + ], }; export default plugin; diff --git a/src/models.ts b/src/models.ts index b0d9a69..013ff4d 100644 --- a/src/models.ts +++ b/src/models.ts @@ -12,3 +12,12 @@ export interface LoginResponse { export interface CurrentUserResponse extends FG.User { permissions: FG.Permission[]; } + +export enum DisplayNameMode { + FIRSTNAME = 'firstname', + LASTNAME = 'lastname', + FULLNAME = 'fullname', + DISPLAYNAME = 'display_name', + FIRSTNAME_LASTNAME = 'firstname_lastname', + LASTNAME_FIRSTNAME = 'lastname_firstname', +} diff --git a/src/pages/Settings.vue b/src/pages/Settings.vue index 22b0c5c..8030866 100644 --- a/src/pages/Settings.vue +++ b/src/pages/Settings.vue @@ -7,22 +7,23 @@ +
+ +
Aktive Sessions:
- + +