This commit is contained in:
Dagimassefa
2026-06-22 12:29:48 +03:00
parent 911f486620
commit b3bfa899f5
6 changed files with 43 additions and 14 deletions

View File

@@ -49,14 +49,13 @@ import { getCategorySidebarChildren } from "./pages/ruleEngine/config/resources"
import RuleEngineLegacyRedirect from "./pages/ruleEngine/RuleEngineLegacyRedirect";
import RuleEngineResourcePage from "./pages/ruleEngine/RuleEngineResourcePage";
import TrainDetailPage from "./pages/trains/TrainDetailPage";
import CargoTypesPage from "./pages/ruleEngine/CargoTypesPage";
import TrainScheduleV2ListPage from "./pages/trainScheduling/TrainScheduleV2ListPage";
import BatchBoardPage from "./pages/trainScheduling/BatchBoardPage";
import BatchScheduleDetailPage from "./pages/trainScheduling/BatchScheduleDetailPage";
import TrainScheduleTrackPage from "./pages/trainScheduling/TrainScheduleTrackPage";
import TrainScheduleV2DetailPage from "./pages/trainScheduling/TrainScheduleV2DetailPage";
import TrainScheduleV2ListPage from "./pages/trainScheduling/TrainScheduleV2ListPage";
import TrainSchedulingGlobalRulesPage from "./pages/trainScheduling/TrainSchedulingGlobalRulesPage";
import CargoTypesPage from "./pages/ruleEngine/CargoTypesPage";
import TrainScheduleV2ListPage from "./pages/trainScheduling/TrainScheduleV2ListPage";
import BatchBoardPage from "./pages/trainScheduling/BatchBoardPage";
import BatchScheduleDetailPage from "./pages/trainScheduling/BatchScheduleDetailPage";
import TrainScheduleTrackPage from "./pages/trainScheduling/TrainScheduleTrackPage";
import TrainScheduleV2DetailPage from "./pages/trainScheduling/TrainScheduleV2DetailPage";
import TrainSchedulingGlobalRulesPage from "./pages/trainScheduling/TrainSchedulingGlobalRulesPage";
import ArrivalQueuePage from "./pages/warehouses/ArrivalQueuePage";
import DispatchQueuePage from "./pages/warehouses/DispatchQueuePage";
import InventoryInquiryPage from "./pages/warehouses/InventoryInquiryPage";

View File

@@ -1,4 +1,10 @@
// API host is env-driven (set VITE_API_URL per environment, e.g. the remote
// https://edrfreightapi.triaplc.com for prod). Falls back to the local API for dev.
export const API_BASE_URL =
(import.meta.env.VITE_API_URL as string | undefined) ?? 'http://localhost:3001';
// Accept either a host-only URL or one that already ends with `/api`.
// The HTTP client appends `/api` itself, so we normalize here to avoid
// accidental `/api/api/...` requests from env values.
const rawApiBaseUrl =
(import.meta.env.VITE_API_URL as string | undefined) ?? "http://localhost:3001";
export const API_BASE_URL = rawApiBaseUrl
.trim()
.replace(/\/+$/, "")
.replace(/\/api$/, "");

View File

@@ -26,8 +26,12 @@ interface Metric {
icon: React.ReactNode;
/** Route to navigate to when the card is clicked. */
to: string;
theme: string;
}
const ORANGE = '#f08c00';
const GREEN = '#22c55e';
const METRICS: Metric[] = [
{ key: 'totalWarehouses', label: 'Total Warehouses', icon: <WarehouseIcon size={22} />, to: '/dashboard/warehouses', theme: ORANGE },
{ key: 'totalInventory', label: 'Total Inventory', icon: <Boxes size={22} />, to: '/dashboard/warehouse-inventory', theme: GREEN },
@@ -77,7 +81,12 @@ export default function WarehouseDashboardPage() {
{data ? data[metric.key] : 0}
</Text>
</div>
<ThemeIcon variant="light" color="edr-green" size={46} radius="md">
<ThemeIcon
variant="light"
size={46}
radius="md"
style={{ backgroundColor: `${metric.theme}1a`, color: metric.theme }}
>
{metric.icon}
</ThemeIcon>
</Group>