-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add logs tab (reads from redis) add info component add winston-redis-stream for temporary storage for logs * fix unit tests * lint fixes
- Loading branch information
Showing
24 changed files
with
351 additions
and
646 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
// eslint-disable-next-line no-undef | ||
module.exports = 'test-file-stub'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
// eslint-disable-next-line no-undef | ||
module.exports = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// eslint-disable-next-line no-unused-vars | ||
import React from 'react'; | ||
|
||
export default function Info({ children }) { | ||
return ( | ||
<div | ||
style={{ | ||
padding: '10px 15px', | ||
color: 'white', | ||
backgroundColor: '#3279e2', | ||
}} | ||
> | ||
{children} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// eslint-disable-next-line no-unused-vars | ||
import React from 'react'; | ||
import { useQuery } from '@apollo/client'; | ||
|
||
import SpinnerCenter from '../components/SpinnerCenter'; | ||
|
||
import { LOGS } from '../utils/queries'; | ||
import Info from '../components/Info'; | ||
|
||
import { format } from 'date-fns'; | ||
|
||
export default function PersistedQueries() { | ||
const { loading, data } = useQuery(LOGS); | ||
|
||
if (loading) { | ||
return <SpinnerCenter />; | ||
} | ||
|
||
if (!data || !data.logs.length) { | ||
return <Info>No Logs yet</Info>; | ||
} | ||
|
||
return ( | ||
<div> | ||
<Info> | ||
You can see last schema-registry logs. Useful in case of | ||
validation errors | ||
</Info> | ||
|
||
<table> | ||
{data.logs.map((row, i) => ( | ||
<tr key={i}> | ||
<td | ||
style={{ | ||
borderRight: '1px solid gray', | ||
padding: '0 10px', | ||
}} | ||
> | ||
{format(new Date(row.timestamp), 'd MMMM / HH:mm', { | ||
timeZone: 'UTC', | ||
})} | ||
</td> | ||
<td>{row.level.indexOf('error') > 0 ? '🔴' : 'ℹ️'} </td> | ||
<td> | ||
{typeof row.message === 'string' ? row.message : ''} | ||
{typeof row.message === 'object' && | ||
row.message.map((row, j) => { | ||
return ( | ||
<div key={j}> | ||
{row.message}({row.extensions.code}) | ||
</div> | ||
); | ||
})} | ||
</td> | ||
</tr> | ||
))} | ||
</table> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.