updates on the admin and zone things and minor changes

This commit is contained in:
2026-10-06 19:21:06 +05:30
parent 6e73b59ca9
commit 7aca6a6a48
14 changed files with 589 additions and 90 deletions

View File

@@ -14,6 +14,13 @@ import Login from '@/pages/Login';
/* Every console page is code-split. The Dispatch board alone pulls the map,
the solver payload builders and the comparison panels; loading that on the
way to the Hubs table would make every first paint pay for it. */
/* Doormile-only pages. A client login is sent home rather than shown a page
whose every request the server refuses. */
function StaffOnly({ children }) {
const { isClient } = useAuth();
return isClient ? <Navigate to="/doormile/home" replace /> : children;
}
const Dispatch = lazy(() => import('@/pages/doormile/dispatch/Dispatch.jsx'));
const DispatchPreview = lazy(() => import('@/pages/doormile/dispatch/Preview.jsx'));
@@ -126,10 +133,10 @@ const AuthenticatedApp = () => {
{/* Reverse logistics: parcels going back to the sender (RTO). */}
<Route path="returns" element={<Returns />} />
<Route path="tenants" element={<Tenants />} />
<Route path="clients/create" element={<CreateClient />} />
<Route path="tenants" element={<StaffOnly><Tenants /></StaffOnly>} />
<Route path="clients/create" element={<StaffOnly><CreateClient /></StaffOnly>} />
{/* Owner-only (admin@doormile.com); the page and the server both check. */}
<Route path="clients/onboard" element={<ClientOnboarding />} />
<Route path="clients/onboard" element={<StaffOnly><ClientOnboarding /></StaffOnly>} />
<Route path="customer/create" element={<CreateCustomer />} />
<Route path="pricing" element={<Pricing />} />
@@ -145,11 +152,11 @@ const AuthenticatedApp = () => {
<Route path="customers" element={<Customers />} />
<Route path="hubs" element={<Hubs />} />
<Route path="vehicles" element={<Vehicles />} />
<Route path="app-users" element={<AppUsers />} />
<Route path="tripsheets" element={<Tripsheets />} />
<Route path="vehicles" element={<StaffOnly><Vehicles /></StaffOnly>} />
<Route path="app-users" element={<StaffOnly><AppUsers /></StaffOnly>} />
<Route path="tripsheets" element={<StaffOnly><Tripsheets /></StaffOnly>} />
<Route path="exceptions" element={<Exceptions />} />
<Route path="competitive-intel" element={<CompetitiveIntel />} />
<Route path="competitive-intel" element={<StaffOnly><CompetitiveIntel /></StaffOnly>} />
<Route path="reports/orderssummary" element={<OrdersSummary />} />
<Route path="reports/ordersdetails" element={<OrdersDetails />} />
@@ -162,7 +169,7 @@ const AuthenticatedApp = () => {
{/* The AI_engine swarm. Read-only: it reports what the agents are
and what they last did, and has no control surface, because
every autonomy gate lives in that repository's own env. */}
<Route path="agents" element={<Agents />} />
<Route path="agents" element={<StaffOnly><Agents /></StaffOnly>} />
</Route>
</Route>