Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Display user identity on web gui #58

Closed
NeroBlackstone opened this issue Dec 12, 2024 · 4 comments
Closed

FR: Display user identity on web gui #58

NeroBlackstone opened this issue Dec 12, 2024 · 4 comments

Comments

@NeroBlackstone
Copy link

NeroBlackstone commented Dec 12, 2024

I hope there will be an interface showing user identity after logging in: administrator user / common user.

Thanks to the developer of this project!
If I have time, I will check how to implement it

image

@mshodge
Copy link
Contributor

mshodge commented Dec 12, 2024

Hi @NeroBlackstone this could be achieved with a small number of tweaks of the code as shown below. But not sure it's worth adding a PR just yet, so will show how I did it below.

Screenshot 2024-12-12 at 14 47 04

Line 17 in web-ui/src/app/shared/components/header/header.component.html to:

        <span class="pe-1 ms-auto fs-16">
            Hello, {{name}}
            <ng-container *ngIf="admin">(Admin)</ng-container>
        </span>

Add this under Line 9 of web-ui/src/app/shared/components/header/header.component.ts:

  @Input() admin: boolean = false;

Change this at the top of web-ui/src/app/app.component.html:

    <ml-header 
      [name]="user.display_name"
      [admin]="user.is_admin">
    </ml-header>

That should then display (Admin) after the name if the user is an admin.

@NeroBlackstone
Copy link
Author

NeroBlackstone commented Dec 12, 2024

@mshodge Hi! Amazing job! Thanks for your guide.

But not sure it's worth adding a PR just yet

Maybe wait for the main maintainer's decision (of course it would be great if this feature is added)

@kharkevich
Copy link
Member

Hi @mshodge, please go ahead with PR, I like your idea

@mshodge
Copy link
Contributor

mshodge commented Dec 13, 2024

PR here: #59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants