Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show the current version in UI #624

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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