Skip to content

Commit

Permalink
enhance predict feature and add nginx for UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Nguyen-Duc-Khai committed Nov 18, 2023
1 parent 05a431a commit 4b1e905
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 9 deletions.
23 changes: 14 additions & 9 deletions client/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const API_URL = "https://api.airchecker.online";
const PREDICT_URL = "http://localhost:8081";
const API_URL = "http://api.airqual.tech";
const PREDICT_URL = "http://predict.airqual.tech";

// const API_URL = "http://localhost";
// const PREDICT_URL = "http://localhost:8081";
Expand Down Expand Up @@ -585,7 +585,7 @@ $(function () {
title: "View detail pollutants",
},
forecast: {
title: "Next 2 days forecast",
title: "Forecast today and tomorrow",
aqi: "Air Quality Index",
},
},
Expand All @@ -609,7 +609,7 @@ $(function () {
title: "Xem chi tiết chất ô nhiễm",
},
forecast: {
title: "Dự báo 2 ngày tới",
title: "Dự báo hôm nay và ngày mai",
aqi: "Chỉ số chất lượng không khí",
},
},
Expand Down Expand Up @@ -673,10 +673,15 @@ function langBoxOnClick(event) {
aqiDescription.innerHTML =
aqiInfoLanguage[aqiLevel.classList[0]][chosenLng]["description"];

var forecastAqiLevel = document.getElementById("forecast-level");
// FORECAST
var forecastAqiLevels = document.getElementsByClassName("forecast-level");

forecastAqiLevel.innerHTML =
aqiInfoLanguage[forecastAqiLevel.classList[0]][chosenLng][
"levelsOfConcern"
];
for (const forecastAqiLevel of forecastAqiLevels) {
let length = forecastAqiLevel.classList.length;

forecastAqiLevel.children[0].innerHTML =
aqiInfoLanguage[forecastAqiLevel.classList[length - 1]][chosenLng][
"levelsOfConcern"
];
}
}
8 changes: 8 additions & 0 deletions client/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ h6 {
height: fit-content;
padding: 32px 0px;
border-radius: 16px;
margin-bottom: 32px;
}

section {
Expand Down Expand Up @@ -228,9 +229,16 @@ h1 {

.forecast > .inner-wrap {
width: 100%;
}

.forecast > .inner-wrap:first-child {
margin-bottom: 2em;
}

.forecast > .inner-wrap:last-child {
margin-top: 2em;
}

.forecast-box {
display: flex;
justify-content: space-between;
Expand Down
21 changes: 21 additions & 0 deletions nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,25 @@ server {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}

server {
listen 80;

server_name airqual.tech;

location / {
root /app/client;
index index.html;

location /assets {
alias /app/client/assets;
autoindex on;
}

location /scripts {
alias /app/client/scripts;
autoindex on;
}
}
}

0 comments on commit 4b1e905

Please sign in to comment.