Skip to content

Commit

Permalink
Apply connection changes to map
Browse files Browse the repository at this point in the history
  • Loading branch information
cb-github-robot authored May 2, 2024
2 parents 75a1187 + b885ac5 commit 46796a6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
30 changes: 24 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ function getMcis() {
makePolyDot(vmGeo);
vmGeo = convexHull(vmGeo);

mcisStatus[cnt] = item.status;
mcisStatus[cnt] = item.status;fv

var newName = item.name;
if (newName.includes("-nlb")) {
Expand Down Expand Up @@ -912,7 +912,7 @@ function getConnection() {
: 5;
//setTimeout(() => console.log(getConnection()), filteredRefreshInterval*1000);

var url = `http://${hostname}:${port}/tumblebug/connConfig`;
var url = `http://${hostname}:${port}/tumblebug/connConfig?filterVerified=true&filterRegionRepresentative=true`;

axios({
method: "get",
Expand All @@ -927,7 +927,7 @@ function getConnection() {
var obj = res.data;
if (obj.connectionconfig != null) {
messageTextArea.value =
"[Complete] Number of Registered Cloud Regions: " +
"[Complete] Registered Cloud Regions: " +
obj.connectionconfig.length +
"\n";

Expand Down Expand Up @@ -979,6 +979,7 @@ function getConnection() {
document.getElementById("port").style.color = "#FF0000";
}
console.log(error);
infoAlert("Cannot get cloud info \n(check the server status and refresh)");
});
}
window.getConnection = getConnection;
Expand Down Expand Up @@ -1332,6 +1333,10 @@ function getRecommendedSpec(idx, latitude, longitude) {
console.log(res); // for debug
handleAxiosResponse(res);

if (res.data == null) {
errorAlert("No recommended spec found with the given condition");
return;
}
if (res.data.length == 0) {
errorAlert("No recommended spec found with the given condition");
return;
Expand Down Expand Up @@ -1426,6 +1431,12 @@ function getRecommendedSpec(idx, latitude, longitude) {
geoCspPointsCircle[0] = new MultiPoint([cspPointsCircle]);
}
});
}).catch(function (error) {
console.log(error);
errorAlert("Cannnot recommend a spec (Check log for details)");
if (error.response && error.response.data) {
displayJsonData(error.response.data, typeError);
}
});
}
window.getRecommendedSpec = getRecommendedSpec;
Expand Down Expand Up @@ -2300,7 +2311,7 @@ function updateConnectionList() {
var username = usernameElement.value;
var password = passwordElement.value;

var url = `http://${hostname}:${port}/tumblebug/connConfig`;
var url = `http://${hostname}:${port}/tumblebug/connConfig?filterVerified=true&filterRegionRepresentative=true`;

axios({
method: "get",
Expand All @@ -2313,8 +2324,9 @@ function updateConnectionList() {
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;
option.value = item.configName;
option.text = item.configName;
//option.text = item.providerName + "/" + item.regionDetail.regionName;
document.getElementById(typeStringConnection).appendChild(option);
}
for (let i = 0; i < selectElement.options.length; i++) {
Expand All @@ -2324,6 +2336,12 @@ function updateConnectionList() {
}
}
}
}).catch(function (error) {
console.log(error);
//errorAlert("Failed to get connection list");
if (error.response && error.response.data) {
displayJsonData(error.response.data, typeError);
}
});
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"build": "echo 'Removing temporal cache files' && rm -rf dist/* .parcel-cache/* && mkdir -p dist/img/ && cp -r img/ dist/ && parcel build --public-url . index.html"
},
"description": "MapUI Client for CB-Tumblebug (display multi-cloud infra service)",
"version": "0.8.10",
"version": "0.8.11",
"repository": {
"type": "git",
"url": "git+https://github.com/cloud-barista/cb-mapui.git"
Expand Down

0 comments on commit 46796a6

Please sign in to comment.