Skip to content

Commit

Permalink
Merge pull request #624 from PacoVK/show-version
Browse files Browse the repository at this point in the history
show the current version in UI
  • Loading branch information
PacoVK authored Sep 8, 2023
2 parents 642872a + 3835acb commit fde63f3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
3 changes: 3 additions & 0 deletions esbuild/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ esbuild
loader: {
".js": "jsx",
},
define: {
"process.env.REACT_APP_VERSION": '"v0.5.1"',
},
})
.catch(() => process.exit(1));
3 changes: 3 additions & 0 deletions esbuild/serve.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ const ctx = await esbuild.context({
entryPoints: ["frontend/index.tsx"],
minify: false,
outfile: "public/assets/app.js",
define: {
"process.env.REACT_APP_VERSION": '"development"',
},
});

await ctx.watch();
Expand Down
30 changes: 14 additions & 16 deletions frontend/components/MessageItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,21 @@ const MessageItem = (props: { data: SqsMessage }) => {
<Typography>Message Attributes</Typography>
</AccordionSummary>
<AccordionDetails>
{
{Object.entries(
// @ts-ignore
Object.entries(
JSON.parse(props.data.messageAttributes.CustomAttributes),
).map(([key, value]) => {
return (
<Box key={key}>
<Divider />
<Stack direction="row" sx={{ ml: 0 }} spacing={2}>
<Typography>Key: {key}</Typography>
<Typography>Value: {value as string}</Typography>
</Stack>
<Divider />
</Box>
);
})
}
JSON.parse(props.data.messageAttributes.CustomAttributes),
).map(([key, value]) => {
return (
<Box key={key}>
<Divider />
<Stack direction="row" sx={{ ml: 0 }} spacing={2}>
<Typography>Key: {key}</Typography>
<Typography>Value: {value as string}</Typography>
</Stack>
<Divider />
</Box>
);
})}
</AccordionDetails>
</Accordion>
) : null}
Expand Down
3 changes: 3 additions & 0 deletions frontend/views/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ const Overview = () => {
<Typography variant="h6" margin={"auto"}>
SQS Admin UI
</Typography>
<Typography variant="subtitle2" margin={"auto"}>
{process.env.REACT_APP_VERSION}
</Typography>
</ListItem>
<ListItem>
<Toolbar
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sqs-admin-ui",
"version": "0.1.0",
"version": "0.5.1",
"private": false,
"author": {
"name": "pacoVK",
Expand Down

0 comments on commit fde63f3

Please sign in to comment.