style: fix uptime chip style
style: reduced the dropdown border-radius from 16px to 8px only when it's open feat: scroll the table back up with a log level filter change fix: dropdown border-radius bottom was still 16px instead of 8px when opened
This commit is contained in:
parent
6177a781a6
commit
192ae0c5fb
3 changed files with 58 additions and 32 deletions
|
|
@ -3,7 +3,7 @@ import { makeStyles } from '@material-ui/core'
|
|||
import gql from 'graphql-tag'
|
||||
import moment from 'moment'
|
||||
import * as R from 'ramda'
|
||||
import React, { useState } from 'react'
|
||||
import React, { useState, useRef } from 'react'
|
||||
|
||||
import LogsDowloaderPopover from 'src/components/LogsDownloaderPopper'
|
||||
import Title from 'src/components/Title'
|
||||
|
|
@ -87,6 +87,8 @@ const SUPPORT_LOGS = gql`
|
|||
const Logs = () => {
|
||||
const classes = useStyles()
|
||||
|
||||
const tableEl = useRef()
|
||||
|
||||
const [saveMessage, setSaveMessage] = useState(null)
|
||||
const [logLevel, setLogLevel] = useState(SHOW_ALL)
|
||||
|
||||
|
|
@ -109,6 +111,12 @@ const Logs = () => {
|
|||
R.path(['serverLogs'])
|
||||
)
|
||||
|
||||
const handleLogLevelChange = logLevel => {
|
||||
if (tableEl.current) tableEl.current.scrollTo(0, 0)
|
||||
|
||||
setLogLevel(logLevel)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={classes.titleWrapper}>
|
||||
|
|
@ -141,7 +149,7 @@ const Logs = () => {
|
|||
<div className={classes.headerLine2}>
|
||||
{data && (
|
||||
<Select
|
||||
onSelectedItemChange={setLogLevel}
|
||||
onSelectedItemChange={handleLogLevelChange}
|
||||
label="Level"
|
||||
items={getLogLevels(data)}
|
||||
default={SHOW_ALL}
|
||||
|
|
@ -156,7 +164,7 @@ const Logs = () => {
|
|||
</div>
|
||||
</div>
|
||||
<div className={classes.wrapper}>
|
||||
<div className={classes.serverTableWrapper}>
|
||||
<div ref={tableEl} className={classes.serverTableWrapper}>
|
||||
<Table className={classes.table}>
|
||||
<TableHead>
|
||||
<TableRow header>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue