@canonry/canonry 7.108.3 → 7.110.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/agent-workspace/skills/aero/references/orchestration.md +2 -2
- package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +11 -3
- package/assets/assets/{AccessControls-B6bkOAge.js → AccessControls-DmKPF5t5.js} +2 -2
- package/assets/assets/{AgentSetupPage-H8VoauIK.js → AgentSetupPage-BvoJ7cu0.js} +1 -1
- package/assets/assets/{AuditHistoryPanel-Cmm537Mw.js → AuditHistoryPanel-GHjaPPXk.js} +1 -1
- package/assets/assets/{BacklinksPage-Dg6IJr83.js → BacklinksPage-Ca3l7bel.js} +1 -1
- package/assets/assets/{ChartPrimitives-C1meaNiX.js → ChartPrimitives-CJLgYfSw.js} +1 -1
- package/assets/assets/{HistoryPage-DMmZ0fSd.js → HistoryPage-HqdlYIsd.js} +1 -1
- package/assets/assets/{MeasurementPropertyPage-x4S_SV30.js → MeasurementPropertyPage-D71Ki-q4.js} +1 -1
- package/assets/assets/ProjectPage-wGYGNnLC.js +15 -0
- package/assets/assets/{RunsPage-DG43ZJib.js → RunsPage-CeXFTDg4.js} +1 -1
- package/assets/assets/{ServerTrafficSection-B-QGjFGD.js → ServerTrafficSection-BZVlcCO2.js} +1 -1
- package/assets/assets/{SettingsPage-CJlAiPn3.js → SettingsPage-MiW1TGtF.js} +1 -1
- package/assets/assets/ToneBadge-BXxSLZUc.js +60 -0
- package/assets/assets/{TrafficPage-Dlp26Fvy.js → TrafficPage-1ZXZ2BLa.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-D-x32dzk.js → TrafficSourceDetailPage-BJPiUWus.js} +1 -1
- package/assets/assets/{account-context-C66suepK.js → account-context-DHUo7ntg.js} +1 -1
- package/assets/assets/{agent-trust-copy-BKQRIoVJ.js → agent-trust-copy-x8ECjEJu.js} +1 -1
- package/assets/assets/{card-iPmHn3JZ.js → card-bE38V9NH.js} +1 -1
- package/assets/assets/{index-C05Wdzzv.js → index-Ce3zYiH3.js} +15 -15
- package/assets/assets/{query-client-D_jULVYr.js → query-client-CBtgvGgy.js} +1 -1
- package/assets/assets/{react-query-ih29UP0I.js → react-query-CsgUn_pT.js} +1 -1
- package/assets/assets/{react-sigma_core.esm.min-sHrGO6oc.js → react-sigma_core.esm.min-DeLn6mIk.js} +1 -1
- package/assets/assets/{server-traffic-BScF0-_t.js → server-traffic-Dwwd7cw6.js} +1 -1
- package/assets/assets/{service-DYJdF5mP.js → service-Bq_5mBI4.js} +1 -1
- package/assets/index.html +8 -8
- package/dist/{ads-ZU44TW6I.js → ads-VITOHLIW.js} +3 -3
- package/dist/{agent-R5WTIW7T.js → agent-N57IKFTH.js} +10 -10
- package/dist/{agent-ask-YDKBWYQG.js → agent-ask-VPK4ED7D.js} +3 -3
- package/dist/{agent-conversations-QJOBINIB.js → agent-conversations-DPEGQ5NJ.js} +3 -3
- package/dist/{agent-journeys-4GGOACCO.js → agent-journeys-7AS543HY.js} +3 -3
- package/dist/{agent-memory-3YG553SD.js → agent-memory-OKKNU2MA.js} +3 -3
- package/dist/{agent-providers-TVVMJQN7.js → agent-providers-JZGGMH5H.js} +3 -3
- package/dist/{agent-transcript-RZC6273N.js → agent-transcript-AICHEB4B.js} +3 -3
- package/dist/{analytics-U4TVQGMD.js → analytics-FXNYSIAY.js} +3 -3
- package/dist/{apply-GVBOUXIO.js → apply-DYYB2I2S.js} +3 -3
- package/dist/{backfill-5FQEVO4U.js → backfill-CXKKDOST.js} +10 -10
- package/dist/{backlinks-YGCLFL6X.js → backlinks-442C4H4M.js} +3 -3
- package/dist/{bing-LT62N7BY.js → bing-HRSXPL7O.js} +3 -3
- package/dist/{bootstrap-XSFNQARX.js → bootstrap-U5UVQDHJ.js} +10 -10
- package/dist/{cdp-5MY2I2N3.js → cdp-JSOEQZJJ.js} +7 -7
- package/dist/{chunk-VYIM2IUO.js → chunk-35H5E662.js} +1 -1
- package/dist/{chunk-C5PWXO5G.js → chunk-3AVO5OWE.js} +26 -1
- package/dist/{chunk-2QJP2EKJ.js → chunk-3WAGCCAO.js} +1 -1
- package/dist/{chunk-SDF6U4XX.js → chunk-4CTVYOBQ.js} +1 -1
- package/dist/{chunk-VQIEAP5U.js → chunk-5RMDU4MM.js} +6 -6
- package/dist/{chunk-R25V7AQG.js → chunk-5SN2O7QH.js} +1 -1
- package/dist/{chunk-LDYUNH5Q.js → chunk-66OTF2QQ.js} +586 -353
- package/dist/{chunk-E3B4JEYL.js → chunk-7GU4F2QO.js} +2 -2
- package/dist/{chunk-PQL22SU6.js → chunk-A334LHJ7.js} +3 -3
- package/dist/{chunk-ZVCDFSFW.js → chunk-DMCJJ5FT.js} +3 -3
- package/dist/{chunk-VSYYI634.js → chunk-ES7XSOBY.js} +1 -1
- package/dist/{chunk-XZ25DG73.js → chunk-EU6JYD3C.js} +5 -5
- package/dist/{chunk-XHFLXURT.js → chunk-FEIDW5BU.js} +69 -1
- package/dist/{chunk-VHESSGBR.js → chunk-FRKHFU6D.js} +5 -5
- package/dist/{chunk-TV6CKQ2M.js → chunk-HGKB6J7I.js} +4 -4
- package/dist/{chunk-QGGHCVKX.js → chunk-HH4XK3FX.js} +1 -1
- package/dist/{chunk-JKXLOSXJ.js → chunk-HX4KJWQO.js} +3 -3
- package/dist/{chunk-A2XEI5JG.js → chunk-JJ7RXQ2W.js} +2 -2
- package/dist/{chunk-QRYPKPBN.js → chunk-JXFFKZOI.js} +2 -2
- package/dist/{chunk-NWKFGMF3.js → chunk-M7R7GSO5.js} +2 -2
- package/dist/{chunk-NXX3E7JX.js → chunk-ME74SV2T.js} +1 -1
- package/dist/{chunk-F5KJWMYH.js → chunk-OJYY6W5S.js} +1432 -1202
- package/dist/{chunk-7XJZM7F5.js → chunk-Q3IXAH34.js} +1 -1
- package/dist/{chunk-QHNM2UTO.js → chunk-QIGC5JGR.js} +4 -4
- package/dist/{chunk-ZBNFFCA5.js → chunk-QXBHZSOW.js} +3 -3
- package/dist/{chunk-SAAYXL6V.js → chunk-RHY7GL5R.js} +2 -2
- package/dist/{chunk-DJA35P57.js → chunk-S2I5FPQC.js} +1 -1
- package/dist/{chunk-E4WDOYDS.js → chunk-TV6BFBRI.js} +4 -4
- package/dist/{chunk-UMPRDHNQ.js → chunk-UC2LPOW4.js} +1 -1
- package/dist/chunk-UX3HJV2V.js +12 -0
- package/dist/{chunk-OQ4BIGR5.js → chunk-VDAC54IW.js} +4 -4
- package/dist/{chunk-DHPVTGOX.js → chunk-VYPDVWRG.js} +1 -1
- package/dist/{chunk-BUJD4PDG.js → chunk-XS3S3UQE.js} +7 -7
- package/dist/{chunk-3T5N2K7K.js → chunk-YKEXZBB4.js} +1 -1
- package/dist/{chunk-BPGQZNU6.js → chunk-ZABO7FFF.js} +8 -11
- package/dist/{chunk-HASKRW5X.js → chunk-ZVKWDSKW.js} +2 -2
- package/dist/{chunk-FCKYBJCJ.js → chunk-ZVLZ7YFW.js} +366 -366
- package/dist/{citations-YW5QU7GI.js → citations-A6QP2QOT.js} +4 -4
- package/dist/{cli-catalog-VSPAEL7Y.js → cli-catalog-OJT3WVRE.js} +3 -3
- package/dist/{cli-commands-GJD73IE6.js → cli-commands-KQQPOXIP.js} +7 -7
- package/dist/cli.js +13 -13
- package/dist/{competitor-KUG7ZH4D.js → competitor-AY5SURO6.js} +3 -3
- package/dist/{content-SE7WEAKG.js → content-UZJF7XQV.js} +3 -3
- package/dist/{dashboard-43VOXHID.js → dashboard-IXNMMT5P.js} +6 -6
- package/dist/{demo-TWI6ROFX.js → demo-Y7DDERG7.js} +1 -1
- package/dist/{demo-server-AQKTQ6AW.js → demo-server-PNPTTPGQ.js} +13 -12
- package/dist/{discover-X65CLZYY.js → discover-45FOFNGO.js} +4 -4
- package/dist/{discover-eval-R4XVP5LH.js → discover-eval-CJ5G32A6.js} +3 -3
- package/dist/{doctor-VUBA5CN3.js → doctor-2R4J6QC7.js} +3 -3
- package/dist/{evidence-UIFGERY4.js → evidence-HDUJMIIR.js} +3 -3
- package/dist/{export-cmd-6RTU5OZG.js → export-cmd-3AXP4C3S.js} +3 -3
- package/dist/{ga-AZG7BHWQ.js → ga-RYK2FEEH.js} +3 -3
- package/dist/{gbp-FBC5KMEQ.js → gbp-TAA3TNDA.js} +16 -5
- package/dist/{google-6TQ4YWAS.js → google-62PQ4SMC.js} +4 -4
- package/dist/{google-marketing-7MPF6LFW.js → google-marketing-UWGFDUUZ.js} +1 -1
- package/dist/{health-cmd-Y5ZQ4TLG.js → health-cmd-ZDHMZLYQ.js} +4 -4
- package/dist/{history-YGGU2RYB.js → history-RVBQUMCX.js} +3 -3
- package/dist/index.d.ts +91 -7
- package/dist/index.js +26 -25
- package/dist/{init-Z64A6CBW.js → init-XP3J3HPB.js} +12 -12
- package/dist/{insights-7XFNQHTX.js → insights-I2YS7U6L.js} +3 -3
- package/dist/intelligence-service-OHEFN77N.js +16 -0
- package/dist/{journeys-PDWXN3IM.js → journeys-BELWHYCZ.js} +3 -3
- package/dist/{keys-BKNJETWE.js → keys-XDILBZFM.js} +3 -3
- package/dist/{keyword-Z37NIEW4.js → keyword-BQ4ECK2Z.js} +3 -3
- package/dist/{logs-ENWHNCTC.js → logs-UAZUYRCJ.js} +3 -3
- package/dist/{mcp-MV2VUJ4E.js → mcp-4262JRAS.js} +4 -4
- package/dist/mcp.js +10 -9
- package/dist/{measurement-plan-AWNVH5MW.js → measurement-plan-D4DFV7XU.js} +5 -5
- package/dist/{notify-ZAFR4B47.js → notify-TIAGVEYL.js} +12 -22
- package/dist/{organic-evidence-ZK5IAVLI.js → organic-evidence-2TUODD26.js} +3 -3
- package/dist/{overview-ZFZYSJPU.js → overview-WP2DO3GW.js} +5 -5
- package/dist/{project-HPZQGUR7.js → project-OOUUH5QM.js} +3 -3
- package/dist/{project-setup-CEVH6KLJ.js → project-setup-HBKPIBNL.js} +3 -3
- package/dist/{query-TOOIX2PP.js → query-M7XT5UL3.js} +3 -3
- package/dist/{research-HYJ76XNV.js → research-O36LMQ6N.js} +3 -3
- package/dist/{results-export-2MMDPWIU.js → results-export-EQWWL2FH.js} +3 -3
- package/dist/{run-NNYEDFEF.js → run-2I7SGZWI.js} +5 -5
- package/dist/{schedule-S5W3XMP3.js → schedule-UIPFPM64.js} +3 -3
- package/dist/{search-CPOTR6WQ.js → search-L3BSPUWL.js} +3 -3
- package/dist/{serve-5Y342F64.js → serve-CKQIXMZH.js} +27 -26
- package/dist/{session-WWV5MXI4.js → session-JMUEO4JX.js} +14 -13
- package/dist/{settings-4UFTKOY4.js → settings-CCYLUD6M.js} +3 -3
- package/dist/{sitemaps-FAZT7L64.js → sitemaps-QKEA3DLO.js} +3 -3
- package/dist/{skills-K5RXHUIL.js → skills-6QCTDYJX.js} +2 -2
- package/dist/{snapshot-JM2B2WXU.js → snapshot-SPVUDPYM.js} +3 -3
- package/dist/{src-UU4CGSEN.js → src-TV6FYYJC.js} +4 -2
- package/dist/{status-DYJPL4WJ.js → status-FU5K5ZIP.js} +5 -5
- package/dist/{technical-aeo-XSLLHFE5.js → technical-aeo-A2UNMVHB.js} +3 -3
- package/dist/{telemetry-26GTSZNT.js → telemetry-4UAREPKB.js} +4 -4
- package/dist/{tools-QR2RY6LW.js → tools-OLOHKI7B.js} +12 -11
- package/dist/{traffic-OF52YJKX.js → traffic-3TQUDBQB.js} +5 -5
- package/dist/{trends-SECIYTNL.js → trends-IHC2MH5V.js} +3 -3
- package/dist/{users-ZM7IR4US.js → users-TYU5PIYM.js} +3 -3
- package/dist/{visibility-stats-V5P4CZO4.js → visibility-stats-BWJF57ON.js} +4 -4
- package/dist/{wordpress-Z32JMXJK.js → wordpress-T4CVB32J.js} +3 -3
- package/package.json +1 -1
- package/assets/assets/ProjectPage-DnDw0Cvk.js +0 -15
- package/assets/assets/ToneBadge-BkNG9buI.js +0 -60
- package/dist/intelligence-service-3U6RMPRG.js +0 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{ft as t}from"./vendor-lucide-iE5MEh2-.js";import{a as n,i as r,o as i,r as a,s as o,t as s}from"./vendor-radix-DKCt5Z_h.js";import{r as c}from"./vendor-markdown-BBGbNklj.js";import{d as l,f as u,x as d}from"./vendor-tanstack-16u6cATb.js";import{At as f,_c as p,bt as m,gc as h,kt as g,r as _}from"./ToneBadge-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{ft as t}from"./vendor-lucide-iE5MEh2-.js";import{a as n,i as r,o as i,r as a,s as o,t as s}from"./vendor-radix-DKCt5Z_h.js";import{r as c}from"./vendor-markdown-BBGbNklj.js";import{d as l,f as u,x as d}from"./vendor-tanstack-16u6cATb.js";import{At as f,_c as p,bt as m,gc as h,kt as g,r as _}from"./ToneBadge-BXxSLZUc.js";import{n as v}from"./AccessControls-DmKPF5t5.js";import{I as y}from"./ChartPrimitives-CJLgYfSw.js";import{a as b}from"./query-client-CBtgvGgy.js";import{Cn as x,bn as S}from"./react-query-CsgUn_pT.js";import{t as C}from"./InfoTooltip-D29JcNMW.js";import{t as w}from"./card-bE38V9NH.js";import{Ct as T,M as E,jt as D,lt as O,r as k,rt as A,ut as j}from"./index-Ce3zYiH3.js";var M=e(t(),1),N=c(),P={"30d":{label:`Last 30 days`,days:30},"90d":{label:`Last 90 days`,days:90},"365d":{label:`Last year`,days:365}};function F(e){return new Date(Date.now()-P[e].days*24*60*60*1e3).toISOString()}function I({open:e,projectCount:t,pending:c,onOpenChange:l,onConfirm:u,onClosed:d}){let f=t===1;return(0,N.jsx)(s,{open:e,onOpenChange:l,children:(0,N.jsxs)(i,{children:[(0,N.jsx)(n,{className:`fixed inset-0 z-50 bg-overlay-scrim/70 backdrop-blur-sm`}),(0,N.jsxs)(a,{className:`material-modal fixed left-1/2 top-1/2 z-50 max-h-[85dvh] w-[calc(100%-2rem)] max-w-xl -translate-x-1/2 -translate-y-1/2 overflow-y-auto p-5`,onCloseAutoFocus:e=>{e.preventDefault(),d()},children:[(0,N.jsxs)(`div`,{className:`space-y-2`,children:[(0,N.jsx)(o,{className:`text-heading-20 text-heading`,children:`Review AI Visibility checks`}),(0,N.jsx)(r,{className:`text-copy-14 text-secondary`,children:f?`Checks 1 project. It runs its saved queries on its selected engines. Provider charges apply.`:`Checks all ${t} projects. Each runs its saved queries on its selected engines. Provider charges apply.`})]}),(0,N.jsx)(`p`,{className:`mt-4 text-copy-13 text-secondary`,children:`Runs once. Schedules stay unchanged. Projects already running or not set up are skipped.`}),(0,N.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-3`,children:[(0,N.jsx)(_,{type:`button`,variant:`outline`,onClick:()=>l(!1),children:`Cancel`}),(0,N.jsx)(v,{type:`button`,disabled:c,onClick:u,children:c?`Queueing…`:`Run ${t} ${f?`project`:`projects`}`})]})]})]})})}function L(){let e=O()?.dashboard,t=u({strict:!1}),n=l(),r=Object.values(p).includes(t.runStatus)?t.runStatus:`all`,i=Object.values(h).includes(t.runKind)?t.runKind:`all`,a=t.runProject??`all`,o=Object.hasOwn(P,t.runWindow??``)?t.runWindow:`30d`,s=t.runQuery??``,c=(0,M.useMemo)(()=>F(o),[o]),L=d({...S({client:m}),initialData:e?.projects.map(({project:e})=>e),initialDataUpdatedAt:0}),R=d({...x({client:m,query:{limit:1e3,since:c}}),initialData:e?.runs,initialDataUpdatedAt:0,staleTime:b,refetchInterval:e=>e.state.data?.some(e=>e.status===p.queued||e.status===p.running)?3e3:b}),z=k(),[B,V]=(0,M.useState)(!1),H=(0,M.useRef)(null),U=(0,M.useMemo)(()=>new Map((L.data??[]).map(e=>[e.id,e.displayName||e.name])),[L.data]),W=(0,M.useMemo)(()=>(R.data??[]).map(e=>`projectName`in e?e:j(e,U.get(e.projectId)??`Unknown project`)),[U,R.data]),G=s.trim().toLowerCase(),K=W.filter(e=>r!==`all`&&e.status!==r||i!==`all`&&e.kind!==i||a!==`all`&&e.projectId!==a?!1:!G||[e.summary,e.projectName,e.kindLabel,e.statusDetail].some(e=>e.toLowerCase().includes(G))),q=r!==`all`||i!==`all`||a!==`all`||s.trim()!==``||o!==`30d`,J=e=>{n({to:`/runs`,search:t=>({...t,...e}),replace:!0})};if(L.isLoading||R.isLoading)return(0,N.jsxs)(`div`,{className:`page-skeleton`,children:[(0,N.jsxs)(`div`,{className:`page-skeleton-header`,children:[(0,N.jsx)(`div`,{className:`skeleton-text h-6 w-20`}),(0,N.jsx)(`div`,{className:`skeleton-text-sm w-72`})]}),(0,N.jsx)(`div`,{className:`space-y-2`,children:[1,2,3,4].map(e=>(0,N.jsxs)(`div`,{className:`material-base p-3 flex items-center gap-3`,children:[(0,N.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,N.jsx)(`div`,{className:`skeleton-text w-40`}),(0,N.jsx)(`div`,{className:`skeleton-text-sm w-56`})]}),(0,N.jsx)(`div`,{className:`skeleton h-5 w-16 rounded-full`})]},e))})]});let Y=L.data?.length??0,X=async()=>{try{await z.mutateAsync(void 0),V(!1)}catch{}};return(0,N.jsxs)(`div`,{className:`page-container`,children:[(0,N.jsxs)(`div`,{className:`page-header`,children:[(0,N.jsxs)(`div`,{className:`page-header-left`,children:[(0,N.jsx)(`h1`,{className:`page-title`,children:`Runs`}),(0,N.jsx)(`p`,{className:`page-subtitle`,children:`Recent jobs across all projects.`})]}),!f()&&(g()?(0,N.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`AI Visibility checks are run by your Canonry team`}):Y>0?(0,N.jsx)(v,{type:`button`,variant:`outline`,size:`sm`,"aria-haspopup":`dialog`,onClick:e=>{H.current=e.currentTarget,V(!0)},children:`Run all projects`}):null)]}),!f()&&!g()?(0,N.jsx)(I,{open:B,projectCount:Y,pending:z.isPending,onOpenChange:V,onConfirm:()=>void X(),onClosed:()=>H.current?.focus()}):null,(0,N.jsxs)(`section`,{children:[(0,N.jsxs)(`div`,{className:`run-filters`,role:`group`,"aria-label":`Run filters`,children:[(0,N.jsx)(`input`,{type:`search`,"aria-label":`Search runs`,value:s,onChange:e=>J({runQuery:e.target.value||void 0}),placeholder:`Search runs or projects`,className:`run-filter-control`}),(0,N.jsxs)(`select`,{"aria-label":`Filter runs by status`,value:r,onChange:e=>J({runStatus:e.target.value===`all`?void 0:e.target.value}),className:`run-filter-control`,children:[(0,N.jsx)(`option`,{value:`all`,children:`All statuses`}),Object.values(p).map(e=>(0,N.jsx)(`option`,{value:e,children:y(e)},e))]}),(0,N.jsxs)(`select`,{"aria-label":`Filter runs by project`,value:a,onChange:e=>J({runProject:e.target.value===`all`?void 0:e.target.value}),className:`run-filter-control`,children:[(0,N.jsx)(`option`,{value:`all`,children:`All projects`}),(L.data??[]).map(e=>(0,N.jsx)(`option`,{value:e.id,children:e.displayName||e.name},e.id))]}),(0,N.jsxs)(`select`,{"aria-label":`Filter runs by type`,value:i,onChange:e=>J({runKind:e.target.value===`all`?void 0:e.target.value}),className:`run-filter-control`,children:[(0,N.jsx)(`option`,{value:`all`,children:`All run types`}),Object.values(h).map(e=>(0,N.jsx)(`option`,{value:e,children:A(e)},e))]}),(0,N.jsx)(`select`,{"aria-label":`Filter runs by date range`,value:o,onChange:e=>J({runWindow:e.target.value===`30d`?void 0:e.target.value}),className:`run-filter-control`,children:Object.entries(P).map(([e,t])=>(0,N.jsx)(`option`,{value:e,children:t.label},e))}),q?(0,N.jsx)(_,{type:`button`,variant:`ghost`,onClick:()=>J({runStatus:void 0,runKind:void 0,runProject:void 0,runWindow:void 0,runQuery:void 0}),children:`Clear filters`}):null]}),R.isError?(0,N.jsxs)(w,{className:`surface-card empty-card`,children:[(0,N.jsx)(`h2`,{children:`Run history unavailable`}),(0,N.jsx)(`p`,{children:D(R.error)}),(0,N.jsx)(_,{variant:`outline`,onClick:()=>void R.refetch(),children:`Try again`})]}):null,!R.isError&&K.length>0?(0,N.jsx)(`div`,{className:`data-table-wrapper`,children:(0,N.jsxs)(`table`,{className:`data-table runs-table`,children:[(0,N.jsx)(`caption`,{className:`sr-only`,children:`Recent runs across projects`}),(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`th`,{scope:`col`,children:`Run`}),(0,N.jsx)(`th`,{scope:`col`,children:`Project`}),(0,N.jsx)(`th`,{scope:`col`,children:`Status`}),(0,N.jsx)(`th`,{scope:`col`,children:`Started`}),(0,N.jsx)(`th`,{scope:`col`,children:`Duration`}),(0,N.jsx)(`th`,{scope:`col`,children:`Trigger`})]})}),(0,N.jsx)(`tbody`,{children:K.map(e=>(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`td`,{children:(0,N.jsx)(E,{run:e,projectName:L.data?.find(t=>t.id===e.projectId)?.name,className:`text-link text-label-14-strong text-left`,label:`View ${e.summary} for ${e.projectName}`,children:e.kindLabel})}),(0,N.jsxs)(`td`,{children:[(0,N.jsx)(`span`,{className:`text-primary`,children:e.projectName}),e.location?(0,N.jsx)(`span`,{className:`block text-copy-13 text-secondary`,children:e.location}):null]}),(0,N.jsx)(`td`,{children:(0,N.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,N.jsx)(T,{status:e.status}),(0,N.jsx)(C,{text:e.statusDetail})]})}),(0,N.jsx)(`td`,{className:`whitespace-nowrap tabular-nums`,children:e.startedAt}),(0,N.jsx)(`td`,{className:`whitespace-nowrap tabular-nums`,children:e.duration}),(0,N.jsx)(`td`,{className:`whitespace-nowrap`,children:e.triggerLabel})]},e.id))})]})}):R.isError?null:(0,N.jsxs)(w,{className:`surface-card empty-card`,children:[(0,N.jsx)(`h2`,{children:q?`No runs match these filters`:`No recent runs`}),(0,N.jsx)(`p`,{children:q?`Change or clear the filters to see more runs.`:`Start a check from a project, or choose a wider date range.`})]})]})]})}export{L as RunsPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{C as t,H as n,W as r,f as i,ft as a,it as o,lt as s,o as c,q as l,tt as u,ut as d,z as f}from"./vendor-lucide-iE5MEh2-.js";import{r as p}from"./vendor-markdown-BBGbNklj.js";import{S as m,d as h,u as g}from"./vendor-tanstack-16u6cATb.js";import{At as _,Cn as ee,bt as te,r as v,t as y}from"./ToneBadge-BkNG9buI.js";import{t as ne}from"./async-handler-Bj3TnIRw.js";import{d as re}from"./query-client-D_jULVYr.js";import{hn as ie}from"./react-query-ih29UP0I.js";import{t as b}from"./InfoTooltip-D29JcNMW.js";import{t as x}from"./card-iPmHn3JZ.js";import{St as S,Ut as C,bt as w,j as T,jt as E,vt as D,xt as O,yt as k}from"./index-C05Wdzzv.js";import{i as A,n as ae,r as oe,s as se,t as ce}from"./server-traffic-BScF0-_t.js";var j=e(a(),1),M=p();function le({open:e,onOpenChange:t,onClosed:n,projectName:r}){let[i,a]=(0,j.useState)(`pick`);(0,j.useEffect)(()=>{e&&a(`pick`)},[e]);let o=()=>{t(!1),a(`pick`)};return(0,M.jsx)(D,{open:e,onOpenChange:e=>{e?t(!0):o()},children:(0,M.jsx)(k,{onCloseAutoFocus:e=>{n&&(e.preventDefault(),n())},children:i===`pick`?(0,M.jsx)(de,{onPick:a}):i===`cloudflare`?(0,M.jsx)(he,{projectName:r,onBack:()=>a(`pick`),onClose:o}):i===`wordpress`?(0,M.jsx)(L,{projectName:r,onBack:()=>a(`pick`),onClose:o}):i===`vercel`?(0,M.jsx)(z,{projectName:r,onBack:()=>a(`pick`),onClose:o}):(0,M.jsx)(R,{projectName:r,onBack:()=>a(`pick`),onClose:o})})})}var ue=[{type:`cloudflare`,name:`Cloudflare`,needs:`A zone you manage. Set up from the terminal.`,icon:i},{type:`wordpress`,name:`WordPress`,needs:`wp-admin access to install a plugin`,icon:f},{type:`vercel`,name:`Vercel`,needs:`A Vercel access token`,icon:c},{type:`cloud-run`,name:`Google Cloud Run`,needs:`A service account that can read logs`,icon:l}];function de({onPick:e}){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(O,{children:[(0,M.jsx)(S,{children:`Connect a traffic source`}),(0,M.jsx)(w,{children:`Pick where your site runs. Canonry reads AI crawler visits and AI referrals from there.`})]}),(0,M.jsx)(`div`,{className:`mt-6 flex flex-col gap-3`,children:ue.map(({type:t,name:n,needs:r,icon:i})=>(0,M.jsxs)(`button`,{type:`button`,onClick:()=>e(t),className:`group flex items-center gap-3 rounded-md border border-base bg-bg-elevated/30 px-3 py-3 text-left transition-colors hover:border-mono-600 hover:bg-bg-elevated/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:[(0,M.jsx)(`span`,{className:`mt-0.5 inline-flex size-9 shrink-0 items-center justify-center rounded-md border border-base bg-bg text-neutral group-hover:text-heading`,children:(0,M.jsx)(i,{className:`size-4`})}),(0,M.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,M.jsx)(`span`,{className:`text-label-14-strong text-heading`,children:n}),(0,M.jsx)(`span`,{className:`text-label-13 text-secondary`,children:r})]})]},t))}),(0,M.jsx)(`p`,{className:`mt-6 text-copy-13 text-secondary`,children:`Your agent can set up any of these for you. Pick a source to copy instructions for it.`})]})}function N({title:e,description:t,onBack:n}){return(0,M.jsxs)(O,{children:[(0,M.jsxs)(`button`,{type:`button`,onClick:n,className:`mb-1 inline-flex w-fit items-center gap-1 rounded text-button-14 text-secondary transition-colors hover:text-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:[(0,M.jsx)(d,{className:`size-3`}),`Choose a different source`]}),(0,M.jsx)(S,{children:e}),(0,M.jsx)(w,{children:t})]})}function P(e,t){let n=h();return async(r,i)=>{i.startInitialBackfill&&await ee(e,r),i.afterConnected?.(),t(),n({to:`/traffic/$projectName/$sourceId`,params:{projectName:e,sourceId:r}})}}function F(e,t){let[n,r]=(0,j.useState)(null),i=P(e,t);return{error:n,runConnect:async e=>{r(null);let t=e.validate();if(t){r(t);return}let n;try{n=await e.mutate()}catch(e){r(E(e));return}try{await i(n.id,{startInitialBackfill:e.startInitialBackfill??!0,afterConnected:e.onConnected})}catch(e){r(`Source connected, but starting the initial backfill failed: ${E(e)}`)}}}}function I({title:e,description:t,projectName:n,onBack:r,onClose:i,onSubmit:a,isPending:o,error:s,guide:c,children:l}){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(N,{title:e,description:t,onBack:r}),(0,M.jsxs)(`div`,{className:`-mr-1 mt-6 min-h-0 flex-1 overflow-y-auto pr-1`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,M.jsx)(X,{request:c.agentRequest,docsUrl:c.docsUrl}),(0,M.jsx)(Z,{steps:c.steps})]}),(0,M.jsxs)(`form`,{onSubmit:ne(async e=>{e.preventDefault(),await a()}),className:`mt-6 flex flex-col gap-5 border-t border-default pt-5`,children:[(0,M.jsxs)(`p`,{className:`text-copy-14-strong text-heading`,children:[`Then connect it to `,(0,M.jsx)(`span`,{className:`text-label-13-mono`,children:n})]}),l,s?(0,M.jsx)(`p`,{className:`rounded-md border border-negative-800/50 bg-negative-950/30 px-3 py-2 text-copy-13 text-negative-200`,children:s}):null,(0,M.jsxs)(`div`,{className:`mt-2 flex items-center justify-end gap-2 border-t border-default pt-4`,children:[(0,M.jsx)(v,{type:`button`,variant:`ghost`,size:`sm`,onClick:i,children:`Close`}),(0,M.jsx)(v,{type:`submit`,disabled:o,size:`sm`,children:o?`Connecting…`:`Connect`})]})]})]})]})}function L({projectName:e,onBack:t,onClose:n}){let[r,i]=(0,j.useState)(``),[a,o]=(0,j.useState)(``),[s,c]=(0,j.useState)(``),[l,u]=(0,j.useState)(``),d=A(e||null),{error:f,runConnect:p}=F(e,n);return(0,M.jsxs)(I,{title:`Connect a WordPress site`,description:(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`Reads AI crawler visits from the Canonry Traffic Logger plugin.`,(0,M.jsx)(b,{text:`${K(`Application Password`)} Pages served from a full-page cache never reach the plugin, so exclude AI crawlers from your cache. The docs list the user agents.`})]}),guide:Y(e,r),projectName:e,onBack:t,onClose:n,onSubmit:()=>p({validate:()=>r.trim()?a.trim()?s.trim()?null:`Application Password is required.`:`Username is required.`:`WordPress site URL is required.`,mutate:()=>d.mutateAsync({baseUrl:r.trim(),username:a.trim(),applicationPassword:s.trim(),displayName:l.trim()||void 0}),onConnected:()=>c(``)}),isPending:d.isPending,error:f,children:[(0,M.jsx)(B,{label:`WordPress site URL`,description:`Base URL of the site running the Canonry Traffic Logger plugin.`,required:!0,children:(0,M.jsx)(`input`,{type:`url`,value:r,onChange:e=>i(e.target.value),required:!0,autoComplete:`url`,placeholder:`https://example.com`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})}),(0,M.jsx)(B,{label:`Username`,description:`WordPress user that owns the Application Password.`,required:!0,children:(0,M.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),required:!0,autoComplete:`username`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})}),(0,M.jsx)(B,{label:`Application Password`,description:`Create one in wp-admin under Users -> Profile -> Application Passwords.`,required:!0,children:(0,M.jsx)(`input`,{type:`password`,value:s,onChange:e=>c(e.target.value),required:!0,autoComplete:`new-password`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})}),(0,M.jsx)(Q,{children:(0,M.jsx)(B,{label:`Display name (optional)`,description:`Friendly label shown in the dashboard. Defaults to the WordPress host.`,children:(0,M.jsx)(`input`,{type:`text`,value:l,onChange:e=>u(e.target.value),autoComplete:`off`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})})})]})}function R({projectName:e,onBack:t,onClose:n}){let[r,i]=(0,j.useState)(``),[a,o]=(0,j.useState)(``),[s,c]=(0,j.useState)(``),[l,u]=(0,j.useState)(``),[d,f]=(0,j.useState)(``),p=ae(e||null),{error:m,runConnect:h}=F(e,n),g=()=>h({validate:()=>r.trim()?d.trim()?null:`Service-account JSON content is required.`:`GCP project ID is required.`,mutate:()=>p.mutateAsync({gcpProjectId:r.trim(),serviceName:a.trim()||void 0,location:s.trim()||void 0,displayName:l.trim()||void 0,keyJson:d.trim()}),onConnected:()=>f(``)}),_=async e=>{if(!e)return;let t=await e.text();f(t)};return(0,M.jsxs)(I,{title:`Connect a Cloud Run service`,description:(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`Reads AI crawler visits from your Cloud Run request logs.`,(0,M.jsx)(b,{text:K(`service-account private key`)})]}),guide:pe(e,r),projectName:e,onBack:t,onClose:n,onSubmit:g,isPending:p.isPending,error:m,children:[(0,M.jsx)(B,{label:`GCP project ID`,description:`The Google Cloud project hosting the Cloud Run service (e.g. my-prod-foo).`,required:!0,children:(0,M.jsx)(`input`,{type:`text`,value:r,onChange:e=>i(e.target.value),required:!0,autoComplete:`off`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})}),(0,M.jsxs)(B,{label:`Service-account JSON`,description:`Paste the contents of the SA key (JSON). The SA needs roles/logging.viewer (or any role granting logging.logEntries.list).`,required:!0,children:[(0,M.jsx)(`textarea`,{value:d,onChange:e=>f(e.target.value),rows:6,spellCheck:!1,autoComplete:`off`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-copy-14-mono text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`{"type":"service_account","project_id":"…","private_key":"…"}`,required:!0}),(0,M.jsxs)(`label`,{className:`mt-2 inline-flex cursor-pointer items-center gap-2 text-label-14 text-secondary hover:text-strong`,children:[(0,M.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`hidden`,onChange:e=>void _(e.target.files?.[0]??null)}),(0,M.jsx)(`span`,{className:`rounded-md border border-base px-2 py-1`,children:`Or upload a key file`})]})]}),(0,M.jsxs)(Q,{children:[(0,M.jsx)(B,{label:`Service name (optional)`,description:`Restrict log pulls to a specific Cloud Run service. Omit to pull all services in the project.`,children:(0,M.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),autoComplete:`off`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})}),(0,M.jsx)(B,{label:`Location (optional)`,description:`Region of the Cloud Run service (e.g. us-central1). Helpful when multiple regions emit logs.`,children:(0,M.jsx)(`input`,{type:`text`,value:s,onChange:e=>c(e.target.value),autoComplete:`off`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})}),(0,M.jsx)(B,{label:`Display name (optional)`,description:`Friendly label shown in the dashboard. Defaults to the project + service combo.`,children:(0,M.jsx)(`input`,{type:`text`,value:l,onChange:e=>u(e.target.value),autoComplete:`off`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})})]})]})}function z({projectName:e,onBack:t,onClose:n}){let[r,i]=(0,j.useState)(``),[a,o]=(0,j.useState)(``),[s,c]=(0,j.useState)(``),[l,u]=(0,j.useState)(`production`),[d,f]=(0,j.useState)(``),p=oe(e||null),{error:m,runConnect:h}=F(e,n);return(0,M.jsxs)(I,{title:`Connect a Vercel project`,description:(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`Reads AI crawler visits from Vercel request logs. Nothing to install on your site.`,(0,M.jsx)(b,{text:K(`access token`)})]}),guide:fe(e),projectName:e,onBack:t,onClose:n,onSubmit:()=>h({validate:()=>r.trim()?a.trim()?s.trim()?null:`Vercel personal access token is required.`:`Vercel team / account ID is required.`:`Vercel project ID is required.`,mutate:()=>p.mutateAsync({projectId:r.trim(),teamId:a.trim(),token:s.trim(),environment:l,displayName:d.trim()||void 0}),startInitialBackfill:!1,onConnected:()=>c(``)}),isPending:p.isPending,error:m,children:[(0,M.jsx)(B,{label:`Vercel project ID`,description:`The prj_… id from the Vercel dashboard or .vercel/project.json.`,required:!0,children:(0,M.jsx)(`input`,{type:`text`,value:r,onChange:e=>i(e.target.value),required:!0,autoComplete:`off`,placeholder:`prj_…`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})}),(0,M.jsx)(B,{label:`Vercel team / account ID`,description:`The Vercel team or personal account that owns the project. Find it as orgId in your .vercel/project.json.`,required:!0,children:(0,M.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),required:!0,autoComplete:`off`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})}),(0,M.jsx)(B,{label:`Personal access token`,description:`Create a Vercel personal access token under Account Settings → Tokens. Tokens can expire, so use a long-lived one.`,required:!0,children:(0,M.jsx)(`input`,{type:`password`,value:s,onChange:e=>c(e.target.value),required:!0,autoComplete:`new-password`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})}),(0,M.jsxs)(Q,{children:[(0,M.jsx)(B,{label:`Environment`,description:`Which deployment environment's request logs to pull.`,children:(0,M.jsxs)(`select`,{value:l,onChange:e=>u(e.target.value),className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong focus:border-mono-500 focus:outline-none`,children:[(0,M.jsx)(`option`,{value:`production`,children:`production`}),(0,M.jsx)(`option`,{value:`preview`,children:`preview`})]})}),(0,M.jsx)(B,{label:`Display name (optional)`,description:`Friendly label shown in the dashboard. Defaults to the Vercel project ID.`,children:(0,M.jsx)(`input`,{type:`text`,value:d,onChange:e=>f(e.target.value),autoComplete:`off`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})})]})]})}function B({label:e,description:t,required:n,children:r}){return(0,M.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,M.jsxs)(`span`,{className:`text-label-14-strong text-strong`,children:[e,n?(0,M.jsx)(`span`,{className:`ml-1 text-negative-400`,children:`*`}):null]}),r,(0,M.jsx)(`span`,{className:`text-label-13 text-secondary`,children:t})]})}var V=`https://github.com/Canonry/canonry/blob/main`,H=`${V}/skills/canonry/references/server-side-traffic.md`,U=`${V}/docs/cloudflare-traffic-setup.md`,W=`1.1.1`,G=`https://github.com/Canonry/canonry/releases/download/wp-traffic-logger-v${W}/canonry-traffic-logger-${W}.zip`;function K(e){return`The ${e} is stored in ~/.canonry/config.yaml on the Canonry server and never sent back to the dashboard.`}var q=`Never ask me to paste a password, token, or key into this chat. When a command needs one, give me the exact command to run myself, or read it from a file I point you to.`;function J(e,t){try{let n=new URL(e.trim());return n.protocol!==`https:`&&n.protocol!==`http:`?null:`${n.origin}${n.pathname.replace(/\/+$/,``)}/wp-admin/${t}`}catch{return null}}function Y(e,t){let n=C(e),r=J(t,`plugin-install.php?tab=upload`),i=J(t,`profile.php#application-passwords-section`);return{docsUrl:`${H}#connecting-a-wordpress-source`,steps:[{title:`Download the Canonry Traffic Logger plugin`,link:{label:`Download v${W} (.zip)`,href:G}},{title:`Upload and activate it in wp-admin`,detail:`Plugins → Add New → Upload Plugin, then Activate.`,...r?{link:{label:`Open the upload page`,href:r}}:{}},{title:`Create an Application Password`,detail:`Users → Profile → Application Passwords. Name it “Canonry” and copy the password it shows once.`,...i?{link:{label:`Open your profile`,href:i}}:{}},{title:`Using a page cache or CDN? Exclude AI crawlers from it`,detail:`Cached pages never reach the plugin, so crawler visits go uncounted.`,link:{label:`User agents to exclude`,href:`${H}#connecting-a-wordpress-source`}}],agentRequest:`Help me connect my WordPress site to the Canonry project "${e}" for server-side traffic.
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{C as t,H as n,W as r,f as i,ft as a,it as o,lt as s,o as c,q as l,tt as u,ut as d,z as f}from"./vendor-lucide-iE5MEh2-.js";import{r as p}from"./vendor-markdown-BBGbNklj.js";import{S as m,d as h,u as g}from"./vendor-tanstack-16u6cATb.js";import{At as _,Cn as ee,bt as te,r as v,t as y}from"./ToneBadge-BXxSLZUc.js";import{t as ne}from"./async-handler-Bj3TnIRw.js";import{d as re}from"./query-client-CBtgvGgy.js";import{hn as ie}from"./react-query-CsgUn_pT.js";import{t as b}from"./InfoTooltip-D29JcNMW.js";import{t as x}from"./card-bE38V9NH.js";import{St as S,Ut as C,bt as w,j as T,jt as E,vt as D,xt as O,yt as k}from"./index-Ce3zYiH3.js";import{i as A,n as ae,r as oe,s as se,t as ce}from"./server-traffic-Dwwd7cw6.js";var j=e(a(),1),M=p();function le({open:e,onOpenChange:t,onClosed:n,projectName:r}){let[i,a]=(0,j.useState)(`pick`);(0,j.useEffect)(()=>{e&&a(`pick`)},[e]);let o=()=>{t(!1),a(`pick`)};return(0,M.jsx)(D,{open:e,onOpenChange:e=>{e?t(!0):o()},children:(0,M.jsx)(k,{onCloseAutoFocus:e=>{n&&(e.preventDefault(),n())},children:i===`pick`?(0,M.jsx)(de,{onPick:a}):i===`cloudflare`?(0,M.jsx)(he,{projectName:r,onBack:()=>a(`pick`),onClose:o}):i===`wordpress`?(0,M.jsx)(L,{projectName:r,onBack:()=>a(`pick`),onClose:o}):i===`vercel`?(0,M.jsx)(z,{projectName:r,onBack:()=>a(`pick`),onClose:o}):(0,M.jsx)(R,{projectName:r,onBack:()=>a(`pick`),onClose:o})})})}var ue=[{type:`cloudflare`,name:`Cloudflare`,needs:`A zone you manage. Set up from the terminal.`,icon:i},{type:`wordpress`,name:`WordPress`,needs:`wp-admin access to install a plugin`,icon:f},{type:`vercel`,name:`Vercel`,needs:`A Vercel access token`,icon:c},{type:`cloud-run`,name:`Google Cloud Run`,needs:`A service account that can read logs`,icon:l}];function de({onPick:e}){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(O,{children:[(0,M.jsx)(S,{children:`Connect a traffic source`}),(0,M.jsx)(w,{children:`Pick where your site runs. Canonry reads AI crawler visits and AI referrals from there.`})]}),(0,M.jsx)(`div`,{className:`mt-6 flex flex-col gap-3`,children:ue.map(({type:t,name:n,needs:r,icon:i})=>(0,M.jsxs)(`button`,{type:`button`,onClick:()=>e(t),className:`group flex items-center gap-3 rounded-md border border-base bg-bg-elevated/30 px-3 py-3 text-left transition-colors hover:border-mono-600 hover:bg-bg-elevated/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:[(0,M.jsx)(`span`,{className:`mt-0.5 inline-flex size-9 shrink-0 items-center justify-center rounded-md border border-base bg-bg text-neutral group-hover:text-heading`,children:(0,M.jsx)(i,{className:`size-4`})}),(0,M.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,M.jsx)(`span`,{className:`text-label-14-strong text-heading`,children:n}),(0,M.jsx)(`span`,{className:`text-label-13 text-secondary`,children:r})]})]},t))}),(0,M.jsx)(`p`,{className:`mt-6 text-copy-13 text-secondary`,children:`Your agent can set up any of these for you. Pick a source to copy instructions for it.`})]})}function N({title:e,description:t,onBack:n}){return(0,M.jsxs)(O,{children:[(0,M.jsxs)(`button`,{type:`button`,onClick:n,className:`mb-1 inline-flex w-fit items-center gap-1 rounded text-button-14 text-secondary transition-colors hover:text-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:[(0,M.jsx)(d,{className:`size-3`}),`Choose a different source`]}),(0,M.jsx)(S,{children:e}),(0,M.jsx)(w,{children:t})]})}function P(e,t){let n=h();return async(r,i)=>{i.startInitialBackfill&&await ee(e,r),i.afterConnected?.(),t(),n({to:`/traffic/$projectName/$sourceId`,params:{projectName:e,sourceId:r}})}}function F(e,t){let[n,r]=(0,j.useState)(null),i=P(e,t);return{error:n,runConnect:async e=>{r(null);let t=e.validate();if(t){r(t);return}let n;try{n=await e.mutate()}catch(e){r(E(e));return}try{await i(n.id,{startInitialBackfill:e.startInitialBackfill??!0,afterConnected:e.onConnected})}catch(e){r(`Source connected, but starting the initial backfill failed: ${E(e)}`)}}}}function I({title:e,description:t,projectName:n,onBack:r,onClose:i,onSubmit:a,isPending:o,error:s,guide:c,children:l}){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(N,{title:e,description:t,onBack:r}),(0,M.jsxs)(`div`,{className:`-mr-1 mt-6 min-h-0 flex-1 overflow-y-auto pr-1`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,M.jsx)(X,{request:c.agentRequest,docsUrl:c.docsUrl}),(0,M.jsx)(Z,{steps:c.steps})]}),(0,M.jsxs)(`form`,{onSubmit:ne(async e=>{e.preventDefault(),await a()}),className:`mt-6 flex flex-col gap-5 border-t border-default pt-5`,children:[(0,M.jsxs)(`p`,{className:`text-copy-14-strong text-heading`,children:[`Then connect it to `,(0,M.jsx)(`span`,{className:`text-label-13-mono`,children:n})]}),l,s?(0,M.jsx)(`p`,{className:`rounded-md border border-negative-800/50 bg-negative-950/30 px-3 py-2 text-copy-13 text-negative-200`,children:s}):null,(0,M.jsxs)(`div`,{className:`mt-2 flex items-center justify-end gap-2 border-t border-default pt-4`,children:[(0,M.jsx)(v,{type:`button`,variant:`ghost`,size:`sm`,onClick:i,children:`Close`}),(0,M.jsx)(v,{type:`submit`,disabled:o,size:`sm`,children:o?`Connecting…`:`Connect`})]})]})]})]})}function L({projectName:e,onBack:t,onClose:n}){let[r,i]=(0,j.useState)(``),[a,o]=(0,j.useState)(``),[s,c]=(0,j.useState)(``),[l,u]=(0,j.useState)(``),d=A(e||null),{error:f,runConnect:p}=F(e,n);return(0,M.jsxs)(I,{title:`Connect a WordPress site`,description:(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`Reads AI crawler visits from the Canonry Traffic Logger plugin.`,(0,M.jsx)(b,{text:`${K(`Application Password`)} Pages served from a full-page cache never reach the plugin, so exclude AI crawlers from your cache. The docs list the user agents.`})]}),guide:Y(e,r),projectName:e,onBack:t,onClose:n,onSubmit:()=>p({validate:()=>r.trim()?a.trim()?s.trim()?null:`Application Password is required.`:`Username is required.`:`WordPress site URL is required.`,mutate:()=>d.mutateAsync({baseUrl:r.trim(),username:a.trim(),applicationPassword:s.trim(),displayName:l.trim()||void 0}),onConnected:()=>c(``)}),isPending:d.isPending,error:f,children:[(0,M.jsx)(B,{label:`WordPress site URL`,description:`Base URL of the site running the Canonry Traffic Logger plugin.`,required:!0,children:(0,M.jsx)(`input`,{type:`url`,value:r,onChange:e=>i(e.target.value),required:!0,autoComplete:`url`,placeholder:`https://example.com`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})}),(0,M.jsx)(B,{label:`Username`,description:`WordPress user that owns the Application Password.`,required:!0,children:(0,M.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),required:!0,autoComplete:`username`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})}),(0,M.jsx)(B,{label:`Application Password`,description:`Create one in wp-admin under Users -> Profile -> Application Passwords.`,required:!0,children:(0,M.jsx)(`input`,{type:`password`,value:s,onChange:e=>c(e.target.value),required:!0,autoComplete:`new-password`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})}),(0,M.jsx)(Q,{children:(0,M.jsx)(B,{label:`Display name (optional)`,description:`Friendly label shown in the dashboard. Defaults to the WordPress host.`,children:(0,M.jsx)(`input`,{type:`text`,value:l,onChange:e=>u(e.target.value),autoComplete:`off`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})})})]})}function R({projectName:e,onBack:t,onClose:n}){let[r,i]=(0,j.useState)(``),[a,o]=(0,j.useState)(``),[s,c]=(0,j.useState)(``),[l,u]=(0,j.useState)(``),[d,f]=(0,j.useState)(``),p=ae(e||null),{error:m,runConnect:h}=F(e,n),g=()=>h({validate:()=>r.trim()?d.trim()?null:`Service-account JSON content is required.`:`GCP project ID is required.`,mutate:()=>p.mutateAsync({gcpProjectId:r.trim(),serviceName:a.trim()||void 0,location:s.trim()||void 0,displayName:l.trim()||void 0,keyJson:d.trim()}),onConnected:()=>f(``)}),_=async e=>{if(!e)return;let t=await e.text();f(t)};return(0,M.jsxs)(I,{title:`Connect a Cloud Run service`,description:(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`Reads AI crawler visits from your Cloud Run request logs.`,(0,M.jsx)(b,{text:K(`service-account private key`)})]}),guide:pe(e,r),projectName:e,onBack:t,onClose:n,onSubmit:g,isPending:p.isPending,error:m,children:[(0,M.jsx)(B,{label:`GCP project ID`,description:`The Google Cloud project hosting the Cloud Run service (e.g. my-prod-foo).`,required:!0,children:(0,M.jsx)(`input`,{type:`text`,value:r,onChange:e=>i(e.target.value),required:!0,autoComplete:`off`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})}),(0,M.jsxs)(B,{label:`Service-account JSON`,description:`Paste the contents of the SA key (JSON). The SA needs roles/logging.viewer (or any role granting logging.logEntries.list).`,required:!0,children:[(0,M.jsx)(`textarea`,{value:d,onChange:e=>f(e.target.value),rows:6,spellCheck:!1,autoComplete:`off`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-copy-14-mono text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`{"type":"service_account","project_id":"…","private_key":"…"}`,required:!0}),(0,M.jsxs)(`label`,{className:`mt-2 inline-flex cursor-pointer items-center gap-2 text-label-14 text-secondary hover:text-strong`,children:[(0,M.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`hidden`,onChange:e=>void _(e.target.files?.[0]??null)}),(0,M.jsx)(`span`,{className:`rounded-md border border-base px-2 py-1`,children:`Or upload a key file`})]})]}),(0,M.jsxs)(Q,{children:[(0,M.jsx)(B,{label:`Service name (optional)`,description:`Restrict log pulls to a specific Cloud Run service. Omit to pull all services in the project.`,children:(0,M.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),autoComplete:`off`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})}),(0,M.jsx)(B,{label:`Location (optional)`,description:`Region of the Cloud Run service (e.g. us-central1). Helpful when multiple regions emit logs.`,children:(0,M.jsx)(`input`,{type:`text`,value:s,onChange:e=>c(e.target.value),autoComplete:`off`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})}),(0,M.jsx)(B,{label:`Display name (optional)`,description:`Friendly label shown in the dashboard. Defaults to the project + service combo.`,children:(0,M.jsx)(`input`,{type:`text`,value:l,onChange:e=>u(e.target.value),autoComplete:`off`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})})]})]})}function z({projectName:e,onBack:t,onClose:n}){let[r,i]=(0,j.useState)(``),[a,o]=(0,j.useState)(``),[s,c]=(0,j.useState)(``),[l,u]=(0,j.useState)(`production`),[d,f]=(0,j.useState)(``),p=oe(e||null),{error:m,runConnect:h}=F(e,n);return(0,M.jsxs)(I,{title:`Connect a Vercel project`,description:(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`Reads AI crawler visits from Vercel request logs. Nothing to install on your site.`,(0,M.jsx)(b,{text:K(`access token`)})]}),guide:fe(e),projectName:e,onBack:t,onClose:n,onSubmit:()=>h({validate:()=>r.trim()?a.trim()?s.trim()?null:`Vercel personal access token is required.`:`Vercel team / account ID is required.`:`Vercel project ID is required.`,mutate:()=>p.mutateAsync({projectId:r.trim(),teamId:a.trim(),token:s.trim(),environment:l,displayName:d.trim()||void 0}),startInitialBackfill:!1,onConnected:()=>c(``)}),isPending:p.isPending,error:m,children:[(0,M.jsx)(B,{label:`Vercel project ID`,description:`The prj_… id from the Vercel dashboard or .vercel/project.json.`,required:!0,children:(0,M.jsx)(`input`,{type:`text`,value:r,onChange:e=>i(e.target.value),required:!0,autoComplete:`off`,placeholder:`prj_…`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})}),(0,M.jsx)(B,{label:`Vercel team / account ID`,description:`The Vercel team or personal account that owns the project. Find it as orgId in your .vercel/project.json.`,required:!0,children:(0,M.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),required:!0,autoComplete:`off`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})}),(0,M.jsx)(B,{label:`Personal access token`,description:`Create a Vercel personal access token under Account Settings → Tokens. Tokens can expire, so use a long-lived one.`,required:!0,children:(0,M.jsx)(`input`,{type:`password`,value:s,onChange:e=>c(e.target.value),required:!0,autoComplete:`new-password`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})}),(0,M.jsxs)(Q,{children:[(0,M.jsx)(B,{label:`Environment`,description:`Which deployment environment's request logs to pull.`,children:(0,M.jsxs)(`select`,{value:l,onChange:e=>u(e.target.value),className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong focus:border-mono-500 focus:outline-none`,children:[(0,M.jsx)(`option`,{value:`production`,children:`production`}),(0,M.jsx)(`option`,{value:`preview`,children:`preview`})]})}),(0,M.jsx)(B,{label:`Display name (optional)`,description:`Friendly label shown in the dashboard. Defaults to the Vercel project ID.`,children:(0,M.jsx)(`input`,{type:`text`,value:d,onChange:e=>f(e.target.value),autoComplete:`off`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`})})]})]})}function B({label:e,description:t,required:n,children:r}){return(0,M.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,M.jsxs)(`span`,{className:`text-label-14-strong text-strong`,children:[e,n?(0,M.jsx)(`span`,{className:`ml-1 text-negative-400`,children:`*`}):null]}),r,(0,M.jsx)(`span`,{className:`text-label-13 text-secondary`,children:t})]})}var V=`https://github.com/Canonry/canonry/blob/main`,H=`${V}/skills/canonry/references/server-side-traffic.md`,U=`${V}/docs/cloudflare-traffic-setup.md`,W=`1.1.1`,G=`https://github.com/Canonry/canonry/releases/download/wp-traffic-logger-v${W}/canonry-traffic-logger-${W}.zip`;function K(e){return`The ${e} is stored in ~/.canonry/config.yaml on the Canonry server and never sent back to the dashboard.`}var q=`Never ask me to paste a password, token, or key into this chat. When a command needs one, give me the exact command to run myself, or read it from a file I point you to.`;function J(e,t){try{let n=new URL(e.trim());return n.protocol!==`https:`&&n.protocol!==`http:`?null:`${n.origin}${n.pathname.replace(/\/+$/,``)}/wp-admin/${t}`}catch{return null}}function Y(e,t){let n=C(e),r=J(t,`plugin-install.php?tab=upload`),i=J(t,`profile.php#application-passwords-section`);return{docsUrl:`${H}#connecting-a-wordpress-source`,steps:[{title:`Download the Canonry Traffic Logger plugin`,link:{label:`Download v${W} (.zip)`,href:G}},{title:`Upload and activate it in wp-admin`,detail:`Plugins → Add New → Upload Plugin, then Activate.`,...r?{link:{label:`Open the upload page`,href:r}}:{}},{title:`Create an Application Password`,detail:`Users → Profile → Application Passwords. Name it “Canonry” and copy the password it shows once.`,...i?{link:{label:`Open your profile`,href:i}}:{}},{title:`Using a page cache or CDN? Exclude AI crawlers from it`,detail:`Cached pages never reach the plugin, so crawler visits go uncounted.`,link:{label:`User agents to exclude`,href:`${H}#connecting-a-wordpress-source`}}],agentRequest:`Help me connect my WordPress site to the Canonry project "${e}" for server-side traffic.
|
|
2
2
|
|
|
3
3
|
Follow the WordPress section of the Canonry docs: ${H}#connecting-a-wordpress-source
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{ft as t}from"./vendor-lucide-iE5MEh2-.js";import{r as n}from"./vendor-markdown-BBGbNklj.js";import{O as r}from"./vendor-tanstack-16u6cATb.js";import{C as i,Dn as a,En as o,Jt as s,Kc as c,W as l,Yc as u,r as d,t as f,v as p,y as m}from"./ToneBadge-BkNG9buI.js";import{t as h}from"./AccessControls-B6bkOAge.js";import{r as g}from"./account-context-C66suepK.js";import{t as _}from"./async-handler-Bj3TnIRw.js";import{d as v}from"./query-client-D_jULVYr.js";import{Dt as y,H as b,Ot as x,U as S,at as C,ct as w,kt as T,l as E,lt as D,u as O,y as k}from"./index-C05Wdzzv.js";var A=e(t(),1),j=n();function M({onSaved:e}){let[t,n]=(0,A.useState)(``),[r,i]=(0,A.useState)(``),[o,c]=(0,A.useState)(!1),[l,u]=(0,A.useState)(null),[f,h]=(0,A.useState)(!1),g=t.trim().length>0&&r.trim().length>0,y=typeof window>`u`?void 0:s(window.location,window.__CANONRY_CONFIG__?.basePath),b=y?m(y):void 0,x=y?p(y):void 0;async function S(){if(g){c(!0),u(null),h(!1);try{await a({clientId:t.trim(),clientSecret:r.trim()}),n(``),i(``),h(!0),v({title:`Google OAuth app updated`,detail:`Dashboard Google credentials were saved.`,tone:`positive`,dedupeKey:`settings:google-oauth`,dedupeMode:`replace`}),e()}catch(e){u(e instanceof Error?e.message:`Failed to update Google OAuth credentials`)}finally{c(!1)}}}return(0,j.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsx)(`label`,{className:`text-label-14 text-secondary`,htmlFor:`google-client-id`,children:`Client ID`}),(0,j.jsxs)(`a`,{href:`https://console.cloud.google.com/apis/credentials`,target:`_blank`,rel:`noopener noreferrer`,className:`text-label-14 text-secondary hover:text-neutral underline underline-offset-2`,children:[`Google Cloud `,`↗`]})]}),(0,j.jsx)(`input`,{id:`google-client-id`,type:`text`,className:`mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`Google OAuth client ID`,value:t,onChange:e=>n(e.target.value)})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`label`,{className:`text-label-14 text-secondary`,htmlFor:`google-client-secret`,children:`Client secret`}),(0,j.jsx)(`input`,{id:`google-client-secret`,type:`password`,className:`mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`Google OAuth client secret`,value:r,onChange:e=>i(e.target.value)})]}),b&&x&&(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Authorized redirect URIs`}),(0,j.jsxs)(`dl`,{className:`mt-1 space-y-2 text-label-12`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{className:`text-muted`,children:`Search Console and Business Profile`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(`code`,{className:`block break-all text-strong`,children:b})})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{className:`text-muted`,children:`Google Ads and Tag Manager`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(`code`,{className:`block break-all text-strong`,children:x})})]})]})]}),l&&(0,j.jsx)(`p`,{className:`text-copy-14 text-negative-400`,children:l}),f&&(0,j.jsx)(`p`,{className:`text-copy-14 text-positive-400`,children:`Google OAuth credentials updated.`}),(0,j.jsx)(d,{type:`button`,size:`sm`,disabled:!g||o,onClick:_(S),children:o?`Saving…`:`Save Google OAuth app`})]})}function N({id:e,title:t,purpose:n,status:r,action:i,children:a}){return(0,j.jsxs)(`div`,{id:e,className:`scroll-mt-24 py-4`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-4 gap-y-2`,children:[(0,j.jsxs)(`div`,{className:`min-w-0 grow basis-64`,children:[(0,j.jsx)(`h3`,{className:`text-copy-14-strong text-heading`,children:t}),(0,j.jsx)(`div`,{className:`mt-1 max-w-prose text-copy-14 text-secondary`,children:n})]}),(0,j.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[r,i]})]}),a]})}function P(e){let t=e.replace(/^Error:\s*/,``).replace(/\s+/g,` `).trim();return t?t.length>140?`${t.slice(0,137)}...`:t:`Unknown error`}function F(){let e=r(),[t,n]=(0,A.useState)(null),[a,o]=(0,A.useState)(null),[s,p]=(0,A.useState)(!1),[m,h]=(0,A.useState)(`localhost`),[g,y]=(0,A.useState)(`9222`),[b,x]=(0,A.useState)(!1),[S,C]=(0,A.useState)(!1),w=k(S,b);(0,A.useEffect)(()=>{let e=!0;return l().then(t=>{e&&(n(t),o(null))}).catch(t=>{if(!e)return;let n=c(t);n.includes(`501`)||o(n)}),()=>{e=!1}},[]);let T=(0,j.jsx)(d,{type:`button`,variant:`outline`,size:`sm`,disabled:b,onClick:()=>w.request(()=>{if(s)p(!1),C(!1);else{if(t?.endpoint)try{let e=new URL(t.endpoint);h(e.hostname),y(e.port||`9222`)}catch{o(`The saved browser endpoint could not be read. Enter its host and port.`)}p(!0)}}),children:s?`Cancel`:t?.connected?`Update endpoint`:`Configure`});return(0,j.jsxs)(N,{id:`browser-connection`,title:`ChatGPT in Chrome`,purpose:`Runs AI Visibility checks on ChatGPT through a Chrome browser you connect.`,status:(0,j.jsx)(f,{tone:t?.connected?`positive`:`caution`,children:t?.connected?`Connected`:`Not connected`}),action:T,children:[a?(0,j.jsxs)(`p`,{role:`alert`,className:`mt-2 max-w-prose text-copy-14 text-negative`,children:[`Could not check Chrome: `,P(a),`. Check that Chrome is running with remote debugging, then configure the endpoint.`]}):null,!t?.connected&&(0,j.jsxs)(`details`,{className:`mt-3`,children:[(0,j.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`How to connect Chrome`}),(0,j.jsxs)(`ol`,{className:`mt-2 ml-5 list-decimal space-y-2 text-copy-14 text-secondary`,children:[(0,j.jsx)(`li`,{children:`On the machine running Canonry, launch Chrome with remote debugging on port 9222 and a separate browser profile.`}),(0,j.jsx)(`li`,{children:`In that browser, open ChatGPT and sign in.`}),(0,j.jsx)(`li`,{children:`Choose Configure and save the host and port.`})]}),(0,j.jsxs)(`p`,{className:`mt-2 text-copy-14 text-secondary`,children:[`Chrome requires `,(0,j.jsx)(`code`,{children:`--remote-debugging-port=9222`}),` and `,(0,j.jsx)(`code`,{children:`--user-data-dir`}),` pointing to a separate profile. `,(0,j.jsx)(`a`,{className:`text-link underline`,href:`https://developer.chrome.com/docs/devtools/agents/get-started/configuration`,target:`_blank`,rel:`noopener noreferrer`,children:`Launch commands for your operating system`})]})]}),(t?.endpoint||t?.browserVersion||!!t?.targets?.length)&&(0,j.jsxs)(`details`,{className:`mt-3`,children:[(0,j.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`Connection details`}),(0,j.jsxs)(`dl`,{className:`definition-list mt-2`,children:[t?.endpoint&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Endpoint`}),(0,j.jsx)(`dd`,{className:`text-label-12-mono`,children:t.endpoint})]}),t?.browserVersion&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Browser`}),(0,j.jsx)(`dd`,{className:`text-label-12`,children:t.browserVersion})]}),t?.targets&&t.targets.length>0&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Tabs`}),(0,j.jsx)(`dd`,{children:t.targets.map(e=>(0,j.jsxs)(`span`,{className:`mr-2`,children:[e.name,`: `,e.alive?`● alive`:`○ idle`]},e.name))})]})]})]}),s&&(0,j.jsxs)(`form`,{className:`mt-3 flex flex-col gap-2`,onSubmit:_(async t=>{t.preventDefault(),x(!0);try{await i(m.trim(),Number(g)),O(e,u.cdpChatgpt);let t=await l();n(t),o(null),p(!1),C(!1),e.invalidateQueries({queryKey:[`settings`]}),v({title:`CDP endpoint saved`,detail:`${m.trim()}:${g} is now configured.`,tone:`positive`,dedupeKey:`settings:cdp`,dedupeMode:`replace`})}catch(e){o(c(e))}finally{x(!1)}}),children:[(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(`input`,{className:`flex-1 rounded border border-strong bg-bg-elevated px-2 py-1 text-label-14 text-heading placeholder-mono-400 focus:outline-none focus:ring-1 focus:ring-mono-500`,placeholder:`localhost`,value:m,required:!0,disabled:b,onChange:e=>{h(e.target.value),C(!0)},"aria-label":`CDP host`}),(0,j.jsx)(`input`,{className:`w-24 rounded border border-strong bg-bg-elevated px-2 py-1 text-label-14 text-heading placeholder-mono-400 focus:outline-none focus:ring-1 focus:ring-mono-500`,placeholder:`9222`,type:`number`,min:`1`,max:`65535`,required:!0,disabled:b,value:g,onChange:e=>{y(e.target.value),C(!0)},"aria-label":`CDP port`})]}),(0,j.jsx)(`div`,{children:(0,j.jsx)(d,{type:`submit`,size:`sm`,disabled:b,children:b?`Saving…`:`Save endpoint`})})]}),w.dialog]})}function I(){return(0,j.jsx)(h,{title:`Settings`,children:(0,j.jsx)(L,{})})}function L(){let e=D(),{canWrite:t}=g(),{dashboard:n}=w(),r=n?.settings??e?.dashboard?.settings,i=C(!e,e?.health).data??e?.health??b,[a,s]=(0,A.useState)(!1),[c,l]=(0,A.useState)(!1),[u,p]=(0,A.useState)(``),[m,h]=(0,A.useState)(!1),[O,k]=(0,A.useState)(null);if(!r)return null;let P=n?.projects??e?.dashboard?.projects??[],I=r.google.state===`ready`,L=r.bing.state===`ready`;return(0,j.jsxs)(`div`,{className:`page-container`,children:[(0,j.jsx)(`div`,{className:`page-header`,children:(0,j.jsxs)(`div`,{className:`page-header-left`,children:[(0,j.jsx)(`h1`,{className:`page-title`,children:`Settings`}),(0,j.jsx)(`p`,{className:`page-subtitle`,children:`Connections and answer engines.`})]})}),(0,j.jsxs)(`div`,{className:`space-y-8`,children:[(0,j.jsx)(E,{projects:P.map(e=>e.project)}),(0,j.jsxs)(`section`,{"aria-labelledby":`search-connections-title`,className:`border-t border-default pt-6`,children:[(0,j.jsx)(`div`,{className:`section-head`,children:(0,j.jsx)(`h2`,{id:`search-connections-title`,className:`text-heading-16 text-heading`,children:`Search and browser connections`})}),(0,j.jsxs)(`div`,{className:`divide-y divide-default`,children:[(0,j.jsx)(N,{title:`Google OAuth`,purpose:`One app credential for Search Console, Business Profile, Google Ads and Tag Manager.`,status:(0,j.jsx)(f,{tone:I?`neutral`:`caution`,children:I?`Configured`:`Not configured`}),action:(0,j.jsx)(d,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>s(!a),children:a?`Cancel`:I?`Update OAuth app`:`Configure Google OAuth`}),children:a&&(0,j.jsx)(M,{onSaved:()=>{s(!1)}})}),(0,j.jsx)(N,{title:`Bing Webmaster Tools`,purpose:`One API key for project Bing connections. OAuth is not required.`,status:(0,j.jsx)(f,{tone:L?`neutral`:`caution`,children:L?`Configured`:`Not configured`}),action:(0,j.jsx)(d,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>l(!c),children:c?`Cancel`:L?`Update API key`:`Configure Bing`}),children:c&&(0,j.jsxs)(`div`,{className:`mt-3 max-w-xl space-y-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsx)(`label`,{className:`text-label-14 text-secondary`,htmlFor:`bing-api-key`,children:`API key`}),(0,j.jsx)(`a`,{href:`https://www.bing.com/webmasters/`,target:`_blank`,rel:`noopener noreferrer`,className:`text-label-14 text-secondary hover:text-neutral underline underline-offset-2`,children:`Bing Webmaster Tools`})]}),(0,j.jsx)(`input`,{id:`bing-api-key`,type:`password`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`Bing Webmaster Tools API key`,value:u,onChange:e=>p(e.target.value)}),O&&(0,j.jsx)(`p`,{role:`alert`,className:`text-copy-14 text-negative-400`,children:O}),(0,j.jsx)(d,{type:`button`,size:`sm`,disabled:!u.trim()||m,onClick:_(async()=>{if(u.trim()){h(!0),k(null);try{await o(u.trim()),p(``),l(!1),v({title:`Bing API key updated`,detail:`Dashboard Bing credentials were saved.`,tone:`positive`,dedupeKey:`settings:bing`,dedupeMode:`replace`})}catch(e){k(e instanceof Error?e.message:`Failed to update Bing API key`)}finally{h(!1)}}}),children:m?`Saving…`:`Save Bing API key`})]})}),(0,j.jsx)(F,{})]})]}),(0,j.jsxs)(`section`,{"aria-labelledby":`service-health-title`,className:`border-t border-default pt-6`,children:[(0,j.jsx)(`div`,{className:`section-head`,children:(0,j.jsx)(`h2`,{id:`service-health-title`,className:`text-heading-16 text-heading`,children:`Service health`})}),(0,j.jsxs)(`div`,{className:`divide-y divide-default`,children:[(0,j.jsxs)(`div`,{className:`health-row py-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`p`,{className:`text-copy-14-strong text-heading`,children:`API`}),i.apiStatus.state!==`ok`&&(0,j.jsx)(`p`,{className:`mt-1 whitespace-pre-line text-copy-14 text-secondary`,children:S(i.apiStatus)})]}),(0,j.jsx)(f,{tone:y(i.apiStatus),title:S(i.apiStatus),children:i.apiStatus.state===`ok`?`Healthy`:`Attention`})]}),(0,j.jsxs)(`div`,{className:`health-row py-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`p`,{className:`text-copy-14-strong text-heading`,children:`Worker`}),i.workerStatus.state!==`ok`&&(0,j.jsx)(`p`,{className:`mt-1 whitespace-pre-line text-copy-14 text-secondary`,children:S(i.workerStatus)})]}),(0,j.jsx)(f,{tone:y(i.workerStatus),title:S(i.workerStatus),children:i.workerStatus.state===`ok`?`Healthy`:i.workerStatus.state===`disabled`?`Disabled`:`Attention`})]})]})]}),x(t)?(0,j.jsxs)(`section`,{"aria-labelledby":`feedback-title`,className:`border-t border-default pt-6`,children:[(0,j.jsx)(`div`,{className:`section-head`,children:(0,j.jsx)(`h2`,{id:`feedback-title`,className:`text-heading-16 text-heading`,children:`Feedback`})}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-4 gap-y-2 py-4`,children:[(0,j.jsx)(`p`,{className:`min-w-0 max-w-prose grow basis-64 text-copy-14 text-secondary`,children:`Ideas, problems or anything confusing go straight to the Canonry team. Feedback is also at the top of every page.`}),(0,j.jsx)(d,{type:`button`,variant:`outline`,size:`sm`,onClick:T,children:`Share feedback`})]})]}):null,(0,j.jsxs)(`details`,{className:`border-t border-default pt-6`,children:[(0,j.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`Self-hosting details`}),(0,j.jsxs)(`div`,{className:`mt-3 max-w-prose`,children:[(0,j.jsx)(`ul`,{className:`detail-list`,children:r.selfHostNotes.map(e=>(0,j.jsx)(`li`,{children:e},e))}),(0,j.jsx)(`p`,{className:`supporting-copy`,children:r.bootstrapNote})]})]})]})]})}export{I as SettingsPage};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{ft as t}from"./vendor-lucide-iE5MEh2-.js";import{r as n}from"./vendor-markdown-BBGbNklj.js";import{O as r}from"./vendor-tanstack-16u6cATb.js";import{C as i,Dn as a,En as o,Jt as s,Kc as c,W as l,Zc as u,r as d,t as f,v as p,y as m}from"./ToneBadge-BXxSLZUc.js";import{t as h}from"./AccessControls-DmKPF5t5.js";import{r as g}from"./account-context-DHUo7ntg.js";import{t as _}from"./async-handler-Bj3TnIRw.js";import{d as v}from"./query-client-CBtgvGgy.js";import{Dt as y,H as b,Ot as x,U as S,at as C,ct as w,kt as T,l as E,lt as D,u as O,y as k}from"./index-Ce3zYiH3.js";var A=e(t(),1),j=n();function M({onSaved:e}){let[t,n]=(0,A.useState)(``),[r,i]=(0,A.useState)(``),[o,c]=(0,A.useState)(!1),[l,u]=(0,A.useState)(null),[f,h]=(0,A.useState)(!1),g=t.trim().length>0&&r.trim().length>0,y=typeof window>`u`?void 0:s(window.location,window.__CANONRY_CONFIG__?.basePath),b=y?m(y):void 0,x=y?p(y):void 0;async function S(){if(g){c(!0),u(null),h(!1);try{await a({clientId:t.trim(),clientSecret:r.trim()}),n(``),i(``),h(!0),v({title:`Google OAuth app updated`,detail:`Dashboard Google credentials were saved.`,tone:`positive`,dedupeKey:`settings:google-oauth`,dedupeMode:`replace`}),e()}catch(e){u(e instanceof Error?e.message:`Failed to update Google OAuth credentials`)}finally{c(!1)}}}return(0,j.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsx)(`label`,{className:`text-label-14 text-secondary`,htmlFor:`google-client-id`,children:`Client ID`}),(0,j.jsxs)(`a`,{href:`https://console.cloud.google.com/apis/credentials`,target:`_blank`,rel:`noopener noreferrer`,className:`text-label-14 text-secondary hover:text-neutral underline underline-offset-2`,children:[`Google Cloud `,`↗`]})]}),(0,j.jsx)(`input`,{id:`google-client-id`,type:`text`,className:`mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`Google OAuth client ID`,value:t,onChange:e=>n(e.target.value)})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`label`,{className:`text-label-14 text-secondary`,htmlFor:`google-client-secret`,children:`Client secret`}),(0,j.jsx)(`input`,{id:`google-client-secret`,type:`password`,className:`mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`Google OAuth client secret`,value:r,onChange:e=>i(e.target.value)})]}),b&&x&&(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Authorized redirect URIs`}),(0,j.jsxs)(`dl`,{className:`mt-1 space-y-2 text-label-12`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{className:`text-muted`,children:`Search Console and Business Profile`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(`code`,{className:`block break-all text-strong`,children:b})})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{className:`text-muted`,children:`Google Ads and Tag Manager`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(`code`,{className:`block break-all text-strong`,children:x})})]})]})]}),l&&(0,j.jsx)(`p`,{className:`text-copy-14 text-negative-400`,children:l}),f&&(0,j.jsx)(`p`,{className:`text-copy-14 text-positive-400`,children:`Google OAuth credentials updated.`}),(0,j.jsx)(d,{type:`button`,size:`sm`,disabled:!g||o,onClick:_(S),children:o?`Saving…`:`Save Google OAuth app`})]})}function N({id:e,title:t,purpose:n,status:r,action:i,children:a}){return(0,j.jsxs)(`div`,{id:e,className:`scroll-mt-24 py-4`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-4 gap-y-2`,children:[(0,j.jsxs)(`div`,{className:`min-w-0 grow basis-64`,children:[(0,j.jsx)(`h3`,{className:`text-copy-14-strong text-heading`,children:t}),(0,j.jsx)(`div`,{className:`mt-1 max-w-prose text-copy-14 text-secondary`,children:n})]}),(0,j.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[r,i]})]}),a]})}function P(e){let t=e.replace(/^Error:\s*/,``).replace(/\s+/g,` `).trim();return t?t.length>140?`${t.slice(0,137)}...`:t:`Unknown error`}function F(){let e=r(),[t,n]=(0,A.useState)(null),[a,o]=(0,A.useState)(null),[s,p]=(0,A.useState)(!1),[m,h]=(0,A.useState)(`localhost`),[g,y]=(0,A.useState)(`9222`),[b,x]=(0,A.useState)(!1),[S,C]=(0,A.useState)(!1),w=k(S,b);(0,A.useEffect)(()=>{let e=!0;return l().then(t=>{e&&(n(t),o(null))}).catch(t=>{if(!e)return;let n=c(t);n.includes(`501`)||o(n)}),()=>{e=!1}},[]);let T=(0,j.jsx)(d,{type:`button`,variant:`outline`,size:`sm`,disabled:b,onClick:()=>w.request(()=>{if(s)p(!1),C(!1);else{if(t?.endpoint)try{let e=new URL(t.endpoint);h(e.hostname),y(e.port||`9222`)}catch{o(`The saved browser endpoint could not be read. Enter its host and port.`)}p(!0)}}),children:s?`Cancel`:t?.connected?`Update endpoint`:`Configure`});return(0,j.jsxs)(N,{id:`browser-connection`,title:`ChatGPT in Chrome`,purpose:`Runs AI Visibility checks on ChatGPT through a Chrome browser you connect.`,status:(0,j.jsx)(f,{tone:t?.connected?`positive`:`caution`,children:t?.connected?`Connected`:`Not connected`}),action:T,children:[a?(0,j.jsxs)(`p`,{role:`alert`,className:`mt-2 max-w-prose text-copy-14 text-negative`,children:[`Could not check Chrome: `,P(a),`. Check that Chrome is running with remote debugging, then configure the endpoint.`]}):null,!t?.connected&&(0,j.jsxs)(`details`,{className:`mt-3`,children:[(0,j.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`How to connect Chrome`}),(0,j.jsxs)(`ol`,{className:`mt-2 ml-5 list-decimal space-y-2 text-copy-14 text-secondary`,children:[(0,j.jsx)(`li`,{children:`On the machine running Canonry, launch Chrome with remote debugging on port 9222 and a separate browser profile.`}),(0,j.jsx)(`li`,{children:`In that browser, open ChatGPT and sign in.`}),(0,j.jsx)(`li`,{children:`Choose Configure and save the host and port.`})]}),(0,j.jsxs)(`p`,{className:`mt-2 text-copy-14 text-secondary`,children:[`Chrome requires `,(0,j.jsx)(`code`,{children:`--remote-debugging-port=9222`}),` and `,(0,j.jsx)(`code`,{children:`--user-data-dir`}),` pointing to a separate profile. `,(0,j.jsx)(`a`,{className:`text-link underline`,href:`https://developer.chrome.com/docs/devtools/agents/get-started/configuration`,target:`_blank`,rel:`noopener noreferrer`,children:`Launch commands for your operating system`})]})]}),(t?.endpoint||t?.browserVersion||!!t?.targets?.length)&&(0,j.jsxs)(`details`,{className:`mt-3`,children:[(0,j.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`Connection details`}),(0,j.jsxs)(`dl`,{className:`definition-list mt-2`,children:[t?.endpoint&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Endpoint`}),(0,j.jsx)(`dd`,{className:`text-label-12-mono`,children:t.endpoint})]}),t?.browserVersion&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Browser`}),(0,j.jsx)(`dd`,{className:`text-label-12`,children:t.browserVersion})]}),t?.targets&&t.targets.length>0&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`dt`,{children:`Tabs`}),(0,j.jsx)(`dd`,{children:t.targets.map(e=>(0,j.jsxs)(`span`,{className:`mr-2`,children:[e.name,`: `,e.alive?`● alive`:`○ idle`]},e.name))})]})]})]}),s&&(0,j.jsxs)(`form`,{className:`mt-3 flex flex-col gap-2`,onSubmit:_(async t=>{t.preventDefault(),x(!0);try{await i(m.trim(),Number(g)),O(e,u.cdpChatgpt);let t=await l();n(t),o(null),p(!1),C(!1),e.invalidateQueries({queryKey:[`settings`]}),v({title:`CDP endpoint saved`,detail:`${m.trim()}:${g} is now configured.`,tone:`positive`,dedupeKey:`settings:cdp`,dedupeMode:`replace`})}catch(e){o(c(e))}finally{x(!1)}}),children:[(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(`input`,{className:`flex-1 rounded border border-strong bg-bg-elevated px-2 py-1 text-label-14 text-heading placeholder-mono-400 focus:outline-none focus:ring-1 focus:ring-mono-500`,placeholder:`localhost`,value:m,required:!0,disabled:b,onChange:e=>{h(e.target.value),C(!0)},"aria-label":`CDP host`}),(0,j.jsx)(`input`,{className:`w-24 rounded border border-strong bg-bg-elevated px-2 py-1 text-label-14 text-heading placeholder-mono-400 focus:outline-none focus:ring-1 focus:ring-mono-500`,placeholder:`9222`,type:`number`,min:`1`,max:`65535`,required:!0,disabled:b,value:g,onChange:e=>{y(e.target.value),C(!0)},"aria-label":`CDP port`})]}),(0,j.jsx)(`div`,{children:(0,j.jsx)(d,{type:`submit`,size:`sm`,disabled:b,children:b?`Saving…`:`Save endpoint`})})]}),w.dialog]})}function I(){return(0,j.jsx)(h,{title:`Settings`,children:(0,j.jsx)(L,{})})}function L(){let e=D(),{canWrite:t}=g(),{dashboard:n}=w(),r=n?.settings??e?.dashboard?.settings,i=C(!e,e?.health).data??e?.health??b,[a,s]=(0,A.useState)(!1),[c,l]=(0,A.useState)(!1),[u,p]=(0,A.useState)(``),[m,h]=(0,A.useState)(!1),[O,k]=(0,A.useState)(null);if(!r)return null;let P=n?.projects??e?.dashboard?.projects??[],I=r.google.state===`ready`,L=r.bing.state===`ready`;return(0,j.jsxs)(`div`,{className:`page-container`,children:[(0,j.jsx)(`div`,{className:`page-header`,children:(0,j.jsxs)(`div`,{className:`page-header-left`,children:[(0,j.jsx)(`h1`,{className:`page-title`,children:`Settings`}),(0,j.jsx)(`p`,{className:`page-subtitle`,children:`Connections and answer engines.`})]})}),(0,j.jsxs)(`div`,{className:`space-y-8`,children:[(0,j.jsx)(E,{projects:P.map(e=>e.project)}),(0,j.jsxs)(`section`,{"aria-labelledby":`search-connections-title`,className:`border-t border-default pt-6`,children:[(0,j.jsx)(`div`,{className:`section-head`,children:(0,j.jsx)(`h2`,{id:`search-connections-title`,className:`text-heading-16 text-heading`,children:`Search and browser connections`})}),(0,j.jsxs)(`div`,{className:`divide-y divide-default`,children:[(0,j.jsx)(N,{title:`Google OAuth`,purpose:`One app credential for Search Console, Business Profile, Google Ads and Tag Manager.`,status:(0,j.jsx)(f,{tone:I?`neutral`:`caution`,children:I?`Configured`:`Not configured`}),action:(0,j.jsx)(d,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>s(!a),children:a?`Cancel`:I?`Update OAuth app`:`Configure Google OAuth`}),children:a&&(0,j.jsx)(M,{onSaved:()=>{s(!1)}})}),(0,j.jsx)(N,{title:`Bing Webmaster Tools`,purpose:`One API key for project Bing connections. OAuth is not required.`,status:(0,j.jsx)(f,{tone:L?`neutral`:`caution`,children:L?`Configured`:`Not configured`}),action:(0,j.jsx)(d,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>l(!c),children:c?`Cancel`:L?`Update API key`:`Configure Bing`}),children:c&&(0,j.jsxs)(`div`,{className:`mt-3 max-w-xl space-y-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsx)(`label`,{className:`text-label-14 text-secondary`,htmlFor:`bing-api-key`,children:`API key`}),(0,j.jsx)(`a`,{href:`https://www.bing.com/webmasters/`,target:`_blank`,rel:`noopener noreferrer`,className:`text-label-14 text-secondary hover:text-neutral underline underline-offset-2`,children:`Bing Webmaster Tools`})]}),(0,j.jsx)(`input`,{id:`bing-api-key`,type:`password`,className:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`Bing Webmaster Tools API key`,value:u,onChange:e=>p(e.target.value)}),O&&(0,j.jsx)(`p`,{role:`alert`,className:`text-copy-14 text-negative-400`,children:O}),(0,j.jsx)(d,{type:`button`,size:`sm`,disabled:!u.trim()||m,onClick:_(async()=>{if(u.trim()){h(!0),k(null);try{await o(u.trim()),p(``),l(!1),v({title:`Bing API key updated`,detail:`Dashboard Bing credentials were saved.`,tone:`positive`,dedupeKey:`settings:bing`,dedupeMode:`replace`})}catch(e){k(e instanceof Error?e.message:`Failed to update Bing API key`)}finally{h(!1)}}}),children:m?`Saving…`:`Save Bing API key`})]})}),(0,j.jsx)(F,{})]})]}),(0,j.jsxs)(`section`,{"aria-labelledby":`service-health-title`,className:`border-t border-default pt-6`,children:[(0,j.jsx)(`div`,{className:`section-head`,children:(0,j.jsx)(`h2`,{id:`service-health-title`,className:`text-heading-16 text-heading`,children:`Service health`})}),(0,j.jsxs)(`div`,{className:`divide-y divide-default`,children:[(0,j.jsxs)(`div`,{className:`health-row py-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`p`,{className:`text-copy-14-strong text-heading`,children:`API`}),i.apiStatus.state!==`ok`&&(0,j.jsx)(`p`,{className:`mt-1 whitespace-pre-line text-copy-14 text-secondary`,children:S(i.apiStatus)})]}),(0,j.jsx)(f,{tone:y(i.apiStatus),title:S(i.apiStatus),children:i.apiStatus.state===`ok`?`Healthy`:`Attention`})]}),(0,j.jsxs)(`div`,{className:`health-row py-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`p`,{className:`text-copy-14-strong text-heading`,children:`Worker`}),i.workerStatus.state!==`ok`&&(0,j.jsx)(`p`,{className:`mt-1 whitespace-pre-line text-copy-14 text-secondary`,children:S(i.workerStatus)})]}),(0,j.jsx)(f,{tone:y(i.workerStatus),title:S(i.workerStatus),children:i.workerStatus.state===`ok`?`Healthy`:i.workerStatus.state===`disabled`?`Disabled`:`Attention`})]})]})]}),x(t)?(0,j.jsxs)(`section`,{"aria-labelledby":`feedback-title`,className:`border-t border-default pt-6`,children:[(0,j.jsx)(`div`,{className:`section-head`,children:(0,j.jsx)(`h2`,{id:`feedback-title`,className:`text-heading-16 text-heading`,children:`Feedback`})}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-4 gap-y-2 py-4`,children:[(0,j.jsx)(`p`,{className:`min-w-0 max-w-prose grow basis-64 text-copy-14 text-secondary`,children:`Ideas, problems or anything confusing go straight to the Canonry team. Feedback is also at the top of every page.`}),(0,j.jsx)(d,{type:`button`,variant:`outline`,size:`sm`,onClick:T,children:`Share feedback`})]})]}):null,(0,j.jsxs)(`details`,{className:`border-t border-default pt-6`,children:[(0,j.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`Self-hosting details`}),(0,j.jsxs)(`div`,{className:`mt-3 max-w-prose`,children:[(0,j.jsx)(`ul`,{className:`detail-list`,children:r.selfHostNotes.map(e=>(0,j.jsx)(`li`,{children:e},e))}),(0,j.jsx)(`p`,{className:`supporting-copy`,children:r.bootstrapNote})]})]})]})]})}export{I as SettingsPage};
|