archetecture security fix
This commit is contained in:
@@ -0,0 +1 @@
|
||||
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33525,(e,r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},18967,(e,r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={DecodeError:function(){return P},MiddlewareNotFoundError:function(){return O},MissingStaticPage:function(){return h},NormalizeError:function(){return E},PageNotFoundError:function(){return b},SP:function(){return m},ST:function(){return y},WEB_VITALS:function(){return i},execOnce:function(){return u},getDisplayName:function(){return l},getLocationOrigin:function(){return c},getURL:function(){return f},isAbsoluteUrl:function(){return a},isResSent:function(){return d},loadGetInitialProps:function(){return g},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return N}};for(var o in n)Object.defineProperty(t,o,{enumerable:!0,get:n[o]});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function u(e){let r,t=!1;return(...n)=>(t||(t=!0,r=e(...n)),r)}let s=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,a=e=>s.test(e);function c(){let{protocol:e,hostname:r,port:t}=window.location;return`${e}//${r}${t?":"+t:""}`}function f(){let{href:e}=window.location,r=c();return e.substring(r.length)}function l(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function d(e){return e.finished||e.headersSent}function p(e){let r=e.split("?");return r[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(r[1]?`?${r.slice(1).join("?")}`:"")}async function g(e,r){let t=r.res||r.ctx&&r.ctx.res;if(!e.getInitialProps)return r.ctx&&r.Component?{pageProps:await g(r.Component,r.ctx)}:{};let n=await e.getInitialProps(r);if(t&&d(t))return n;if(!n)throw Object.defineProperty(Error(`"${l(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return n}let m="u">typeof performance,y=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class P extends Error{}class E extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class h extends Error{constructor(e,r){super(),this.message=`Failed to load static file for page: ${e} ${r}`}}class O extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function N(e){return JSON.stringify({message:e.message,stack:e.stack})}},98183,(e,r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={assign:function(){return a},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return s}};for(var o in n)Object.defineProperty(t,o,{enumerable:!0,get:n[o]});function i(e){let r={};for(let[t,n]of e.entries()){let e=r[t];void 0===e?r[t]=n:Array.isArray(e)?e.push(n):r[t]=[e,n]}return r}function u(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function s(e){let r=new URLSearchParams;for(let[t,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)r.append(t,u(e));else r.set(t,u(n));return r}function a(e,...r){for(let t of r){for(let r of t.keys())e.delete(r);for(let[r,n]of t.entries())e.append(r,n)}return e}}]);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,6655,t=>{"use strict";let e=t.i(47167).default.env.NEXT_PUBLIC_API_URL??"/admin/api/v1";t.s(["ADMIN_API_BASE",0,e])}]);
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,6655,e=>{"use strict";let a=e.i(47167).default.env.NEXT_PUBLIC_API_URL??"/admin/api/v1";e.s(["ADMIN_API_BASE",0,a])},33553,e=>{"use strict";var a=e.i(43476),s=e.i(71645),t=e.i(22016),l=e.i(51224),r=e.i(6655);e.s(["default",0,function(){let{language:e,dict:i}=(0,l.useAdminI18n)(),n={en:{kpis:["Total companies","Active companies","Total renters","Total reservations"],platformOverview:"Platform overview",cards:[["Companies","List, search, suspend, reactivate, and review subscription state.","View all →"],["Renters","Support flows for blocking and unblocking marketplace renters.","View all →"],["Audit logs","Full trace of every admin action taken on the platform.","View logs →"]]},fr:{kpis:["Entreprises totales","Entreprises actives","Locataires totaux","Réservations totales"],platformOverview:"Vue d’ensemble de la plateforme",cards:[["Entreprises","Lister, rechercher, suspendre, réactiver et consulter l’état des abonnements.","Voir tout →"],["Locataires","Gérer l’assistance liée au blocage et au déblocage des locataires de la marketplace.","Voir tout →"],["Journaux d’audit","Consulter la trace complète de chaque action d’administration sur la plateforme.","Voir les journaux →"]]},ar:{kpis:["إجمالي الشركات","الشركات النشطة","إجمالي المستأجرين","إجمالي الحجوزات"],platformOverview:"نظرة عامة على المنصة",cards:[["الشركات","اعرض الشركات وابحث عنها وعلّقها وأعد تفعيلها وراجع حالة الاشتراك.","عرض الكل ←"],["المستأجرون","إدارة طلبات الدعم الخاصة بحظر مستأجري السوق وفك الحظر عنهم.","عرض الكل ←"],["سجلات التدقيق","مراجعة السجل الكامل لكل إجراء إداري تم على المنصة.","عرض السجلات ←"]]}}[e],[c,o]=(0,s.useState)(null),[d,m]=(0,s.useState)(!0);(0,s.useEffect)(()=>{fetch(`${r.ADMIN_API_BASE}/admin/metrics`,{credentials:"include",cache:"no-store"}).then(e=>e.json()).then(e=>o(e.data)).catch(()=>null).finally(()=>m(!1))},[]);let p=c?[{label:"Total companies",value:c.totalCompanies},{label:n.kpis[1],value:c.activeCompanies},{label:n.kpis[2],value:c.totalRenters},{label:n.kpis[3],value:c.totalReservations}]:[];return p.length>0&&(p[0].label=n.kpis[0]),(0,a.jsxs)("div",{className:"shell py-8 space-y-8",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs uppercase tracking-[0.2em] text-emerald-400",children:i.admin}),(0,a.jsx)("h1",{className:"mt-1 text-3xl font-black",children:n.platformOverview})]}),(0,a.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:d?Array.from({length:4}).map((e,s)=>(0,a.jsxs)("div",{className:"panel p-6 animate-pulse",children:[(0,a.jsx)("div",{className:"h-3 w-24 rounded bg-zinc-800"}),(0,a.jsx)("div",{className:"mt-3 h-8 w-16 rounded bg-zinc-800"})]},s)):p.map(e=>(0,a.jsxs)("div",{className:"panel p-6",children:[(0,a.jsx)("p",{className:"text-xs text-zinc-500",children:e.label}),(0,a.jsx)("p",{className:"mt-1 text-3xl font-black",children:e.value?.toLocaleString()??"—"})]},e.label))}),(0,a.jsx)("div",{className:"grid gap-6 md:grid-cols-3",children:[["/dashboard/companies",...n.cards[0]],["/dashboard/renters",...n.cards[1]],["/dashboard/audit-logs",...n.cards[2]]].map(([e,s,l,r])=>(0,a.jsxs)(t.default,{href:e,className:"panel p-6 hover:border-zinc-700 transition-colors block",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-zinc-200",children:s}),(0,a.jsx)("p",{className:"mt-2 text-sm text-zinc-500",children:l}),(0,a.jsx)("p",{className:"mt-4 text-xs text-emerald-400 font-medium",children:r})]},e))})]})}])}]);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,6655,e=>{"use strict";let t=e.i(47167).default.env.NEXT_PUBLIC_API_URL??"/admin/api/v1";e.s(["ADMIN_API_BASE",0,t])},29116,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(6655);let c={CREATE:"text-emerald-400 bg-emerald-950/40",UPDATE:"text-sky-400 bg-sky-950/40",DELETE:"text-red-400 bg-red-950/40",SUSPEND:"text-orange-400 bg-orange-950/40",ACTIVATE:"text-emerald-400 bg-emerald-950/40",LOGIN:"text-zinc-400 bg-zinc-800"};e.s(["default",0,function(){let[e,i]=(0,s.useState)([]),[n,r]=(0,s.useState)(!0),[l,d]=(0,s.useState)(null),[x,o]=(0,s.useState)("");(0,s.useEffect)(()=>{fetch(`${a.ADMIN_API_BASE}/admin/audit-logs`,{credentials:"include",cache:"no-store"}).then(e=>e.json()).then(e=>i(Array.isArray(e.data)?e.data:e.data?.data??[])).catch(e=>d(e.message)).finally(()=>r(!1))},[]);let m=x?e.filter(e=>e.action.toLowerCase().includes(x.toLowerCase())||e.resource.toLowerCase().includes(x.toLowerCase())):e;return(0,t.jsxs)("div",{className:"shell py-8 space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs uppercase tracking-[0.2em] text-emerald-400",children:"Platform"}),(0,t.jsx)("h1",{className:"mt-1 text-3xl font-black",children:"Audit Logs"})]}),(0,t.jsx)("input",{className:"w-64 px-3 py-2 rounded-xl bg-zinc-800 border border-zinc-700 text-zinc-100 text-sm placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-emerald-500",placeholder:"Filter by action or entity…",value:x,onChange:e=>o(e.target.value)})]}),l&&(0,t.jsx)("div",{className:"panel p-4 text-sm text-red-400",children:l}),(0,t.jsx)("div",{className:"panel overflow-hidden",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-zinc-800",children:[(0,t.jsx)("th",{className:"text-left px-6 py-3 text-xs font-medium text-zinc-500 uppercase tracking-wider",children:"Action"}),(0,t.jsx)("th",{className:"text-left px-6 py-3 text-xs font-medium text-zinc-500 uppercase tracking-wider",children:"Entity"}),(0,t.jsx)("th",{className:"text-left px-6 py-3 text-xs font-medium text-zinc-500 uppercase tracking-wider",children:"Entity ID"}),(0,t.jsx)("th",{className:"text-left px-6 py-3 text-xs font-medium text-zinc-500 uppercase tracking-wider",children:"Admin"}),(0,t.jsx)("th",{className:"text-left px-6 py-3 text-xs font-medium text-zinc-500 uppercase tracking-wider",children:"Time"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-zinc-800/60",children:n?(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:5,className:"px-6 py-12 text-center text-zinc-500",children:"Loading…"})}):0===m.length?(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:5,className:"px-6 py-12 text-center text-zinc-500",children:"No logs found"})}):m.map(e=>(0,t.jsxs)("tr",{className:"hover:bg-zinc-800/30 transition-colors",children:[(0,t.jsx)("td",{className:"px-6 py-3",children:(0,t.jsx)("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${c[e.action]??"text-zinc-400 bg-zinc-800"}`,children:e.action})}),(0,t.jsx)("td",{className:"px-6 py-3 text-zinc-300",children:e.resource}),(0,t.jsx)("td",{className:"px-6 py-3 text-zinc-500 font-mono text-xs",children:e.resourceId?`${e.resourceId.slice(0,12)}…`:"—"}),(0,t.jsx)("td",{className:"px-6 py-3 text-zinc-400",children:e.adminUser?`${e.adminUser.firstName} ${e.adminUser.lastName}`:"—"}),(0,t.jsx)("td",{className:"px-6 py-3 text-zinc-500 text-xs",children:new Date(e.createdAt).toLocaleString()})]},e.id))})]})})})]})}])}]);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,7573,e=>{"use strict";var t=e.i(43476),a=e.i(71645);e.s(["default",0,function(){return(0,a.useEffect)(()=>{var e;let t=(e=new URLSearchParams(window.location.hash.replace(/^#/,"")).get("next"))?/^https?:\/\//i.test(e)||e.startsWith("/admin/")?e:"/admin"===e?"/admin/dashboard":e.startsWith("/")?`/admin${e}`:`/admin/${e.replace(/^\/+/,"")}`:"/admin/dashboard";window.history.replaceState(null,"",window.location.pathname),window.location.replace(t)},[]),(0,t.jsx)("div",{className:"flex min-h-screen items-center justify-center bg-zinc-950",children:(0,t.jsx)("p",{className:"text-sm text-zinc-400",children:"Redirecting to admin dashboard…"})})}])}]);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user