PageSourceSearch

https://www.campagnesms.com/assets/System-C7fDujkp.js

js campagnesms.com collected 2026-09-27 11:28:55 UTC 6,547 bytes, 12 lines download raw bytes

1import{j as e}from"./ui-Cmju6NLy.js";import{r as Q}from"./react-CHMd0kft.js";import{Z as T,ae as D,m as R,u as C,n as A,C as q,d as M,e as P,k as S,f as F,L as g,av as H,v as I,B as u,I as _,U as c}from"./index-BP7vtUFj.js";import{L as $}from"./label-DMLe-HNg.js";import{A as o,a as h}from"./alert-CdP4XpQ4.js";import{D as B}from"./database-CWDebEBR.js";import{K as G}from"./key-round-Fn5Tl4VO.js";import"./utilities-CdgPAWkA.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const L=T("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const U=T("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);async function p(i,t={}){const{data:a,error:l}=await D.functions.invoke(i,{body:t});if(l)throw new Error(l.message||"Request failed.");if(a&&typeof a=="object"&&"error"in a&&a.error)throw new Error(String(a.error));return a}const z=()=>p("migration-status"),O=()=>p("apply-migrations"),Z=()=>p("secrets-status"),J=(i,t)=>p("secrets-set",{key:i,value:t}),ie=()=>{var b,y,f,v,k;const i=R(),t=C({queryKey:["migration-status"],queryFn:z,retry:!1}),a=A({mutationFn:O,onSuccess:s=>{var w;i.invalidateQueries({queryKey:["migration-status"]}),i.invalidateQueries({queryKey:["admin-users"]});const N=((w=s==null?void 0:s.results)==null?void 0:w.filter(m=>m.status==="error"))??[];N.length?c({title:"Some updates failed",description:N.map(m=>`${m.id}: ${m.message}`).join(" · "),variant:"destructive"}):c({title:"Database up to date",description:"All pending updates have been applied."})},onError:s=>c({title:"Update failed",description:s.message,variant:"destructive"})}),l=C({queryKey:["secrets-status"],queryFn:Z,retry:!1}),[x,j]=Q.useState(""),d=A({mutationFn:s=>J("github_token",s),onSuccess:s=>{j(""),i.invalidateQueries({queryKey:["secrets-status"]}),i.invalidateQueries({queryKey:["publish-status"]}),c({title:s.set?"Token saved":"Token cleared",description:s.set?"The Publish button is now available in the admin header.":"Publishing has been disabled."})},onError:s=>c({title:"Could not save token",description:s.message,variant:"destructive"})}),E=((b=t.data)==null?void 0:b.migrations)??[],r=((y=t.data)==null?void 0:y.pending)??0,K=((f=l.data)==null?void 0:f.available)??!1,n=(k=(v=l.data)==null?void 0:v.secrets)==null?void 0:k.github_token;return e.jsxs("div",{className:"max-w-3xl space-y-6",children:[e.jsxs(q,{children:[e.jsxs(M,{children:[e.jsxs(P,{className:"flex items-center gap-2",children:[e.jsx(B,{className:"h-5 w-5"})," Database updates"]}),e.jsx(S,{children:"Deployments never modify the database, so schema changes that ship with a release are applied here. Applying is safe to repeat — each change is skipped if already present."})]}),e.jsx(F,{className:"space-y-4",children:t.isLoading?e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(g,{className:"h-4 w-4 animate-spin"})," Checking…"]}):t.isError?e.jsx(o,{variant:"destructive",children:e.jsxs(h,{children:["Could not read the database status: ",t.error.message]})}):e.jsxs(e.Fragment,{children:[r===0?e.jsx(o,{children:e.jsxs(h,{className:"flex items-center gap-2",children:[e.jsx(L,{className:"h-4 w-4 text-green-600"}),"The database is up to date."]})}):e.jsx(o,{children:e.jsxs(h,{className:"flex items-center gap-2",children:[e.jsx(H,{className:"h-4 w-4 text-amber-500"}),r," update",r===1?"":"s"," pending."]})}),e.jsx("ul",{className:"divide-y rounded-md border",children:E.map(s=>e.jsxs("li",{className:"flex items-start justify-between gap-4 p-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-medium",children:s.title}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.detail})]}),e.jsx(I,{variant:"outline",className:s.applied?"shrink-0 border-green-300 bg-green-50 text-green-700 dark:bg-green-900/20 dark:text-green-300":"shrink-0 border-amber-300 bg-amber-50 text-amber-700 dark:bg-amber-900/20 dark:text-amber-300",children:s.applied?"Applied":"Pending"})]},s.id))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(u,{onClick:()=>a.mutate(),disabled:a.isPending||r===0,children:[a.isPending&&e.jsx(g,{className:"mr-2 h-4 w-4 animate-spin"}),r===0?"Nothing to apply":`Apply ${r} update${r===1?"":"s"}`]}),e.jsxs(u,{variant:"outline",onClick:()=>t.refetch(),disabled:t.isFetching,children:[e.jsx(U,{className:"mr-2 h-4 w-4"})," Re-check"]})]})]})})]}),e.jsxs(q,{children:[e.jsxs(M,{children:[e.jsxs(P,{className:"flex items-center gap-2",children:[e.jsx(G,{className:"h-5 w-5"})," Publishing"]}),e.jsx(S,{children:"The public site is prerendered to static HTML at build time for SEO. A GitHub token lets the “Publish site” button rebuild it after you edit content."})]}),e.jsx(F,{className:"space-y-4",children:K?e.jsxs(e.Fragment,{children:[(n==null?void 0:n.set)&&e.jsx(o,{children:e.jsxs(h,{className:"flex items-center gap-2",children:[e.jsx(L,{className:"h-4 w-4 text-green-600"}),"A token is stored (ending ",n.hint,"). Saving a new one replaces it."]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx($,{htmlFor:"gh-token",children:"GitHub personal access token"}),e.jsx(_,{id:"gh-token",type:"password",value:x,onChange:s=>j(s.target.value),placeholder:"github_pat_…",autoComplete:"off"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Create a fine-grained token limited to this repository with"," ",e.jsx("strong",{children:"Actions: read and write"}),". It is stored server-side and is never sent back to the browser."]}
11)]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(u,{onClick:()=>d.mutate(x),disabled:d.isPending||!x.trim(),children:[d.isPending&&e.jsx(g,{className:"mr-2 h-4 w-4 animate-spin"}),"Save token"]}),(n==null?void 0:n.set)&&e.jsx(u,{variant:"outline",onClick:()=>d.mutate(""),disabled:d.isPending,children:"Remove token"})]})]}):e.jsx(o,{children:e.jsx(h,{children:"Apply the pending database update above first — the secure settings store is created by it."})})})]})]})};export{ie as default};
12//# sourceMappingURL=System-C7fDujkp.js.map

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.