KEYCLOAK-12431 don't use user agent but patternfly

This commit is contained in:
Erik Jan de Wit 2020-01-20 16:15:46 +01:00 committed by Stan Silvert
parent 3cdfb422ad
commit d3e5bf48f0
2 changed files with 46 additions and 50 deletions

View file

@ -53,7 +53,7 @@ export class ContentPage extends React.Component<ContentPageProps> {
</Grid> </Grid>
</section> </section>
<section className="pf-c-page__main-section"> <section className="pf-c-page__main-section pf-m-no-padding-mobile">
{this.props.children} {this.props.children}
</section> </section>
</React.Fragment> </React.Fragment>

View file

@ -249,8 +249,9 @@ export class DeviceActivityPage extends React.Component<DeviceActivityPageProps,
</DataListItem> </DataListItem>
<DataListItem aria-labelledby='sessions'> <DataListItem aria-labelledby='sessions'>
<DataListItemRow>
<Grid gutter='sm'> <Grid gutter='sm'>
<GridItem span={12}/> {/* <-- top spacing */} <GridItem span={12} /> {/* <-- top spacing */}
{this.state.devices.map((device: Device, deviceIndex: number) => { {this.state.devices.map((device: Device, deviceIndex: number) => {
return ( return (
<React.Fragment> <React.Fragment>
@ -258,30 +259,24 @@ export class DeviceActivityPage extends React.Component<DeviceActivityPageProps,
return ( return (
<React.Fragment key={'device-' + deviceIndex + '-session-' + sessionIndex}> <React.Fragment key={'device-' + deviceIndex + '-session-' + sessionIndex}>
<GridItem span={3}> <GridItem md={3}>
<Stack> <Stack>
<StackItem isFilled={false}> <StackItem isFilled={false}>
<Bullseye>{this.findBrowserIcon(session)}</Bullseye> <Bullseye>{this.findBrowserIcon(session)}</Bullseye>
</StackItem> </StackItem>
{!this.state.devices[0].mobile &&
<StackItem isFilled={false}> <StackItem isFilled={false}>
<Bullseye id={this.elementId('ip', session)}>{session.ipAddress}</Bullseye> <Bullseye id={this.elementId('ip', session)}>{session.ipAddress}</Bullseye>
</StackItem> </StackItem>
}
{session.current && {session.current &&
<StackItem isFilled={false}> <StackItem isFilled={false}>
<Bullseye id={this.elementId('current-badge', session)}><strong className='pf-c-badge pf-m-read'><Msg msgKey="currentSession"/></strong></Bullseye> <Bullseye id={this.elementId('current-badge', session)}><strong className='pf-c-badge pf-m-read'><Msg msgKey="currentSession" /></strong></Bullseye>
</StackItem> </StackItem>
} }
</Stack> </Stack>
</GridItem> </GridItem>
<GridItem span={9}> <GridItem md={9}>
{!session.browser.toLowerCase().includes('unknown') && {!session.browser.toLowerCase().includes('unknown') &&
<p id={this.elementId('browser', session)}><strong>{session.browser} / {this.findOS(device)} {this.findOSVersion(device)}</strong></p> <p id={this.elementId('browser', session)}><strong>{session.browser} / {this.findOS(device)} {this.findOSVersion(device)}</strong></p>}
}
{this.state.devices[0].mobile &&
<p id={this.elementId('ip', session)}><strong>{Msg.localize('ipAddress')} </strong> {session.ipAddress}</p>
}
<p id={this.elementId('last-access', session)}><strong>{Msg.localize('lastAccessedOn')}</strong> {this.time(session.lastAccess)}</p> <p id={this.elementId('last-access', session)}><strong>{Msg.localize('lastAccessedOn')}</strong> {this.time(session.lastAccess)}</p>
<p id={this.elementId('clients', session)}><strong>{Msg.localize('clients')}</strong> {this.makeClientsString(session.clients)}</p> <p id={this.elementId('clients', session)}><strong>{Msg.localize('clients')}</strong> {this.makeClientsString(session.clients)}</p>
<p id={this.elementId('started', session)}><strong>{Msg.localize('startedAt')}</strong> {this.time(session.started)}</p> <p id={this.elementId('started', session)}><strong>{Msg.localize('startedAt')}</strong> {this.time(session.started)}</p>
@ -304,8 +299,9 @@ export class DeviceActivityPage extends React.Component<DeviceActivityPageProps,
</React.Fragment> </React.Fragment>
) )
})} })}
<GridItem span={12}/> {/* <-- bottom spacing */} <GridItem span={12} /> {/* <-- bottom spacing */}
</Grid> </Grid>
</DataListItemRow>
</DataListItem> </DataListItem>
</DataList> </DataList>
</StackItem> </StackItem>