Skip to content

Commit

Permalink
fix vps logic
Browse files Browse the repository at this point in the history
  • Loading branch information
PingHuskar committed Dec 7, 2023
1 parent 46f0556 commit db1d833
Show file tree
Hide file tree
Showing 6 changed files with 26,810 additions and 6 deletions.
24 changes: 18 additions & 6 deletions ingress/VPS/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,34 @@ var LeafIcon = L.Icon.extend({
let delay = 300
let c = []

let err = ''

const readJson500 = (filename) => {
axios.get(`data/${filename}.json`)
.then(res => res.data.pois)
.then(res => res.data)
.then((data) => {
if (data.pois) return data.pois
return data
})
.then((pois) => {
// console.log(pois)
for (const poi of pois) {
if (poi.state != `LIVE`) continue
console.log(poi)
if (!poi.vpsActivated) continue
// console.log(poi)
L.marker([poi.lat,poi.lng])
.bindPopup(poi.title)
.bindTooltip(poi.title)
.addTo(map)
}
})
.then(() => {
readJson500(filename + 1)
})
.catch((e) => {
err = e
console.log(err)
})
}

for (let i = 1; i < 10; i++) {
readJson500(i)
}

readJson500(1)
Loading

0 comments on commit db1d833

Please sign in to comment.