-
-
Notifications
You must be signed in to change notification settings - Fork 83
Enhance UI #468
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
Closed
+107
−57
Closed
Enhance UI #468
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d5a45da
Update container metadata card UI and overview tab
Yasir761 a9cf1d0
fix: update ContainerMetadataCard title, fix mounts type, remove dead…
Yasir761 851eb26
fix: add i18n for container metadata and remove duplicate fields
Yasir761 459e420
fix: remove the duplicate key as suggested
Yasir761 456e5d0
Merge branch 'master' into enhance-ui
zhravan 527204f
chore: auto labels based on issue templates (#498)
Raj-G07 de833f9
Merge branch 'feat/develop' into enhance-ui
zhravan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
76 changes: 76 additions & 0 deletions
76
view/app/containers/[id]/components/ContainerMetadataCard.tsx
This file contains hidden or 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,76 @@ | ||
| import React from 'react'; | ||
| import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card'; | ||
| import { Badge } from '@/components/ui/badge'; | ||
| import { Info } from 'lucide-react'; | ||
| import { formatDistanceToNow } from 'date-fns'; | ||
| import { Container } from '@/redux/services/container/containerApi'; | ||
| import { useTranslation } from '@/hooks/use-translation'; | ||
|
|
||
| interface ContainerMetadataCardProps { | ||
| container: Container; | ||
| } | ||
|
|
||
| export function ContainerMetadataCard({ container }: ContainerMetadataCardProps) { | ||
| const { t } = useTranslation(); | ||
|
|
||
| return ( | ||
| <Card className="w-full rounded-lg shadow-md border border-gray-200"> | ||
| <CardHeader> | ||
| <CardTitle className="flex items-center gap-2 text-lg"> | ||
| <Info className="h-5 w-5" /> | ||
| {t('containers.metadata.title')} | ||
| </CardTitle> | ||
| </CardHeader> | ||
|
|
||
| <CardContent className="grid grid-cols-1 sm:grid-cols-2 gap-3"> | ||
| {/* Container ID */} | ||
| <div className="flex justify-between items-center"> | ||
| <span className="text-sm text-muted-foreground font-medium"> | ||
| {t('containers.metadata.id')} | ||
| </span> | ||
| <span className="text-sm font-mono truncate">{container.id}</span> | ||
| </div> | ||
|
|
||
| {/* Image */} | ||
| <div className="flex justify-between items-center"> | ||
| <span className="text-sm text-muted-foreground font-medium"> | ||
| {t('containers.metadata.image')} | ||
| </span> | ||
| <span className="text-sm font-mono truncate">{container.image}</span> | ||
| </div> | ||
|
|
||
| {/* Mounts */} | ||
| {container?.mounts?.length > 0 && ( | ||
| <div className="col-span-1 sm:col-span-2"> | ||
| <span className="text-sm text-muted-foreground font-medium"> | ||
| {t('containers.metadata.mounts')} | ||
| </span> | ||
| <ul className="list-disc ml-4 mt-1 text-sm font-mono"> | ||
| {container.mounts.map((mount, idx) => ( | ||
| <li key={idx}> | ||
| {mount.source} → {mount.destination} | ||
| </li> | ||
| ))} | ||
| </ul> | ||
| </div> | ||
| )} | ||
|
|
||
| {/* Labels */} | ||
| {Object.keys(container.labels ?? {}).length > 0 && ( | ||
| <div className="col-span-1 sm:col-span-2"> | ||
| <span className="text-sm text-muted-foreground font-medium"> | ||
| {t('containers.metadata.labels')} | ||
| </span> | ||
| <div className="flex flex-wrap gap-2 mt-1"> | ||
| {Object.entries(container.labels).map(([key, value]) => ( | ||
| <Badge key={key} variant="outline"> | ||
| {key}: {value} | ||
| </Badge> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| )} | ||
| </CardContent> | ||
| </Card> | ||
| ); | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid duplicating Overview content.
ContainerMetadataCardrepeats Status, Created, Command, and Ports that are already rendered by the four existing cards above, so the Overview now shows the same facts twice. Please either retire the overlapping cards or trim the metadata card down to only surface the additional fields (e.g. ID, image, mounts, labels) before shipping.🤖 Prompt for AI Agents