PageSourceSearch

https://vizops360.ai/assets/vpnStore-BoUYdssc.js

js vizops360.ai collected 2026-10-05 13:50:20 UTC 2,338 bytes, 1 lines download raw bytes

1import{aP as m,aH as d,aI as c}from"./index-CpeGhXo5.js";let l=null,p=0;const u=m((n,i)=>({vpns:[],timelineEvents:[],fetchVpns:async()=>{if(l)return l;if(!(Date.now()-p<3e3&&i().vpns.length>0))return l=(async()=>{try{const a=await d.get("/sysadmin/vpns"),e=a.data?.data||a.data||[],t=Array.isArray(e)?e:[];n({vpns:t,timelineEvents:t.flatMap(s=>s.timeline||[])}),p=Date.now()}catch(a){console.error("Failed to fetch vpns:",a);try{const e=await d.get("/sysadmin/vpns/me"),t=e.data?.data||e.data||[],s=Array.isArray(t)?t:[];n({vpns:s,timelineEvents:s.flatMap(r=>r.timeline||[])}),p=Date.now()}catch{n({vpns:[],timelineEvents:[]})}}finally{l=null}})(),l},addVpn:async a=>{try{const e={...a};e.id&&!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(e.id)&&delete e.id;const t=await d.post("/sysadmin/vpns",e),s=t.data?.data||t.data;return n({vpns:[s,...i().vpns.filter(r=>r.id!==s.id)],timelineEvents:[...s.timeline||[],...i().timelineEvents]}),s}catch(e){throw console.error("API failed to create VPN:",e),c.error(e?.response?.data?.message||e?.message||"Failed to create VPN on server"),e}},updateVpn:async(a,e)=>{try{const t=await d.patch(`/sysadmin/vpns/${a}`,e),s=t.data?.data||t.data,r=i().vpns.map(o=>o.id===a?{...o,...e,...typeof s=="object"?s:{}}:o);n({vpns:r,timelineEvents:r.flatMap(o=>o.timeline||[])})}catch(t){throw console.error("API failed to update VPN:",t),c.error(t?.response?.data?.message||t?.message||"Failed to update VPN on server"),t}},deleteVpn:async a=>{try{await d.delete(`/sysadmin/vpns/${a}`);const e=i().vpns.filter(t=>t.id!==a);n({vpns:e,timelineEvents:e.flatMap(t=>t.timeline||[])}),c.success("VPN deleted successfully")}catch(e){throw console.error("API failed to delete VPN:",e),c.error(e?.response?.data?.message||e?.message||"Failed to delete VPN on server"),e}},addTimelineEvent:a=>{}}));function v(n){const i=new Date;i.setHours(0,0,0,0);const a=new Date(n);if(a.setHours(0,0,0,0),a.getFullYear()>=9e3)return{status:"Active",daysRemaining:1/0,isOverdue:!1,isLifetime:!0};const e=a.getTime()-i.getTime(),t=Math.ceil(e/(1e3*60*60*24));return t<0?{status:"Expired",daysRemaining:Math.abs(t),isOverdue:!0,isLifetime:!1}:t<=10?{status:"Expiring Soon",daysRemaining:t,isOverdue:!1,isLifetime:!1}:{status:"Active",daysRemaining:t,isOverdue:!1,isLifetime:!1}}export{v as g,u};

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.