Commit information not available.
;
15 | }
16 |
17 | return (
18 |
19 |
20 | SHA:{' '}
21 |
22 | {commit.sha.substring(0, 12)}...
23 |
24 |
25 |
26 | Author: {commit.author}
27 |
28 |
29 | Date:{' '}
30 | {new Date(commit.timestamp).toLocaleString()}
31 |
32 |
33 | Message:
34 |
35 |
{commit.message}
36 |
37 | );
38 | }
39 |
--------------------------------------------------------------------------------
/backend/app/routers/environments.py:
--------------------------------------------------------------------------------
1 | """Environments router for the Memory Tracker API."""
2 |
3 | from fastapi import APIRouter, Depends, HTTPException
4 | from sqlalchemy.ext.asyncio import AsyncSession
5 | from typing import List
6 |
7 | from .. import schemas, crud
8 | from ..database import get_database
9 |
10 | router = APIRouter(prefix="/api", tags=["environments"])
11 |
12 |
13 | @router.get("/environments", response_model=List[schemas.Environment])
14 | async def get_environments(db: AsyncSession = Depends(get_database)):
15 | environments = await crud.get_environments(db)
16 | return [
17 | schemas.Environment(id=env.id, name=env.name, description=env.description)
18 | for env in environments
19 | ]
20 |
21 |
22 | @router.get("/environments/{environment_id}", response_model=schemas.Environment)
23 | async def get_environment(
24 | environment_id: str, db: AsyncSession = Depends(get_database)
25 | ):
26 | environment = await crud.get_environment_by_id(db, environment_id=environment_id)
27 | if environment is None:
28 | raise HTTPException(status_code=404, detail="Environment not found")
29 |
30 | return schemas.Environment(
31 | id=environment.id, name=environment.name, description=environment.description
32 | )
33 |
--------------------------------------------------------------------------------
/frontend/src/components/ui/badge.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { cva, type VariantProps } from 'class-variance-authority';
3 |
4 | import { cn } from '@/lib/utils';
5 |
6 | const badgeVariants = cva(
7 | 'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
8 | {
9 | variants: {
10 | variant: {
11 | default:
12 | 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',
13 | secondary:
14 | 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
15 | destructive:
16 | 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',
17 | outline: 'text-foreground',
18 | },
19 | },
20 | defaultVariants: {
21 | variant: 'default',
22 | },
23 | }
24 | );
25 |
26 | export interface BadgeProps
27 | extends React.HTMLAttributes