PageSourceSearch

https://smartcogwheel.ai/assets/PublicObserverShare-ES6XJQqb.js

js smartcogwheel.ai collected 2026-10-05 15:06:30 UTC 7,038 bytes, 1 lines download raw bytes

1import{j as e}from"./query-zKe4mOlO.js";import{u as C,b as A,r as i}from"./vendor-BV72JwGM.js";import{s as F,S as h,C as o,n as O,I as M,B as P,L as B}from"./index-b3SWkXql.js";import{B as D}from"./badge-DgEKWgvG.js";import{N as R}from"./NocWallboard-C9txRCQi.js";import{L as W}from"./lock-CIYpjrka.js";import"./PieChart-pJAPfAKX.js";import"./index-DHSHSWAQ.js";import"./index-BcFqJv69.js";import"./CategoricalChart-Di_Chm0k.js";import"./isArguments-HEPTc7lU.js";import"./index-Dxle4OYs.js";import"./band-CquvqAHh.js";import"./init-Dmth1JHB.js";import"./ordinal-DILIJJjt.js";import"./linear-DnxIEBmW.js";import"./defaultLocale-C4B-KCzX.js";import"./time-2UZkfxTs.js";import"./LineChart-DRX42lmR.js";import"./isArrayLikeObject-DzpQn6gc.js";import"./PolarChart-B-DvDaNp.js";import"./radio-0CKozWW3.js";import"./play-CR9Xjm6m.js";function de(){const{token:d}=C(),u=A(),m=u.pathname.endsWith("/noc")||new URLSearchParams(u.search).get("view")==="noc"?"noc":"report",[c,L]=i.useState(""),[f,N]=i.useState(!1),[v,j]=i.useState(null),[s,g]=i.useState(null),[k,w]=i.useState(30),b=i.useRef(""),x=i.useCallback(async t=>{const{data:a,error:n}=await F.functions.invoke("sn-observer-share-view",{body:{token:d,password:t}});if(n){let I=n.message||"Unable to open link";const p=n?.context;if(p&&typeof p.json=="function")try{const _=await p.json();_?.error&&(I=_.error)}catch{}throw new Error(I)}if(a?.error)throw new Error(a.error);return a},[d]),E=async t=>{if(t.preventDefault(),!(!d||!c)){N(!0),j(null);try{const a=await x(c);b.current=c,g(a)}catch(a){j(a.message)}finally{N(!1)}}};if(i.useEffect(()=>{if(!s||s?.view_mode!=="noc"&&m!=="noc")return;const t=setInterval(async()=>{try{const n=await x(b.current);g(n),w(30)}catch{}},3e4),a=setInterval(()=>w(n=>n<=1?30:n-1),1e3);return()=>{clearInterval(t),clearInterval(a)}},[s,x,m]),!s)return e.jsxs("div",{className:"min-h-screen flex items-center justify-center px-4",children:[e.jsx(h,{title:"Shared ServiceNow Instance Monitor",description:"Password-protected ServiceNow instance monitoring report."}),e.jsxs(o,{className:"p-8 max-w-md w-full space-y-5",children:[e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("div",{className:"mx-auto h-10 w-10 rounded-full bg-accent/10 flex items-center justify-center",children:e.jsx(W,{className:"h-5 w-5 text-accent"})}),e.jsx("h1",{className:"font-playfair text-2xl",children:"Shared monitor report"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter the access code to open this ServiceNow instance monitor report."})]}),e.jsxs("form",{onSubmit:E,className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(O,{htmlFor:"pw",className:"text-sm",children:"Access code"}),e.jsx(M,{id:"pw",type:"password",autoFocus:!0,value:c,onChange:t=>L(t.target.value)})]}),v&&e.jsx("p",{className:"text-sm text-destructive",children:v}),e.jsxs(P,{type:"submit",className:"w-full",disabled:f||!c,children:[f&&e.jsx(B,{className:"h-4 w-4 mr-2 animate-spin"})," Open"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Links expire seven days after creation."})]})]});if((s?.view_mode==="noc"||m==="noc"?"noc":"report")==="noc")return e.jsxs(e.Fragment,{children:[e.jsx(h,{title:"ServiceNow NOC Wallboard",description:"Live ServiceNow instance NOC wallboard."}),e.jsx(R,{instance:s.instance??null,snapshot:s.snapshot??null,findings:s.findings??[],metrics:s.metrics??[],live:"polling",pollSec:30,countdown:k})]});const r=s.snapshot??{},l=s.instance??{},y=s.findings??[],S=s.expires_at?new Date(s.expires_at):null;return e.jsxs("div",{className:"container mx-auto px-4 py-10 max-w-4xl space-y-6",children:[e.jsx(h,{title:"Shared ServiceNow Instance Monitor",description:"ServiceNow instance monitoring report."}),e.jsxs("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/10 px-4 py-3 text-xs leading-relaxed",children:[e.jsx("strong",{className:"font-semibold",children:"Independent monitoring report."})," This report is produced by an independent third party monitoring tool. It is not affiliated with, endorsed by, or a product of ServiceNow, Inc. ServiceNow, Now Assist, and AI Agents are trademarks of ServiceNow, Inc."]}),e.jsxs(o,{className:"p-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[l?.branding?.logo_url&&e.jsx("img",{src:l.branding.logo_url,alt:"",className:"h-10 w-10 rounded object-contain bg-muted"}),e.jsxs("div",{children:[e.jsx("h1",{className:"font-playfair text-3xl",children:l.instance_label||l?.branding?.product_name||"ServiceNow instance monitor"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:r.created_at?new Date(r.created_at).toLocaleStr
1ing():""})]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"text-5xl font-playfair",children:r.overall_score??0}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"overall score"})]})]}),r.summary&&e.jsx("p",{className:"text-sm mt-4",children:r.summary})]}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[e.jsxs(o,{className:"p-4",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"p50 response"}),e.jsxs("div",{className:"text-2xl font-playfair",children:[((r.metrics?.p50_ms??0)/1e3).toFixed(2),"s"]})]}),e.jsxs(o,{className:"p-4",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"p95 response"}),e.jsxs("div",{className:"text-2xl font-playfair",children:[((r.metrics?.p95_ms??0)/1e3).toFixed(2),"s"]})]}),e.jsxs(o,{className:"p-4",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"Transactions sampled"}),e.jsx("div",{className:"text-2xl font-playfair",children:r.metrics?.total_transactions??0})]})]}),r.ai_narrative&&e.jsxs(o,{className:"p-6",children:[e.jsx("h2",{className:"font-playfair text-lg mb-3",children:"Executive narrative"}),e.jsx("div",{className:"text-sm whitespace-pre-line leading-relaxed",children:r.ai_narrative})]}),y.length>0&&e.jsxs(o,{className:"p-4",children:[e.jsx("h2",{className:"font-playfair text-lg mb-3",children:"Findings and recommendations"}),e.jsx("div",{className:"space-y-3",children:y.map(t=>e.jsxs("div",{className:"border border-border rounded-md p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(D,{variant:t.severity==="high"?"destructive":"outline",className:"text-xs",children:t.severity}),e.jsx("span",{className:"font-medium text-sm",children:t.title})]}),t.recommendation&&e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t.recommendation})]},t.id))})]}),e.jsxs("div",{className:"text-xs text-muted-foreground space-y-1 border-t pt-4",children:[S&&e.jsxs("p",{children:["Link expires on ",S.toLocaleString(),"."]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Independent monitor."})," Not affiliated with or endorsed by ServiceNow, Inc. ServiceNow, Now Assist, and AI Agents are trademarks of ServiceNow, Inc."]})]})]})}export{de as default};

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.