fix: production URLs for admin panel, seed __dirname, nginx.conf
Deploy Canina / deploy (push) Failing after 8m3s

This commit is contained in:
DevOps committed 2026-07-13 11:20:43 +00:00
1 parent a22afb11d5
commit 1b2040c880
10 files changed
+32 -22

No files matched your search

@@ -186,7 +186,7 @@ export default function MediaSelector({ isOpen, onClose, onSelect, multiple = fa
) : (
<div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4">
{mediaList.map((media) => {
const imgUrl = media.url.startsWith('http') ? media.url : `http://localhost:4001${media.url}`;
const imgUrl = media.url.startsWith('http') ? media.url : `https://apicanina.parsaaghayi.ir${media.url}`;
const isSelected = selectedUrl && imgUrl === selectedUrl;
return (
<div
+2 -2
View File
@@ -152,7 +152,7 @@ export default function Blogs() {
<tr key={blog.id} className="hover:bg-gray-50/50 transition-colors">
<td className="py-3 px-6">
{blog.imageUrl ? (
<img src={blog.imageUrl.startsWith('http') ? blog.imageUrl : `http://localhost:4001${blog.imageUrl}`} alt="blog" className="w-16 h-10 rounded-lg object-cover border border-gray-200" />
<img src={blog.imageUrl.startsWith('http') ? blog.imageUrl : `https://apicanina.parsaaghayi.ir${blog.imageUrl}`} alt="blog" className="w-16 h-10 rounded-lg object-cover border border-gray-200" />
) : (
<div className="w-16 h-10 rounded-lg bg-gray-100 flex items-center justify-center text-gray-400">
<ImageIcon className="w-4 h-4" />
@@ -222,7 +222,7 @@ export default function Blogs() {
<label className="text-sm font-bold text-gray-700">تصویر شاخص</label>
<div className="flex items-center gap-4">
{formData.imageUrl ? (
<img src={formData.imageUrl.startsWith('http') ? formData.imageUrl : `http://localhost:4001${formData.imageUrl}`} alt="preview" className="w-24 h-16 rounded-xl object-cover border border-gray-200" />
<img src={formData.imageUrl.startsWith('http') ? formData.imageUrl : `https://apicanina.parsaaghayi.ir${formData.imageUrl}`} alt="preview" className="w-24 h-16 rounded-xl object-cover border border-gray-200" />
) : (
<div className="w-24 h-16 rounded-xl bg-gray-100 flex items-center justify-center text-gray-400">
<ImageIcon className="w-6 h-6" />
@@ -158,7 +158,7 @@ export default function Categories() {
<tr key={cat.id} className="hover:bg-gray-50/50 transition-colors">
<td className="py-3 px-6">
{cat.imageUrl ? (
<img src={cat.imageUrl.startsWith('http') ? cat.imageUrl : `http://localhost:4001${cat.imageUrl}`} alt={cat.name} className="w-12 h-12 rounded-xl object-cover border border-gray-200" />
<img src={cat.imageUrl.startsWith('http') ? cat.imageUrl : `https://apicanina.parsaaghayi.ir${cat.imageUrl}`} alt={cat.name} className="w-12 h-12 rounded-xl object-cover border border-gray-200" />
) : (
<div className="w-12 h-12 rounded-xl bg-gray-100 flex items-center justify-center text-gray-400">
<ImageIcon className="w-5 h-5" />
@@ -240,7 +240,7 @@ export default function Categories() {
<label className="text-sm font-bold text-gray-700">تصویر دسته‌بندی</label>
<div className="flex items-center gap-4">
{formData.imageUrl ? (
<img src={formData.imageUrl.startsWith('http') ? formData.imageUrl : `http://localhost:4001${formData.imageUrl}`} alt="preview" className="w-16 h-16 rounded-xl object-cover border border-gray-200" />
<img src={formData.imageUrl.startsWith('http') ? formData.imageUrl : `https://apicanina.parsaaghayi.ir${formData.imageUrl}`} alt="preview" className="w-16 h-16 rounded-xl object-cover border border-gray-200" />
) : (
<div className="w-16 h-16 rounded-xl bg-gray-100 flex items-center justify-center text-gray-400">
<ImageIcon className="w-6 h-6" />
+2 -2
View File
@@ -102,7 +102,7 @@ export default function MediaManager() {
};
const handleCopyUrl = async (media: Media) => {
const fullUrl = media.url.startsWith('http') ? media.url : `http://localhost:4001${media.url}`;
const fullUrl = media.url.startsWith('http') ? media.url : `https://apicanina.parsaaghayi.ir${media.url}`;
try {
await navigator.clipboard.writeText(fullUrl);
setCopiedId(media.id);
@@ -202,7 +202,7 @@ export default function MediaManager() {
) : (
<div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4 p-6">
{filtered.map(media => {
const imgUrl = media.url.startsWith('http') ? media.url : `http://localhost:4001${media.url}`;
const imgUrl = media.url.startsWith('http') ? media.url : `https://apicanina.parsaaghayi.ir${media.url}`;
return (
<div
key={media.id}
+1 -1
View File
@@ -91,7 +91,7 @@ export default function Pets() {
<tr key={pet.id} className="hover:bg-gray-50/50 transition-colors">
<td className="py-3 px-6">
{pet.imageUrl ? (
<img src={pet.imageUrl.startsWith('http') ? pet.imageUrl : `http://localhost:4001${pet.imageUrl}`} alt={pet.name} className="w-12 h-12 rounded-full object-cover border-2 border-purple-100" />
<img src={pet.imageUrl.startsWith('http') ? pet.imageUrl : `https://apicanina.parsaaghayi.ir${pet.imageUrl}`} alt={pet.name} className="w-12 h-12 rounded-full object-cover border-2 border-purple-100" />
) : (
<div className="w-12 h-12 rounded-full bg-purple-50 flex items-center justify-center text-purple-300 border-2 border-purple-100">
<ImageIcon className="w-5 h-5" />
+3 -3
View File
@@ -214,7 +214,7 @@ export default function Products() {
<tr key={product.id} className="hover:bg-gray-50/50 transition-colors">
<td className="py-3 px-6">
{product.imageUrl ? (
<img src={product.imageUrl.startsWith('http') ? product.imageUrl : `http://localhost:4001${product.imageUrl}`} alt={product.name} className="w-12 h-12 rounded-xl object-cover border border-gray-200" />
<img src={product.imageUrl.startsWith('http') ? product.imageUrl : `https://apicanina.parsaaghayi.ir${product.imageUrl}`} alt={product.name} className="w-12 h-12 rounded-xl object-cover border border-gray-200" />
) : (
<div className="w-12 h-12 rounded-xl bg-gray-100 flex items-center justify-center text-gray-400">
<ImageIcon className="w-5 h-5" />
@@ -385,7 +385,7 @@ export default function Products() {
{formData.imageUrl ? (
<div className="w-full flex flex-col items-center">
<div className="relative group">
<img src={formData.imageUrl.startsWith('http') ? formData.imageUrl : `http://localhost:4001${formData.imageUrl}`} alt="product" className="max-w-xs h-48 object-cover rounded-xl shadow-md" />
<img src={formData.imageUrl.startsWith('http') ? formData.imageUrl : `https://apicanina.parsaaghayi.ir${formData.imageUrl}`} alt="product" className="max-w-xs h-48 object-cover rounded-xl shadow-md" />
<div className="absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity rounded-xl flex items-center justify-center gap-3">
<button type="button" onClick={() => setIsMediaSelectorOpen(true)} className="bg-white text-gray-800 px-4 py-2 rounded-lg font-bold text-sm">تغییر عکس</button>
</div>
@@ -435,7 +435,7 @@ export default function Products() {
isOpen={isMediaSelectorOpen}
onClose={() => setIsMediaSelectorOpen(false)}
onSelect={(url) => setFormData({...formData, imageUrl: url})}
selectedUrl={formData.imageUrl.startsWith('http') ? formData.imageUrl : formData.imageUrl ? `http://localhost:4001${formData.imageUrl}` : undefined}
selectedUrl={formData.imageUrl.startsWith('http') ? formData.imageUrl : formData.imageUrl ? `https://apicanina.parsaaghayi.ir${formData.imageUrl}` : undefined}
/>
</div>
);
+1 -1
View File
@@ -1,7 +1,7 @@
import axios from 'axios';
const api = axios.create({
baseURL: 'http://localhost:4001/api', // Backend NestJS API URL
baseURL: 'https://apicanina.parsaaghayi.ir/api', // Backend NestJS API URL
headers: {
'Content-Type': 'application/json',
},