1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2085],{2085:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var o=r(15383),i=r(31912),n=r(14343),a=r(87717),s=r(89651),u=r(94402);function l({service:e}){let t,{widget:r}=e,{t:p}=(0,i.Bd)(),[c,b]=(0,n.useState)(null);if((0,n.useEffect)(()=>{async function e(){let e=(0,u.$C)(r,"getmonitors"),t=await fetch(e,{method:"POST"});b(await t.json())}c||e()},[r,c]),!c)return(0,o.jsxs)(s.A,{service:e,children:[(0,o.jsx)(a.A,{label:"uptimerobot.status"}),(0,o.jsx)(a.A,{label:"uptimerobot.uptime"})]});if(c.error)return(0,o.jsx)(s.A,{service:e,error:c.error});if(c.pagination?.total>1){let t=c.monitors.filter(e=>2===e.status).length;return(0,o.jsxs)(s.A,{service:e,children:[(0,o.jsx)(a.A,{label:"uptimerobot.sitesUp",value:t}),(0,o.jsx)(a.A,{label:"uptimerobot.sitesDown",value:c.pagination.total-t})]})}let m=c.monitors[0],d=Array.isArray(m.logs)?m.logs:[],f=d.find(e=>2===e.type),v=d.find(e=>1===e.type),x=0;switch(m.status){case 0:t=p("uptimerobot.paused");break;case 1:t=p("uptimerobot.notyetchecked");break;case 2:t=p("uptimerobot.up"),x=p("common.duration",{value:f?.duration??0});break;case 8:t=p("uptimerobot.seemsdown");break;case 9:t=p("uptimerobot.down");break;default:t=p("uptimerobot.unknown")}let A=v?new Date(1e3*v.datetime).toLocaleString():"",g=p("common.duration",{value:v?.duration??0}),j=!v;return(0,o.jsxs)(s.A,{service:e,children:[(0,o.jsx)(a.A,{label:"uptimerobot.status",value:t}),(0,o.jsx)(a.A,{label:"uptimerobot.uptime",value:x}),!j&&(0,o.jsx)(a.A,{label:"uptimerobot.lastDown",value:A}),!j&&(0,o.jsx)(a.A,{label:"uptimerobot.downDuration",value:g})]})}},94402:(e,t,r)=>{function o(e,t=null){return null==e||""===e?t:"number"==typeof e?Number.isInteger(e)&&e>=0?e:t:"string"==typeof e&&/^\d+$/.test(e)?Number(e):t}function i(e,t){let r=new URLSearchParams({group:e.service_group,service:e.service_name,index:e.index});return t&&r.append("endpoint",t),r}function n(e,t,r){let o=i(e,t);return r&&o.append("query",JSON.stringify(r)),`/api/services/proxy?${o.toString()}`}r.d(t,{$C:()=>n,Sk:()=>o,_V:()=>i})}}]);
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.