github.com/argoproj/argo-cd@v1.8.7/ui/src/app/user-info/components/user-info-overview/user-info-overview.tsx (about)

     1  import * as React from 'react';
     2  
     3  import {DataLoader, Page} from '../../../shared/components';
     4  import {services} from '../../../shared/services';
     5  
     6  require('./user-info-overview.scss');
     7  
     8  export const UserInfoOverview = () => (
     9      <Page title='User Info' toolbar={{breadcrumbs: [{title: 'User Info'}]}}>
    10          <div className='user-info'>
    11              <div className='argo-container'>
    12                  <div className='user-info-overview__panel white-box'>
    13                      <DataLoader key='userInfo' load={() => services.users.get()}>
    14                          {userInfo =>
    15                              userInfo.loggedIn ? (
    16                                  <React.Fragment key='userInfoInner'>
    17                                      <p key='username'>Username: {userInfo.username}</p>
    18                                      <p key='iss'>Issuer: {userInfo.iss}</p>
    19                                      {userInfo.groups && (
    20                                          <React.Fragment key='userInfo4'>
    21                                              <p>Groups:</p>
    22                                              <ul>
    23                                                  {userInfo.groups.map(group => (
    24                                                      <li key={group}>{group}</li>
    25                                                  ))}
    26                                              </ul>
    27                                          </React.Fragment>
    28                                      )}
    29                                  </React.Fragment>
    30                              ) : (
    31                                  <p key='loggedOutMessage'>You are not logged in</p>
    32                              )
    33                          }
    34                      </DataLoader>
    35                  </div>
    36              </div>
    37          </div>
    38      </Page>
    39  );