SCGR commited on
Commit
1c92d33
·
1 Parent(s): c79c7ae

loading state animation

Browse files
Dockerfile CHANGED
@@ -25,9 +25,6 @@
25
  # Copy backend code
26
  COPY py_backend/ /app/
27
 
28
- # Make the thumbnail conversion script executable
29
- RUN chmod +x /app/generate_production_thumbnails.py
30
-
31
  # Copy built frontend into the image (served by FastAPI)
32
  COPY --from=fe /fe/dist /app/static
33
 
@@ -45,9 +42,6 @@ echo "Starting PromptAid Vision..."\n\
45
  echo "Running database migrations..."\n\
46
  alembic upgrade head\n\
47
  echo "Database migrations completed"\n\
48
- echo "Generating thumbnails for existing images..."\n\
49
- python generate_production_thumbnails.py\n\
50
- echo "Thumbnail generation completed"\n\
51
  echo "Starting FastAPI server..."\n\
52
  exec uvicorn app.main:app --host 0.0.0.0 --port $PORT\n\
53
  ' > /app/start.sh && chmod +x /app/start.sh
 
25
  # Copy backend code
26
  COPY py_backend/ /app/
27
 
 
 
 
28
  # Copy built frontend into the image (served by FastAPI)
29
  COPY --from=fe /fe/dist /app/static
30
 
 
42
  echo "Running database migrations..."\n\
43
  alembic upgrade head\n\
44
  echo "Database migrations completed"\n\
 
 
 
45
  echo "Starting FastAPI server..."\n\
46
  exec uvicorn app.main:app --host 0.0.0.0 --port $PORT\n\
47
  ' > /app/start.sh && chmod +x /app/start.sh
frontend/src/components/upload/ModalComponents.tsx CHANGED
@@ -7,9 +7,10 @@ interface FullSizeImageModalProps {
7
  preview: string | null;
8
  selectedImageData?: { file: File; index: number } | null;
9
  onClose: () => void;
 
10
  }
11
 
12
- export function FullSizeImageModal({ isOpen, imageUrl, preview, selectedImageData, onClose }: FullSizeImageModalProps) {
13
  if (!isOpen) return null;
14
 
15
  // Determine which image to show
@@ -40,10 +41,19 @@ export function FullSizeImageModal({ isOpen, imageUrl, preview, selectedImageDat
40
  </Button>
41
  </div>
42
  <div className={styles.fullSizeModalImage}>
43
- <img
44
- src={imageSrc}
45
- alt={imageAlt}
46
- />
 
 
 
 
 
 
 
 
 
47
  </div>
48
  </div>
49
  </div>
 
7
  preview: string | null;
8
  selectedImageData?: { file: File; index: number } | null;
9
  onClose: () => void;
10
+ isLoading?: boolean;
11
  }
12
 
13
+ export function FullSizeImageModal({ isOpen, imageUrl, preview, selectedImageData, onClose, isLoading = false }: FullSizeImageModalProps) {
14
  if (!isOpen) return null;
15
 
16
  // Determine which image to show
 
41
  </Button>
42
  </div>
43
  <div className={styles.fullSizeModalImage}>
44
+ {isLoading ? (
45
+ <div className="flex items-center justify-center h-64">
46
+ <div className="flex items-center gap-2">
47
+ <Spinner className="w-6 h-6" />
48
+ <span>Loading image...</span>
49
+ </div>
50
+ </div>
51
+ ) : (
52
+ <img
53
+ src={imageSrc}
54
+ alt={imageAlt}
55
+ />
56
+ )}
57
  </div>
58
  </div>
59
  </div>
frontend/src/pages/MapDetailsPage/MapDetailPage.tsx CHANGED
@@ -1325,16 +1325,9 @@ export default function MapDetailPage() {
1325
  variant="secondary"
1326
  size={1}
1327
  onClick={() => handleViewFullSize(allImages[currentImageIndex])}
1328
- disabled={isLoadingImages || !allImages[currentImageIndex]?.image_url || isLoadingFullSizeImage}
1329
  >
1330
- {isLoadingFullSizeImage ? (
1331
- <div className="flex items-center gap-2">
1332
- <Spinner className="w-4 h-4" />
1333
- <span>Loading...</span>
1334
- </div>
1335
- ) : (
1336
- "View Image"
1337
- )}
1338
  </Button>
1339
  </div>
1340
  </div>
@@ -1375,16 +1368,9 @@ export default function MapDetailPage() {
1375
  variant="secondary"
1376
  size={1}
1377
  onClick={() => handleViewFullSize(filteredMap)}
1378
- disabled={!filteredMap.image_url || isLoadingFullSizeImage}
1379
  >
1380
- {isLoadingFullSizeImage ? (
1381
- <div className="flex items-center gap-2">
1382
- <Spinner className="w-4 h-4" />
1383
- <span>Loading...</span>
1384
- </div>
1385
- ) : (
1386
- "View Image"
1387
- )}
1388
  </Button>
1389
  </div>
1390
  </div>
@@ -1674,6 +1660,7 @@ export default function MapDetailPage() {
1674
  preview={null}
1675
  selectedImageData={null}
1676
  onClose={handleCloseFullSizeModal}
 
1677
  />
1678
  </PageContainer>
1679
  );
 
1325
  variant="secondary"
1326
  size={1}
1327
  onClick={() => handleViewFullSize(allImages[currentImageIndex])}
1328
+ disabled={isLoadingImages || !allImages[currentImageIndex]?.image_url}
1329
  >
1330
+ View Image
 
 
 
 
 
 
 
1331
  </Button>
1332
  </div>
1333
  </div>
 
1368
  variant="secondary"
1369
  size={1}
1370
  onClick={() => handleViewFullSize(filteredMap)}
1371
+ disabled={!filteredMap.image_url}
1372
  >
1373
+ View Image
 
 
 
 
 
 
 
1374
  </Button>
1375
  </div>
1376
  </div>
 
1660
  preview={null}
1661
  selectedImageData={null}
1662
  onClose={handleCloseFullSizeModal}
1663
+ isLoading={isLoadingFullSizeImage}
1664
  />
1665
  </PageContainer>
1666
  );