PageSourceSearch

https://www.smartcms.ai/_next/static/chunks/app/%5Blocale%5D/admin/database/page-0b253f3c23432594.js

js smartcms.ai collected 2026-10-05 15:00:43 UTC 3,208 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9439],{25132:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,52619,23)),Promise.resolve().then(r.bind(r,71382))},71382:(e,t,r)=>{"use strict";r.d(t,{default:()=>n});var s=r(95155),a=r(12115);function n(){var e,t,r,n;let[i,d]=(0,a.useState)(null),[o,c]=(0,a.useState)(!1),[x,u]=(0,a.useState)(!1),[m,h]=(0,a.useState)(null);async function g(){c(!0),h(null);try{let e=await fetch("/api/admin/db-sync",{cache:"no-store"}),t=await e.json();d(t)}catch(e){d({success:!1,error:"Network error"})}finally{c(!1)}}async function y(){if(confirm("The dev database will be overwritten with the current prod snapshot. Continue?")){u(!0),h(null);try{var e,t;let r=await fetch("/api/admin/db-sync",{method:"POST"}),s=await r.json();h(null!=(t=null!=(e=s.message)?e:s.error)?t:"Unknown response"),setTimeout(g,4e3)}catch(e){h("Network error while triggering the sync")}finally{u(!1)}}}return(0,a.useEffect)(()=>{g()},[]),(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-6 shadow-sm dark:border-gray-700 dark:bg-gray-800",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-base font-semibold text-gray-900 dark:text-white",children:"Prod → Dev sync"}),(0,s.jsx)("button",{type:"button",onClick:g,className:"text-xs text-gray-500 underline-offset-4 hover:underline disabled:opacity-50 dark:text-gray-400",disabled:o,children:o?"loading…":"refresh"})]}),(0,s.jsx)("p",{className:"mt-2 text-sm text-gray-600 dark:text-gray-300",children:"Atomic template-copy. Both DBs are unreachable for ~1 s; everything resumes after."}),(0,s.jsxs)("div",{className:"mt-6 grid grid-cols-2 gap-4",children:[(0,s.jsx)(l,{label:"Prod (smartcms)",size:null==i||null==(e=i.prod)?void 0:e.size,exists:!0}),(0,s.jsx)(l,{label:"Dev (smartcms_dev)",size:null==i||null==(t=i.dev)?void 0:t.size,exists:null!=(n=null==i||null==(r=i.dev)?void 0:r.exists)&&n})]}),(null==i?void 0:i.error)?(0,s.jsx)("p",{className:"mt-4 rounded-md bg-rose-50 px-3 py-2 text-sm text-rose-700 dark:bg-rose-900/30 dark:text-rose-200",children:i.error}):null,(0,s.jsxs)("div",{className:"mt-6 flex items-center gap-3",children:[(0,s.jsx)("button",{type:"button",onClick:y,disabled:x,className:"rounded-lg bg-gray-900 px-4 py-2 text-sm font-medium text-white shadow-sm transition-colors hover:bg-gray-700 disabled:opacity-50 dark:bg-gray-100 dark:text-gray-900 dark:hover:bg-white",children:x?"running…":"Start sync"}),m?(0,s.jsx)("span",{className:"text-sm text-gray-600 dark:text-gray-300",children:m}):null]})]})}function l(e){let{label:t,size:r,exists:a}=e;return(0,s.jsxs)("div",{className:"rounded-lg border border-gray-200 px-4 py-3 dark:border-gray-700",children:[(0,s.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-gray-500 dark:text-gray-400",children:t}),(0,s.jsx)("p",{className:"mt-1 text-2xl font-bold tabular-nums text-gray-900 dark:text-white",children:a?null!=r?r:"…":"—"}),(0,s.jsx)("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:a?"exists":"missing — created on first sync"})]})}}},e=>{e.O(0,[2619,8441,4696,7358],()=>e(e.s=25132)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.