1import{u as f,m as g,k as u,p as x,q as C,z as _,A as k,B as y,c as d,o as c,b as i,t as s,d as r,F as b,h as v}from"./index-DrluhU3h.js";import{u as I,a as T}from"./usePageTitle-C__gRrTT.js";const N={class:"min-h-screen"},L={class:"container mx-auto px-4 py-16"},E={class:"text-4xl md:text-5xl font-bold text-neutral-900 dark:text-white mb-8 text-center"},D={class:"text-xl text-neutral-700 dark:text-neutral-300 leading-relaxed mb-12 max-w-4xl mx-auto text-center"},M={key:0,class:"text-center py-16"},O={key:1,class:"overflow-x-auto"},B={class:"w-full max-w-4xl mx-auto bg-white dark:bg-neutral-800 shadow-lg rounded-lg overflow-hidden"},z={class:"bg-accent-600 text-white"},F={class:"px-6 py-4 text-left"},G={class:"px-6 py-4 text-left"},J={class:"px-6 py-4 text-right"},P={class:"divide-y divide-neutral-200 dark:divide-neutral-700"},R={class:"px-6 py-4 text-neutral-900 dark:text-white font-semibold"},W={class:"px-6 py-4 text-neutral-700 dark:text-neutral-300"},j={class:"px-6 py-4 text-neutral-700 dark:text-neutral-300 text-right"},Y={__name:"NetworkPage",setup(A){const{t:o}=f();g("network");const m=u(!0),l=u([]),p=u(!1);x(async()=>{await w()}),C(async()=>{l.value.length===0&&await w()}),_(()=>{const e=document.createElement("link");e.rel="stylesheet",e.href="https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Widgets/widgets.css",document.head.appendChild(e);const t=document.createElement("script");t.src="https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Cesium.js",t.async=!0,t.onload=()=>{setTimeout(()=>{if(l.value.length>0)h();else{const n=k(l,a=>{a.length>0&&(h(),n())})}},200)},t.onerror=n=>{console.error("Failed to load Cesium.js:",n)},document.head.appendChild(t)}),I(()=>o("network.page_title")),T(()=>({description:o("network.page_description"),ogTitle:o("network.page_title"),ogDescription:o("network.page_description"),ogType:"website"}));async function w(){try{const e=await y.rest("Shell/Datacenter:list","GET");e&&e.data&&(l.value=e.data)}catch(e){console.error("Failed to fetch datacenters:",e)}finally{m.value=!1}}function h(){if(!(typeof window>"u"||!window.document||!window.Cesium)&&l.value.length!==0)try{window.Cesium.Ion.defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI1MGI0OTkxZC01NTNlLTRkZTktYTJlOC0yN2MzNzY0ZDI3NDEiLCJpZCI6Mzk2MDYsImlhdCI6MTYwNzY4MTg0N30.UuSnNrKVwa8O-lemqCUUu9uz4Jh9ujcCITQ2MyF14jE";const e=new window.Cesium.Viewer("cesiumContainer",{terrainProvider:window.Cesium.createWorldTerrain(),baseLayerPicker:!1,timeline:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,navigationHelpButton:!1,navigationInstructionsInitiallyVisible:!1,animation:!1,fullscreenButton:!1,creditContainer:document.createElement("div")});e.cesiumWidget.creditContainer.style.display="none",e.scene.primitives.add(window.Cesium.createOsmBuildings());const t=[];l.value.forEach(a=>{t.push({name:`${a.Location} [${a.Name}]`,position:window.Cesium.Cartesian3.fromDegrees(a.Longitude,a.Latitude,5e4),lat:a.Latitude,lng:a.Longitude,point:{pixelSize:15,color:parseInt(a.Available)>=3e3?window.Cesium.Color.GREEN:parseInt(a.Available)>=1e3?window.Cesium.Color.ORANGE:window.Cesium.Color.RED,outlineColor:window.Cesium.Color.WHITE,outlineWidth:2},label:{text:`${a.Location} [${a.Name}]`,font:"14pt monospace",style:window.Cesium.LabelStyle.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:window.Cesium.VerticalOrigin.BOTTOM,pixelOffset:new window.Cesium.Cartesian2(0,-9),fillColor:window.Cesium.Color.YELLOW}})});let n=0;t.length>0&&(e.camera.flyTo({destination:window.Cesium.Cartesian3.fromDegrees(t[n].lng,t[n].lat,15e6),orientation:{pitch:window.Cesium.Math.toRadians(-90)}}),t.forEach(a=>e.entities.add(a)),e.zoomTo(e.entities),setInterval(()=>{n>=t.length-1?n=0:n++,e.camera.flyTo({destination:window.Cesium.Cartesian3.fromDegrees(t[n].lng,t[n].lat,15e6),orientation:{pitch:window.Cesium.Math.toRadians(-90)}})},5e3)),p.value=!0}catch(e){console.error("Failed to initialize globe:",e)}}return(e,t)=>(c(),d("div",N,[i("div",L,[i("h1",E,s(r(o)("network.title")),1),i("p",D,s(r(o)("network.desc")),1),t[1]||(t[1]=i("div",{id:"cesiumContainer",class:"w-full h-[600px] mb-12 rounded-lg overflow-hidden shadow-2xl bg-neutral-100 dar
1k:bg-neutral-800"},null,-1)),r(m)?(c(),d("div",M,[...t[0]||(t[0]=[i("div",{class:"inline-block w-12 h-12 border-4 border-accent-600 border-t-transparent rounded-full animate-spin"},null,-1)])])):(c(),d("div",O,[i("table",B,[i("thead",z,[i("tr",null,[i("th",F,s(r(o)("network.table_name")),1),i("th",G,s(r(o)("network.table_location")),1),i("th",J,s(r(o)("network.table_distance")),1)])]),i("tbody",P,[(c(!0),d(b,null,v(r(l),n=>(c(),d("tr",{key:n.Datacenter__||n.Name,class:"hover:bg-neutral-50 dark:hover:bg-neutral-700"},[i("td",R,s(n.Name),1),i("td",W,s(n.Location),1),i("td",j,s(n.Distance?Math.round(n.Distance/1e3):"â")+"km ",1)]))),128))])])]))])]))}};export{Y 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.