diff --git a/index.js b/index.js index 63add45..f89fe3d 100644 --- a/index.js +++ b/index.js @@ -41,37 +41,47 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---- */ +// OpenLayers CSS import "ol/ol.css"; + +// OpenLayers core components import Map from "ol/Map"; import View from "ol/View"; -import { MultiPoint, Point } from "ol/geom"; +import Feature from "ol/Feature"; +import Overlay from "ol/Overlay"; + +// OpenLayers geometry types +import { MultiPoint, Point, LineString, Polygon } from "ol/geom"; + +// OpenLayers layer types import TileLayer from "ol/layer/Tile"; -import OSM from "ol/source/OSM"; -import { Circle as CircleStyle, Fill, Stroke, Style, Text } from "ol/style"; -import { getVectorContext } from "ol/render"; -import { LineString, Polygon } from "ol/geom"; import { Vector as VectorLayer } from "ol/layer"; -import Feature from "ol/Feature"; -import { TileJSON, Vector as VectorSource } from "ol/source"; -import { Icon } from "ol/style"; -import { useGeographic } from "ol/proj"; -import JSONFormatter from "json-formatter-js"; -// popup overlay -import Overlay from "ol/Overlay"; -import { toLonLat } from "ol/proj"; -import { toStringHDMS } from "ol/coordinate"; +// OpenLayers source types +import OSM from "ol/source/OSM"; +import { TileJSON, Vector as VectorSource } from "ol/source"; -// mouse postion +// OpenLayers style components +import { + Circle as CircleStyle, + Fill, + Stroke, + Style, + Text, + Icon, +} from "ol/style"; + +// OpenLayers utilities and controls +import { getVectorContext } from "ol/render"; +import { useGeographic, toLonLat } from "ol/proj"; +import { toStringHDMS, createStringXY } from "ol/coordinate"; import MousePosition from "ol/control/MousePosition"; -import { createStringXY } from "ol/coordinate"; import { defaults as defaultControls } from "ol/control"; -// ES6 Modules or TypeScript +// Third-party libraries import Swal from "sweetalert2"; -const Swal = require("sweetalert2"); - -import axios, { isCancel, AxiosError } from "axios"; +import axios, { AxiosError } from "axios"; +import JSONFormatter from "json-formatter-js"; useGeographic(); var i, j; @@ -87,9 +97,6 @@ var mcisName = new Array(); var mcisStatus = new Array(); var mcisGeo = new Array(); -var ipMap = []; -var geoMap = []; - var cspListDisplayEnabled = document.getElementById("displayOn"); var tableDisplayEnabled = document.getElementById("tableOn"); var table = document.getElementById("detailTable"); @@ -238,25 +245,12 @@ const csv = require("csv-parser"); const csvPath = "https://raw.githubusercontent.com/cloud-barista/cb-tumblebug/main/assets/cloudlocation.csv"; var cloudLocation = []; -var cspPointsAzure = []; -var cspPointsAws = []; -var cspPointsGcp = []; -var cspPointsAlibaba = []; -var cspPointsCloudit = []; -var cspPointsIBM = []; -var cspPointsTencent = []; -var cspPointsNcpVpc = []; var cspPointsCircle = []; -var geoCspPointsAzure = new Array(); -var geoCspPointsAws = new Array(); -var geoCspPointsGcp = new Array(); -var geoCspPointsAlibaba = new Array(); -var geoCspPointsCloudit = new Array(); -var geoCspPointsIBM = new Array(); -var geoCspPointsTencent = new Array(); -var geoCspPointsNcpVpc = new Array(); var geoCspPointsCircle = new Array(); +var cspPoints = {}; +var geoCspPoints = {}; + function displayCSPListOn() { if (cspListDisplayEnabled.checked) { cloudLocation = []; @@ -272,79 +266,35 @@ function displayCSPListOn() { cloudLocation.length + "\n"; - for (var i = 0; i < cloudLocation.length; ++i) { - // title: CloudType, ID, DisplayName, Latitude, Longitude - // ex: azure, eastasia, East Asia, 22.2670, 114.1880 - console.log(cloudLocation[i]["CloudType"]); - if (cloudLocation[i]["CloudType"] == "azure") { - cspPointsAzure.push([ - cloudLocation[i]["Longitude"], - cloudLocation[i]["Latitude"], - ]); - } - if (cloudLocation[i]["CloudType"] == "aws") { - cspPointsAws.push([ - cloudLocation[i]["Longitude"], - cloudLocation[i]["Latitude"], - ]); - } - if (cloudLocation[i]["CloudType"] == "gcp") { - cspPointsGcp.push([ - cloudLocation[i]["Longitude"], - cloudLocation[i]["Latitude"], - ]); - } - if (cloudLocation[i]["CloudType"] == "ncpvpc") { - cspPointsNcpVpc.push([ - cloudLocation[i]["Longitude"], - cloudLocation[i]["Latitude"], - ]); - } - if (cloudLocation[i]["CloudType"] == "alibaba") { - cspPointsAlibaba.push([ - cloudLocation[i]["Longitude"], - cloudLocation[i]["Latitude"], - ]); + cloudLocation.forEach((location) => { + const { CloudType, Longitude, Latitude } = location; + const cloudTypeLower = CloudType.toLowerCase(); + if (!cspPoints[cloudTypeLower]) { + cspPoints[cloudTypeLower] = []; } - if (cloudLocation[i]["CloudType"] == "cloudit") { - cspPointsCloudit.push([ - cloudLocation[i]["Longitude"], - cloudLocation[i]["Latitude"], - ]); - } - if (cloudLocation[i]["CloudType"] == "ibm") { - cspPointsIBM.push([ - cloudLocation[i]["Longitude"], - cloudLocation[i]["Latitude"], - ]); + if (!geoCspPoints[cloudTypeLower]) { + geoCspPoints[cloudTypeLower] = []; } - if (cloudLocation[i]["CloudType"] == "tencent") { - cspPointsTencent.push([ - cloudLocation[i]["Longitude"], - cloudLocation[i]["Latitude"], - ]); + + cspPoints[cloudTypeLower].push([ + parseFloat(Longitude), + parseFloat(Latitude), + ]); + }); + + Object.keys(cspPoints).forEach((csp) => { + if (cspPoints[csp].length > 0) { + geoCspPoints[csp][0] = new MultiPoint(cspPoints[csp]); } - } + }); }); }); } else { - cspPointsAzure = []; - cspPointsAws = []; - cspPointsGcp = []; - cspPointsAlibaba = []; - cspPointsCloudit = []; - cspPointsIBM = []; - cspPointsTencent = []; - cspPointsNcpVpc = []; + Object.keys(cspPoints).forEach((csp) => { + cspPoints[csp] = []; + geoCspPoints[csp] = []; + }); } - geoCspPointsAzure[0] = new MultiPoint([cspPointsAzure]); - geoCspPointsAws[0] = new MultiPoint([cspPointsAws]); - geoCspPointsGcp[0] = new MultiPoint([cspPointsGcp]); - geoCspPointsAlibaba[0] = new MultiPoint([cspPointsAlibaba]); - geoCspPointsCloudit[0] = new MultiPoint([cspPointsCloudit]); - geoCspPointsIBM[0] = new MultiPoint([cspPointsIBM]); - geoCspPointsTencent[0] = new MultiPoint([cspPointsTencent]); - geoCspPointsNcpVpc[0] = new MultiPoint([cspPointsNcpVpc]); } window.displayCSPListOn = displayCSPListOn; @@ -470,71 +420,30 @@ function createStyle(src) { }); } +// temporary point var pnt = new Point([-68, -50]); -import Vector from "ol/source/Vector.js"; -var vectorSource = new Vector({ projection: "EPSG:4326" }); -var iconFeature = new Feature(pnt); -iconFeature.set("style", createStyle("img/iconVm.png")); -iconFeature.set("index", "001"); -vectorSource.addFeature(iconFeature); -var iconLayer = new VectorLayer({ - style: function (feature) { - return feature.get("style"); - }, - source: vectorSource, -}); - +addIconToMap("img/iconVm.png", pnt, "001"); var iconStyleVm = new Style({ image: new Icon({ - //anchor: [0.5, 0.5], crossOrigin: "anonymous", src: "img/iconVm.png", opacity: 1.0, - //anchor: [0.5, 46], - //anchorXUnits: 'fraction', - //anchorYUnits: 'pixels', scale: 0.7, }), }); -var vectorSourceNlb = new Vector({ projection: "EPSG:4326" }); -var iconFeatureNlb = new Feature(pnt); -iconFeatureNlb.set("style", createStyle("img/iconNlb.png")); -iconFeatureNlb.set("index", "001"); -vectorSourceNlb.addFeature(iconFeatureNlb); -var iconLayerNlb = new VectorLayer({ - style: function (feature) { - return feature.get("style"); - }, - source: vectorSourceNlb, -}); - +addIconToMap("img/iconNlb.png", pnt, "001"); var iconStyleNlb = new Style({ image: new Icon({ - //anchor: [0.5, 0.5], crossOrigin: "anonymous", src: "img/iconNlb.png", opacity: 1.0, - //anchor: [0.5, 46], - //anchorXUnits: 'fraction', - //anchorYUnits: 'pixels', scale: 0.7, }), }); -var vectorSource1 = new Vector({ projection: "EPSG:4326" }); -var iconFeature1 = new Feature(pnt); -iconFeature1.set("style", createStyle("img/circle.png")); -iconFeature1.set("index", "001"); -vectorSource1.addFeature(iconFeature1); -var iconLayer1 = new VectorLayer({ - style: function (feature) { - return feature.get("style"); - }, - source: vectorSource1, -}); - +addIconToMap("img/circle.png", pnt, "001"); var iconStyleCircle = new Style({ image: new Icon({ crossOrigin: "anonymous", @@ -550,219 +459,58 @@ var iconStyleCircle = new Style({ }); // CSP location icon styles +const cspIconImg = { + azure: "img/ht-azure.png", + aws: "img/ht-aws.png", + gcp: "img/ht-gcp.png", + alibaba: "img/ht-alibaba.png", + cloudit: "img/ht-cloudit.png", + ibm: "img/ibm.png", + tencent: "img/tencent.png", + ncpvpc: "img/ncpvpc.png", + ncp: "img/ncp.png", + ktvpc: "img/ktvpc.png", + kt: "img/kt.png", + nhn: "img/nhn.png", + + // Add more CSP icons here +}; -var vectorSource2 = new Vector({ projection: "EPSG:4326" }); -var iconFeature2 = new Feature(pnt); -iconFeature2.set("style", createStyle("img/ht-azure.png")); -iconFeature2.set("index", "001"); -vectorSource2.addFeature(iconFeature2); -var iconLayer2 = new VectorLayer({ - style: function (feature) { - return feature.get("style"); - }, - source: vectorSource2, -}); - -var iconStyleAzure = new Style({ - image: new Icon({ - //anchor: [0.5, 0.5], - crossOrigin: "anonymous", - src: "img/ht-azure.png", - opacity: 1.0, - //anchor: [0.5, 46], - //anchorXUnits: 'fraction', - //anchorYUnits: 'pixels', - scale: 1.0, - }), -}); - -var vectorSource3 = new Vector({ projection: "EPSG:4326" }); -var iconFeature3 = new Feature(pnt); -iconFeature3.set("style", createStyle("img/ht-aws.png")); -iconFeature3.set("index", "001"); -vectorSource3.addFeature(iconFeature3); -var iconLayer3 = new VectorLayer({ - style: function (feature) { - return feature.get("style"); - }, - source: vectorSource3, -}); - -var iconStyleAws = new Style({ - image: new Icon({ - crossOrigin: "anonymous", - src: "img/ht-aws.png", - opacity: 1.0, - scale: 1.0, - }), -}); - -var vectorSource4 = new Vector({ projection: "EPSG:4326" }); -var iconFeature4 = new Feature(pnt); -iconFeature4.set("style", createStyle("img/ht-gcp.png")); -iconFeature4.set("index", "001"); -vectorSource4.addFeature(iconFeature4); -var iconLayer4 = new VectorLayer({ - style: function (feature) { - return feature.get("style"); - }, - source: vectorSource4, -}); - -var iconStyleGcp = new Style({ - image: new Icon({ - crossOrigin: "anonymous", - src: "img/ht-gcp.png", - opacity: 1.0, - scale: 1.0, - }), -}); - -var vectorSource5 = new Vector({ projection: "EPSG:4326" }); -var iconFeature5 = new Feature(pnt); -iconFeature5.set("style", createStyle("img/ht-alibaba.png")); -iconFeature5.set("index", "001"); -vectorSource5.addFeature(iconFeature5); -var iconLayer5 = new VectorLayer({ - style: function (feature) { - return feature.get("style"); - }, - source: vectorSource5, -}); - -var iconStyleAlibaba = new Style({ - image: new Icon({ - crossOrigin: "anonymous", - src: "img/ht-alibaba.png", - opacity: 1.0, - scale: 1.0, - }), -}); - -var vectorSource6 = new Vector({ projection: "EPSG:4326" }); -var iconFeature6 = new Feature(pnt); -iconFeature6.set("style", createStyle("img/ht-cloudit.png")); -iconFeature6.set("index", "001"); -vectorSource6.addFeature(iconFeature6); -var iconLayer6 = new VectorLayer({ - style: function (feature) { - return feature.get("style"); - }, - source: vectorSource6, -}); - -var iconStyleCloudit = new Style({ - image: new Icon({ - crossOrigin: "anonymous", - src: "img/ht-cloudit.png", - opacity: 1.0, - scale: 1.0, - }), -}); - -var vectorSource7 = new Vector({ projection: "EPSG:4326" }); -var iconFeature7 = new Feature(pnt); -iconFeature7.set("style", createStyle("img/ibm.png")); -iconFeature7.set("index", "001"); -vectorSource7.addFeature(iconFeature7); -var iconLayer7 = new VectorLayer({ - style: function (feature) { - return feature.get("style"); - }, - source: vectorSource7, -}); - -var iconStyleIBM = new Style({ - image: new Icon({ - crossOrigin: "anonymous", - src: "img/ibm.png", - opacity: 1.0, - scale: 1.0, - }), -}); - -var vectorSource8 = new Vector({ projection: "EPSG:4326" }); -var iconFeature8 = new Feature(pnt); -iconFeature8.set("style", createStyle("img/tencent.png")); -iconFeature8.set("index", "001"); -vectorSource8.addFeature(iconFeature8); -var iconLayer8 = new VectorLayer({ - style: function (feature) { - return feature.get("style"); - }, - source: vectorSource8, -}); - -var iconStyleTencent = new Style({ - image: new Icon({ - crossOrigin: "anonymous", - src: "img/tencent.png", - opacity: 1.0, - scale: 1.0, - }), -}); - -var vectorSource9 = new Vector({ projection: "EPSG:4326" }); -var iconFeature9 = new Feature(pnt); -iconFeature9.set("style", createStyle("img/naver-15x15.png")); -iconFeature9.set("index", "001"); -vectorSource9.addFeature(iconFeature9); -var iconLayer9 = new VectorLayer({ - style: function (feature) { - return feature.get("style"); - }, - source: vectorSource9, -}); - -var iconStyleNcpVpc = new Style({ - image: new Icon({ - crossOrigin: "anonymous", - src: "img/naver-15x15.png", - opacity: 1.0, - scale: 1.0, - }), -}); - -// Icon layers -map.addLayer(iconLayer1); -map.addLayer(iconLayer2); -map.addLayer(iconLayer3); -map.addLayer(iconLayer4); -map.addLayer(iconLayer5); -map.addLayer(iconLayer6); -map.addLayer(iconLayer7); -map.addLayer(iconLayer8); -map.addLayer(iconLayer9); -map.addLayer(iconLayer); -map.addLayer(iconLayerNlb); - -var imageStyle = new Style({ - image: new CircleStyle({ - radius: 2, - fill: new Fill({ color: "red" }), - //stroke: new Stroke({color: 'red', width: 1}) - }), -}); +// cspIconStyles +const cspIconStyles = {}; -var lineStyle = new Style({ - stroke: new Stroke({ - width: 5, - color: [255, 0, 0, 1], - }), -}); +function createIconStyle(imageSrc) { + return new Style({ + image: new Icon({ + crossOrigin: "anonymous", + src: imageSrc, + opacity: 1.0, + scale: 1.0, + }), + }); +} -var headInnerImageStyle = new Style({ - image: new CircleStyle({ - radius: 1, - fill: new Fill({ color: "blue" }), - }), +// addIconToMap +Object.keys(cspIconImg).forEach((csp) => { + cspIconStyles[csp] = createIconStyle(cspIconImg[csp]); }); - -var headOuterImageStyle = new Style({ - image: new CircleStyle({ - radius: 1, - fill: new Fill({ color: "black" }), - }), +function addIconToMap(imageSrc, point, index) { + var vectorSource = new VectorSource({ projection: "EPSG:4326" }); + var iconFeature = new Feature(point); + iconFeature.set("style", createStyle(imageSrc)); + iconFeature.set("index", index); + vectorSource.addFeature(iconFeature); + var iconLayer = new VectorLayer({ + style: function (feature) { + return feature.get("style"); + }, + source: vectorSource, + }); + map.addLayer(iconLayer); +} +Object.keys(cspIconImg).forEach((csp, index) => { + const iconIndex = index.toString().padStart(3, "0"); + addIconToMap(cspIconImg[csp], pnt, iconIndex); }); // magenta black blue orange yellow red grey green @@ -1024,7 +772,8 @@ function outputAlert(jsonData, type) { Swal.fire({ position: "top-end", icon: type, - html: '
', background: "#0e1746", + html: '
', + background: "#0e1746", showConfirmButton: true, //backdrop: false, didOpen: () => { @@ -1061,115 +810,114 @@ function getMcis() { setTimeout(() => getMcis(), filteredRefreshInterval * 1000); if (namespace && namespace != "") { - var url = `http://${hostname}:${port}/tumblebug/ns/${namespace}/mcis?option=status`; - - axios({ - method: "get", - url: url, - auth: { - username: `${username}`, - password: `${password}`, - }, - timeout: 60000, - }) - .then((res) => { + var url = `http://${hostname}:${port}/tumblebug/ns/${namespace}/mcis?option=status`; - var obj = res.data; + axios({ + method: "get", + url: url, + auth: { + username: `${username}`, + password: `${password}`, + }, + timeout: 60000, + }) + .then((res) => { + var obj = res.data; - var zoomLevel = map.getView().getZoom() * 2.0; - var radius = 4.0; + var zoomLevel = map.getView().getZoom() * 2.0; + var radius = 4.0; - cnt = cntInit; - if (obj.mcis != null) { - //console.log(obj.mcis); - for (let item of obj.mcis) { - //console.log("Index:[" + "]obj.mcis[i].name = " + item.name); - console.log(item); + cnt = cntInit; + if (obj.mcis != null) { + //console.log(obj.mcis); + for (let item of obj.mcis) { + //console.log("Index:[" + "]obj.mcis[i].name = " + item.name); + console.log(item); - var hideFlag = false; - for (let hideName of mcisHideList) { - if (item.id == hideName) { - hideFlag = true; - break; + var hideFlag = false; + for (let hideName of mcisHideList) { + if (item.id == hideName) { + hideFlag = true; + break; + } + } + if (hideFlag) { + continue; } - } - if (hideFlag) { - continue; - } - var vmGeo = []; + var vmGeo = []; - var validateNum = 0; - if (item.vm == null) { - console.log(item); - break; - } - for (j = 0; j < item.vm.length; j++) { - //vmGeo.push([(item.vm[j].location.longitude*1) + (Math.round(Math.random()) / zoomLevel - 1) * Math.random()*1, (item.vm[j].location.latitude*1) + (Math.round(Math.random()) / zoomLevel - 1) * Math.random()*1 ]) - if (j == 0) { + var validateNum = 0; + if (item.vm == null) { + console.log(item); + break; + } + for (j = 0; j < item.vm.length; j++) { + //vmGeo.push([(item.vm[j].location.longitude*1) + (Math.round(Math.random()) / zoomLevel - 1) * Math.random()*1, (item.vm[j].location.latitude*1) + (Math.round(Math.random()) / zoomLevel - 1) * Math.random()*1 ]) + if (j == 0) { + vmGeo.push([ + item.vm[j].location.longitude * 1, + item.vm[j].location.latitude * 1, + ]); + } else { + vmGeo.push([ + item.vm[j].location.longitude * 1 + + (returnAdjustmentPoint(j).ax / zoomLevel) * radius, + item.vm[j].location.latitude * 1 + + (returnAdjustmentPoint(j).ay / zoomLevel) * radius, + ]); + } + validateNum++; + } + if (item.vm.length == 1) { + // handling if there is only one vm so that we can not draw geometry + vmGeo.pop(); + vmGeo.push([ + item.vm[0].location.longitude * 1, + item.vm[0].location.latitude * 1, + ]); vmGeo.push([ - item.vm[j].location.longitude * 1, - item.vm[j].location.latitude * 1, + item.vm[0].location.longitude * 1 + Math.random() * 0.001, + item.vm[0].location.latitude * 1 + Math.random() * 0.001, ]); - } else { vmGeo.push([ - item.vm[j].location.longitude * 1 + - (returnAdjustmentPoint(j).ax / zoomLevel) * radius, - item.vm[j].location.latitude * 1 + - (returnAdjustmentPoint(j).ay / zoomLevel) * radius, + item.vm[0].location.longitude * 1 + Math.random() * 0.001, + item.vm[0].location.latitude * 1 + Math.random() * 0.001, ]); } - validateNum++; - } - if (item.vm.length == 1) { - // handling if there is only one vm so that we can not draw geometry - vmGeo.pop(); - vmGeo.push([ - item.vm[0].location.longitude * 1, - item.vm[0].location.latitude * 1, - ]); - vmGeo.push([ - item.vm[0].location.longitude * 1 + Math.random() * 0.001, - item.vm[0].location.latitude * 1 + Math.random() * 0.001, - ]); - vmGeo.push([ - item.vm[0].location.longitude * 1 + Math.random() * 0.001, - item.vm[0].location.latitude * 1 + Math.random() * 0.001, - ]); - } - if (validateNum == item.vm.length) { - //console.log("Found all GEOs validateNum : " + validateNum); + if (validateNum == item.vm.length) { + //console.log("Found all GEOs validateNum : " + validateNum); - //make dots without convexHull - makePolyDot(vmGeo); - vmGeo = convexHull(vmGeo); + //make dots without convexHull + makePolyDot(vmGeo); + vmGeo = convexHull(vmGeo); - mcisStatus[cnt] = item.status; + mcisStatus[cnt] = item.status; - var newName = item.name; - if (newName.includes("-nlb")) { - newName = "NLB"; - } + var newName = item.name; + if (newName.includes("-nlb")) { + newName = "NLB"; + } - if (item.targetAction == "None" || item.targetAction == "") { - mcisName[cnt] = "[" + newName + "]"; - } else { - mcisName[cnt] = item.targetAction + "-> " + "[" + newName + "]"; - } + if (item.targetAction == "None" || item.targetAction == "") { + mcisName[cnt] = "[" + newName + "]"; + } else { + mcisName[cnt] = item.targetAction + "-> " + "[" + newName + "]"; + } - //make poly with convexHull - makePolyArray(vmGeo); + //make poly with convexHull + makePolyArray(vmGeo); - cnt++; + cnt++; + } } + } else { + geometries = []; } - } else { - geometries = []; - } - }) - .catch(function (error) { - console.log(error); - }); + }) + .catch(function (error) { + console.log(error); + }); } } @@ -1229,20 +977,18 @@ function getConnection() { obj.connectionconfig.length + "\n"; - for (var i = 0; i < obj.connectionconfig.length; ++i) { - // title: CloudType, ID, DisplayName, Latitude, Longitude - // ex: azure, eastasia, East Asia, 22.2670, 114.1880 - providerName = obj.connectionconfig[i].ProviderName.toLowerCase(); - longitude = obj.connectionconfig[i].Location.longitude; - latitude = obj.connectionconfig[i].Location.latitude; - briefAddr = obj.connectionconfig[i].Location.briefAddr; - nativeRegion = obj.connectionconfig[i].Location.nativeRegion; + obj.connectionconfig.forEach((config, i) => { + const providerName = config.ProviderName.toLowerCase(); + const longitude = config.Location.longitude; + const latitude = config.Location.latitude; + const briefAddr = config.Location.briefAddr; + const nativeRegion = config.Location.nativeRegion; messageTextArea.value += "[" + i + "] " + - obj.connectionconfig[i].ProviderName + + config.ProviderName + "(" + nativeRegion + ")" + @@ -1255,40 +1001,21 @@ function getConnection() { briefAddr + ")\n"; - if (providerName == "azure") { - cspPointsAzure.push([longitude, latitude]); - } - if (providerName == "aws") { - cspPointsAws.push([longitude, latitude]); + // 배열이 존재하지 않는 경우 초기화 + if (!cspPoints[providerName]) { + cspPoints[providerName] = []; } - if (providerName == "gcp") { - cspPointsGcp.push([longitude, latitude]); - } - if (providerName == "ncpvpc") { - cspPointsNcpVpc.push([longitude, latitude]); - } - if (providerName == "alibaba") { - cspPointsAlibaba.push([longitude, latitude]); - } - if (providerName == "cloudit") { - cspPointsCloudit.push([longitude, latitude]); - } - if (providerName == "ibm") { - cspPointsIBM.push([longitude, latitude]); - } - if (providerName == "tencent") { - cspPointsTencent.push([longitude, latitude]); - } - } - geoCspPointsAzure[0] = new MultiPoint([cspPointsAzure]); - geoCspPointsAws[0] = new MultiPoint([cspPointsAws]); - geoCspPointsGcp[0] = new MultiPoint([cspPointsGcp]); - geoCspPointsNcpVpc[0] = new MultiPoint([cspPointsNcpVpc]); - geoCspPointsAlibaba[0] = new MultiPoint([cspPointsAlibaba]); - geoCspPointsCloudit[0] = new MultiPoint([cspPointsCloudit]); - geoCspPointsIBM[0] = new MultiPoint([cspPointsIBM]); - geoCspPointsTencent[0] = new MultiPoint([cspPointsTencent]); + cspPoints[providerName].push([longitude, latitude]); + + // geoCspPoints에 MultiPoint 객체 생성 + if (!geoCspPoints[providerName]) { + geoCspPoints[providerName] = []; + } + geoCspPoints[providerName][0] = new MultiPoint( + cspPoints[providerName] + ); + }); infoAlert("Registered Cloud Regions: " + obj.connectionconfig.length); } @@ -1788,7 +1515,6 @@ function addRegionMarker(spec) { password: `${password}`, }, }).then((res) => { - console.log(res); var connConfig = res.data.connectionName; @@ -2360,24 +2086,26 @@ function updateVmList() { username: `${username}`, password: `${password}`, }, - }).then((res) => { - if (res.data.output != null) { - for (let item of res.data.output) { - var option = document.createElement("option"); - option.value = item; - option.text = item; - selectElement.appendChild(option); - } - for (let i = 0; i < selectElement.options.length; i++) { - if (selectElement.options[i].value == previousSelection) { - selectElement.options[i].selected = true; - break; + }) + .then((res) => { + if (res.data.output != null) { + for (let item of res.data.output) { + var option = document.createElement("option"); + option.value = item; + option.text = item; + selectElement.appendChild(option); + } + for (let i = 0; i < selectElement.options.length; i++) { + if (selectElement.options[i].value == previousSelection) { + selectElement.options[i].selected = true; + break; + } } } - } - }).finally(function () { - updateIpList(); - }); + }) + .finally(function () { + updateIpList(); + }); } } window.updateVmList = updateVmList; @@ -2412,7 +2140,6 @@ function updateIpList() { password: `${password}`, }, }).then((res) => { - for (let subGroupAccessInfo of res.data.McisSubGroupAccessInfo) { if (subGroupAccessInfo.SubGroupId == groupid) { for (let vmAccessInfo of subGroupAccessInfo.McisVmAccessInfo) { @@ -2430,7 +2157,6 @@ function updateIpList() { } } } - }); } else { pubip.options.length = 0; @@ -2443,7 +2169,6 @@ document.getElementById("vmid").onmouseover = function () { updateVmList(); }; - function updateSubGroupList() { var selectElement = document.getElementById("subgroupid"); var previousSelection = selectElement.value; @@ -2573,32 +2298,31 @@ function updateConnectionList() { var username = usernameElement.value; var password = passwordElement.value; - var url = `http://${hostname}:${port}/tumblebug/connConfig`; + var url = `http://${hostname}:${port}/tumblebug/connConfig`; - axios({ - method: "get", - url: url, - auth: { - username: `${username}`, - password: `${password}`, - }, - }).then((res) => { - if (res.data.connectionconfig != null) { - for (let item of res.data.connectionconfig) { - var option = document.createElement("option"); - option.value = item.ConfigName; - option.text = item.ConfigName; - document.getElementById(typeStringConnection).appendChild(option); - } - for (let i = 0; i < selectElement.options.length; i++) { - if (selectElement.options[i].value == previousSelection) { - selectElement.options[i].selected = true; - break; - } + axios({ + method: "get", + url: url, + auth: { + username: `${username}`, + password: `${password}`, + }, + }).then((res) => { + if (res.data.connectionconfig != null) { + for (let item of res.data.connectionconfig) { + var option = document.createElement("option"); + option.value = item.ConfigName; + option.text = item.ConfigName; + document.getElementById(typeStringConnection).appendChild(option); + } + for (let i = 0; i < selectElement.options.length; i++) { + if (selectElement.options[i].value == previousSelection) { + selectElement.options[i].selected = true; + break; } } - }); - + } + }); } document.getElementById(typeStringConnection).onmouseover = function () { @@ -2945,7 +2669,7 @@ function startApp() { "wget -O ~/setgame.sh https://raw.githubusercontent.com/cloud-barista/cb-tumblebug/main/scripts/setgame.sh; chmod +x ~/setgame.sh; sudo ~/setgame.sh"; } else if (selectApp.value == "ELK") { defaultRemoteCommand = - "wget -O ~/startServer.sh https://raw.githubusercontent.com/cloud-barista/cb-tumblebug/main/scripts/usecases/elastic-stack/startELK.sh; chmod +x ~/startServer.sh; sudo ~/startServer.sh "; + "wget -O ~/startServer.sh https://raw.githubusercontent.com/cloud-barista/cb-tumblebug/main/scripts/usecases/elastic-stack/startELK.sh; chmod +x ~/startServer.sh; sudo ~/startServer.sh "; } else if (selectApp.value == "WeaveScope") { defaultRemoteCommand = "wget -O ~/startServer.sh https://raw.githubusercontent.com/cloud-barista/cb-tumblebug/main/scripts/usecases/weavescope/startServer.sh; chmod +x ~/startServer.sh; sudo ~/startServer.sh " + @@ -3374,66 +3098,61 @@ let xRequestIds = []; // Function to handle Axios response and extract X-Request-Id function handleAxiosResponse(response) { - // Extract X-Request-Id from the response headers - console.log('Response Headers:', response.headers); - const requestId = response.headers['x-request-id']; - console.log('X-Request-Id:', requestId); - if (requestId) { - - // Add X-Request-Id to the global array if it's not already present - if (!xRequestIds.includes(requestId)) { - xRequestIds.push(requestId); - addRequestIdToSelect(requestId); - } + // Extract X-Request-Id from the response headers + console.log("Response Headers:", response.headers); + const requestId = response.headers["x-request-id"]; + console.log("X-Request-Id:", requestId); + if (requestId) { + // Add X-Request-Id to the global array if it's not already present + if (!xRequestIds.includes(requestId)) { + xRequestIds.push(requestId); + addRequestIdToSelect(requestId); } + } } // Function to add X-Request-Id to the select element function addRequestIdToSelect(requestId) { - const select = document.getElementById('xRequestIdSelect'); - const option = document.createElement('option'); - option.value = requestId; - option.text = requestId; - select.appendChild(option); + const select = document.getElementById("xRequestIdSelect"); + const option = document.createElement("option"); + option.value = requestId; + option.text = requestId; + select.appendChild(option); } // Function to handle selection of an X-Request-Id function handleRequestIdSelection() { - const select = document.getElementById('xRequestIdSelect'); - const selectedRequestId = select.value; - console.log('Selected X-Request-Id:', selectedRequestId); + const select = document.getElementById("xRequestIdSelect"); + const selectedRequestId = select.value; + console.log("Selected X-Request-Id:", selectedRequestId); - // actions based on the selected X-Request-Id - - if (selectedRequestId) { + // actions based on the selected X-Request-Id - var hostname = hostnameElement.value; - var port = portElement.value; - var username = usernameElement.value; - var password = passwordElement.value; + if (selectedRequestId) { + var hostname = hostnameElement.value; + var port = portElement.value; + var username = usernameElement.value; + var password = passwordElement.value; - var url = `http://${hostname}:${port}/tumblebug/request/${selectedRequestId}`; - - axios({ - method: "get", - url: url, - auth: { - username: `${username}`, - password: `${password}`, - }, - }).then((res) => { - console.log(res); // for debug - displayJsonData(res.data, typeInfo); - }); - } else { - console.log('No X-Request-Id selected'); - } + var url = `http://${hostname}:${port}/tumblebug/request/${selectedRequestId}`; + axios({ + method: "get", + url: url, + auth: { + username: `${username}`, + password: `${password}`, + }, + }).then((res) => { + console.log(res); // for debug + displayJsonData(res.data, typeInfo); + }); + } else { + console.log("No X-Request-Id selected"); + } } window.handleRequestIdSelection = handleRequestIdSelection; - - window.onload = function () { // Get host address and update text field var tbServerAp = window.location.host; @@ -3458,25 +3177,13 @@ function drawMCIS(event) { var theta = (2 * Math.PI * frameState.time) / omegaTheta; // Draw CSP location first - if (Array.isArray(geoCspPointsCloudit) && geoCspPointsCloudit.length) { - // array exists and is not empty - vectorContext.setStyle(iconStyleCloudit); - vectorContext.drawGeometry(geoCspPointsCloudit[0]); - vectorContext.setStyle(iconStyleIBM); - vectorContext.drawGeometry(geoCspPointsIBM[0]); - vectorContext.setStyle(iconStyleTencent); - vectorContext.drawGeometry(geoCspPointsTencent[0]); - vectorContext.setStyle(iconStyleAlibaba); - vectorContext.drawGeometry(geoCspPointsAlibaba[0]); - vectorContext.setStyle(iconStyleNcpVpc); - vectorContext.drawGeometry(geoCspPointsNcpVpc[0]); - vectorContext.setStyle(iconStyleAzure); - vectorContext.drawGeometry(geoCspPointsAzure[0]); - vectorContext.setStyle(iconStyleAws); - vectorContext.drawGeometry(geoCspPointsAws[0]); - vectorContext.setStyle(iconStyleGcp); - vectorContext.drawGeometry(geoCspPointsGcp[0]); - } + Object.keys(cspIconStyles).forEach((csp) => { + if (Array.isArray(geoCspPoints[csp]) && geoCspPoints[csp].length) { + // 해당 CSP에 대한 지오메트리 배열이 존재하고 비어있지 않은 경우 + vectorContext.setStyle(cspIconStyles[csp]); // CSP에 맞는 스타일 설정 + vectorContext.drawGeometry(geoCspPoints[csp][0]); // 첫 번째 지오메트리 그리기 + } + }); if (cspPointsCircle.length) { //console.log("cspPointsCircle.length:" +cspPointsCircle.length + "cspPointsCircle["+cspPointsCircle+"]") diff --git a/package-lock.json b/package-lock.json index 55d2ee2..439906e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cb-mapui", - "version": "0.7.4", + "version": "0.8.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "cb-mapui", - "version": "0.7.4", + "version": "0.8.1", "license": "Apache-2.0", "dependencies": { "axios": "^1.6.0", @@ -26,7 +26,10 @@ "sweetalert2": "^11.4.14", "url": "^0.11.0" }, - "devDependencies": {} + "devDependencies": { + "https-browserify": "^1.0.0", + "util": "^0.12.5" + } }, "node_modules/@babel/code-frame": { "version": "7.22.13", @@ -2008,6 +2011,18 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, + "node_modules/available-typed-arrays": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.6.tgz", + "integrity": "sha512-j1QzY8iPNPG4o4xmO3ptzpRxTciqD3MgEHtifP/YnJpIo58Xu+ne4BejlbkuaLfXn/nz6HFiw29bLpj2PNMdGg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/axios": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz", @@ -2106,6 +2121,24 @@ "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==" }, + "node_modules/call-bind": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.6.tgz", + "integrity": "sha512-Mj50FLHtlsoVfRfnHaZvyrooHcrlceNZdL/QBvJJVd9Ta55qCQK0gs4ss2oZDeV9zFCs6ewzYgVE5yfVmfFpVg==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.3", + "set-function-length": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -2375,6 +2408,21 @@ "node": ">= 10" } }, + "node_modules/define-data-property": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.2.tgz", + "integrity": "sha512-SRtsSqsDbgpJBbW3pABMCOt6rQyeM8s8RiyeSN8jYG8sYmt/kGJejbydttUsnDs1tadr19tvhT4ShwMyoqAm4g==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.2", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -2495,6 +2543,15 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -2549,6 +2606,15 @@ } } }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -2562,6 +2628,15 @@ "node": ">= 6" } }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/geotiff": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/geotiff/-/geotiff-2.1.0.tgz", @@ -2580,6 +2655,25 @@ "node": ">=10.19" } }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/globals": { "version": "13.23.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", @@ -2594,6 +2688,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2602,6 +2708,69 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", + "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/htmlnano": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/htmlnano/-/htmlnano-2.1.0.tgz", @@ -2671,6 +2840,12 @@ "resolved": "https://registry.npmjs.org/http/-/http-0.0.1-security.tgz", "integrity": "sha512-RnDvP10Ty9FxqOtPZuxtebw1j4L/WiqNMDtuc1YMH1XQm5TgDRaR1G9u8upL6KD1bXHSp9eSXo/ED+8Q7FAr+g==" }, + "node_modules/https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==", + "dev": true + }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -2710,11 +2885,39 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -2723,6 +2926,21 @@ "node": ">=0.10.0" } }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -2747,6 +2965,21 @@ "node": ">=0.12.0" } }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/jquery": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", @@ -3493,6 +3726,23 @@ "node": ">=10" } }, + "node_modules/set-function-length": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", + "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.2", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -3687,6 +3937,19 @@ "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" }, + "node_modules/util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -3710,6 +3973,25 @@ "resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.2.0.tgz", "integrity": "sha512-PgF341avzqyx60neE9DD+XS26MMNMoUQRz9NOZwW32nPQrF6p77f1htcnjBSEV8BGMKZ16choqUG4hyI0Hx7mA==" }, + "node_modules/which-typed-array": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", + "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.6", + "call-bind": "^1.0.5", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/xml-utils": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/xml-utils/-/xml-utils-1.7.0.tgz", @@ -4899,6 +5181,12 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, + "available-typed-arrays": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.6.tgz", + "integrity": "sha512-j1QzY8iPNPG4o4xmO3ptzpRxTciqD3MgEHtifP/YnJpIo58Xu+ne4BejlbkuaLfXn/nz6HFiw29bLpj2PNMdGg==", + "dev": true + }, "axios": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz", @@ -4960,6 +5248,18 @@ "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==" }, + "call-bind": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.6.tgz", + "integrity": "sha512-Mj50FLHtlsoVfRfnHaZvyrooHcrlceNZdL/QBvJJVd9Ta55qCQK0gs4ss2oZDeV9zFCs6ewzYgVE5yfVmfFpVg==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.3", + "set-function-length": "^1.2.0" + } + }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -5137,6 +5437,18 @@ "minimist": "^1.2.0" } }, + "define-data-property": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.2.tgz", + "integrity": "sha512-SRtsSqsDbgpJBbW3pABMCOt6rQyeM8s8RiyeSN8jYG8sYmt/kGJejbydttUsnDs1tadr19tvhT4ShwMyoqAm4g==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.2", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.1" + } + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -5220,6 +5532,12 @@ "is-arrayish": "^0.2.1" } }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -5248,6 +5566,15 @@ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.0.tgz", "integrity": "sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ==" }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "requires": { + "is-callable": "^1.1.3" + } + }, "form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -5258,6 +5585,12 @@ "mime-types": "^2.1.12" } }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true + }, "geotiff": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/geotiff/-/geotiff-2.1.0.tgz", @@ -5273,6 +5606,19 @@ "zstddec": "^0.1.0" } }, + "get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + } + }, "globals": { "version": "13.23.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", @@ -5281,11 +5627,59 @@ "type-fest": "^0.20.2" } }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3" + } + }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, + "has-property-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", + "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.2" + } + }, + "has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true + }, + "has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.3" + } + }, + "hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, "htmlnano": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/htmlnano/-/htmlnano-2.1.0.tgz", @@ -5312,6 +5706,12 @@ "resolved": "https://registry.npmjs.org/http/-/http-0.0.1-security.tgz", "integrity": "sha512-RnDvP10Ty9FxqOtPZuxtebw1j4L/WiqNMDtuc1YMH1XQm5TgDRaR1G9u8upL6KD1bXHSp9eSXo/ED+8Q7FAr+g==" }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==", + "dev": true + }, "ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -5331,16 +5731,41 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" }, + "is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true + }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" }, + "is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -5359,6 +5784,15 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, + "is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "requires": { + "which-typed-array": "^1.1.14" + } + }, "jquery": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", @@ -5845,6 +6279,20 @@ "lru-cache": "^6.0.0" } }, + "set-function-length": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", + "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", + "dev": true, + "requires": { + "define-data-property": "^1.1.2", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.1" + } + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -5976,6 +6424,19 @@ } } }, + "util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -5996,6 +6457,19 @@ "resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.2.0.tgz", "integrity": "sha512-PgF341avzqyx60neE9DD+XS26MMNMoUQRz9NOZwW32nPQrF6p77f1htcnjBSEV8BGMKZ16choqUG4hyI0Hx7mA==" }, + "which-typed-array": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", + "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.6", + "call-bind": "^1.0.5", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.1" + } + }, "xml-utils": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/xml-utils/-/xml-utils-1.7.0.tgz", diff --git a/package.json b/package.json index d01830e..c7c13f7 100644 --- a/package.json +++ b/package.json @@ -4,21 +4,23 @@ "axios": "^1.6.0", "buffer": "^6.0.3", "csv-parser": "^3.0.0", + "events": "^3.3.0", "http": "^0.0.1-security", "jquery": "^3.7.1", "json-formatter-js": "^2.3.4", "ol": "^8.1.0", "parcel": "^2.10.1", - "stream-http": "^3.2.0", - "sweetalert2": "^11.4.14", - "events": "^3.3.0", "process": "^0.11.10", - "url": "^0.11.0", - "stream-browserify": "^3.0.0", + "punycode": "^1.4.1", "querystring-es3": "^0.2.1", - "punycode": "^1.4.1" + "stream-browserify": "^3.0.0", + "stream-http": "^3.2.0", + "sweetalert2": "^11.4.14", + "url": "^0.11.0" }, "devDependencies": { + "https-browserify": "^1.0.0", + "util": "^0.12.5" }, "scripts": { "start": "parcel -p 1324 index.html",