added updated admin pannel
This commit is contained in:
@@ -22,10 +22,9 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: ecommerce-admin-panel
|
||||
# Replace with your actual registry image
|
||||
# Build with: docker build --build-arg VITE_API_URL=https://api.yourdomain.com .
|
||||
image: your-registry/ecommerce-admin-panel:latest
|
||||
imagePullPolicy: Always
|
||||
# Using local image built in minikube docker-env
|
||||
image: ecommerce-admin-panel:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 80
|
||||
protocol: TCP
|
||||
|
||||
@@ -13,4 +13,5 @@ spec:
|
||||
protocol: TCP
|
||||
port: 80
|
||||
targetPort: 80
|
||||
type: ClusterIP
|
||||
nodePort: 30082
|
||||
type: NodePort
|
||||
|
||||
@@ -1821,7 +1821,7 @@ const Dashboard = () => {
|
||||
|
||||
const productId = order.items?.[0]?.productId;
|
||||
if (productId) {
|
||||
const product = stats.topProducts.find((p) => p._id === productId);
|
||||
const product = stats.topProducts?.find((p) => p._id === productId);
|
||||
if (product?.displayImage) {
|
||||
return product.displayImage;
|
||||
}
|
||||
@@ -1836,7 +1836,7 @@ const Dashboard = () => {
|
||||
return productDetails.name;
|
||||
}
|
||||
|
||||
const product = stats.topProducts.find(
|
||||
const product = stats.topProducts?.find(
|
||||
(p) => p._id === order.items[0]?.productId
|
||||
);
|
||||
|
||||
@@ -2500,7 +2500,7 @@ const Dashboard = () => {
|
||||
|
||||
<td className="px-6 py-4">
|
||||
<p className="font-bold text-lg text-[#704F38]">
|
||||
₹{parseFloat(order.totalAmount).toLocaleString()}
|
||||
₹{(parseFloat(order.totalAmount) || 0).toLocaleString()}
|
||||
</p>
|
||||
<p className="text-xs text-gray-500 mt-1 uppercase">
|
||||
{order.paymentMethod}
|
||||
@@ -2668,7 +2668,7 @@ const Dashboard = () => {
|
||||
<div className="flex items-center justify-between pt-3 border-t border-gray-200">
|
||||
<div className="bg-gradient-to-r from-[#FFE6B3] to-[#FFD280] px-3 py-1 rounded-full">
|
||||
<span className="text-[#704F38] font-extrabold text-sm">
|
||||
₹{product.basePrice.toLocaleString()}
|
||||
₹{(product.basePrice || 0).toLocaleString()}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2690,7 +2690,7 @@ const Dashboard = () => {
|
||||
<div className="flex items-center justify-between text-xs">
|
||||
<span className="text-gray-500">Revenue:</span>
|
||||
<span className="font-bold text-green-600">
|
||||
₹{product.revenue.toLocaleString()}
|
||||
₹{(product.revenue || 0).toLocaleString()}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2726,7 +2726,7 @@ const Dashboard = () => {
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
{stats.lowStockProducts.map((product) => (
|
||||
{stats.lowStockProducts?.map((product) => (
|
||||
<div
|
||||
key={product._id}
|
||||
className="bg-white rounded-lg p-4 border border-yellow-200 flex items-center gap-4 cursor-pointer hover:shadow-md transition-shadow"
|
||||
|
||||
Reference in New Issue
Block a user