From 9371e1efb7c2c970177224a144794d581f86a2f9 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Sat, 19 Mar 2022 17:40:45 +0100 Subject: [PATCH 01/12] vuejs stuff --- public/css/custom.css | 32 -- public/embed.go | 14 +- public/index.html | 17 +- public/js/.jshintignore | 2 - public/js/.jshintrc | 8 +- public/js/app.js | 11 + public/js/main.js | 28 +- public/js/rollup.config.js | 4 +- public/js/routes.js | 12 +- public/{ => old}/css/bootstrap.min.css | 0 public/old/css/custom.css | 32 ++ public/{ => old}/css/fontawesome.min.css | 0 public/{ => old}/css/images/layers-2x.png | Bin public/{ => old}/css/images/layers.png | Bin .../{ => old}/css/images/marker-icon-2x.png | Bin .../css/images/marker-icon-green.png | Bin .../{ => old}/css/images/marker-icon-red.png | Bin public/{ => old}/css/images/marker-icon.png | Bin public/{ => old}/css/images/marker-shadow.png | Bin public/{ => old}/css/images/markers-matte.png | Bin .../{ => old}/css/images/markers-matte@2x.png | Bin public/{ => old}/css/images/markers-plain.png | Bin .../{ => old}/css/images/markers-shadow.png | Bin .../css/images/markers-shadow@2x.png | Bin public/{ => old}/css/images/markers-soft.png | Bin .../{ => old}/css/images/markers-soft@2x.png | Bin .../{ => old}/css/leaflet.awesome-markers.css | 0 public/{ => old}/css/leaflet.css | 0 public/{ => old}/js/.gitignore | 0 public/old/js/.jshintignore | 3 + public/old/js/.jshintrc | 12 + public/{ => old}/js/LayerManager.js | 0 public/{ => old}/js/WebSocketChannel.js | 0 public/{ => old}/js/api.js | 0 public/{ => old}/js/compat.js | 0 .../{ => old}/js/components/LayerSelector.js | 0 public/{ => old}/js/components/Map.js | 0 public/{ => old}/js/components/Search.js | 0 public/{ => old}/js/components/SearchInput.js | 0 .../{ => old}/js/components/SearchResult.js | 0 public/{ => old}/js/components/WorldStats.js | 0 public/{ => old}/js/config.js | 0 public/{ => old}/js/lib/HtmlSanitizer.js | 0 .../js/lib/leaflet.awesome-markers.js | 0 public/{ => old}/js/lib/leaflet.js | 0 public/{ => old}/js/lib/mithril.min.js | 0 public/{ => old}/js/lib/moment.min.js | 0 public/old/js/main.js | 21 + public/{ => old}/js/map/CoordinatesDisplay.js | 0 public/{ => old}/js/map/CustomOverlay.js | 0 public/{ => old}/js/map/MapFactory.js | 0 public/{ => old}/js/map/Overlaysetup.js | 0 public/{ => old}/js/map/RealtimeTileLayer.js | 0 public/{ => old}/js/map/SimpleCRS.js | 0 public/{ => old}/js/map/TopRightControl.js | 0 public/{ => old}/js/map/WorldInfoDisplay.js | 0 .../{ => old}/js/map/overlays/ATMOverlay.js | 0 .../js/map/overlays/AbstractGeoJsonOverlay.js | 0 .../js/map/overlays/AbstractIconOverlay.js | 0 .../{ => old}/js/map/overlays/BonesOverlay.js | 0 .../js/map/overlays/BorderOverlay.js | 0 .../js/map/overlays/DigitermOverlay.js | 0 .../{ => old}/js/map/overlays/LabelOverlay.js | 0 .../{ => old}/js/map/overlays/LcdOverlay.js | 0 .../js/map/overlays/LocatorOverlay.js | 0 .../js/map/overlays/LuacontrollerOverlay.js | 0 .../js/map/overlays/MinecartOverlay.js | 0 .../js/map/overlays/MissionOverlay.js | 0 .../js/map/overlays/PlayerOverlay.js | 0 .../{ => old}/js/map/overlays/PoiOverlay.js | 0 .../js/map/overlays/PrivProtectorOverlay.js | 0 .../js/map/overlays/ProtectorOverlay.js | 0 .../{ => old}/js/map/overlays/ShopOverlay.js | 0 .../{ => old}/js/map/overlays/SignOverlay.js | 0 .../js/map/overlays/TechnicAnchorOverlay.js | 0 .../js/map/overlays/TechnicQuarryOverlay.js | 0 .../js/map/overlays/TechnicSwitchOverlay.js | 0 .../{ => old}/js/map/overlays/TrainOverlay.js | 0 .../js/map/overlays/TrainlineOverlay.js | 0 .../js/map/overlays/TrainsignalOverlay.js | 0 .../js/map/overlays/TravelnetOverlay.js | 0 .../js/map/overlays/XPProtectorOverlay.js | 0 public/old/js/rollup.config.js | 10 + public/old/js/routes.js | 8 + public/{ => old}/js/util/debounce.js | 0 public/{ => old}/webfonts/fa-brands-400.eot | Bin public/{ => old}/webfonts/fa-brands-400.svg | 0 public/{ => old}/webfonts/fa-brands-400.ttf | Bin public/{ => old}/webfonts/fa-brands-400.woff | Bin public/{ => old}/webfonts/fa-brands-400.woff2 | Bin public/{ => old}/webfonts/fa-regular-400.eot | Bin public/{ => old}/webfonts/fa-regular-400.svg | 0 public/{ => old}/webfonts/fa-regular-400.ttf | Bin public/{ => old}/webfonts/fa-regular-400.woff | Bin .../{ => old}/webfonts/fa-regular-400.woff2 | Bin public/{ => old}/webfonts/fa-solid-900.eot | Bin public/{ => old}/webfonts/fa-solid-900.svg | 0 public/{ => old}/webfonts/fa-solid-900.ttf | Bin public/{ => old}/webfonts/fa-solid-900.woff | Bin public/{ => old}/webfonts/fa-solid-900.woff2 | Bin public/package-lock.json | 488 +++++++++++++++--- public/package.json | 12 +- 102 files changed, 565 insertions(+), 149 deletions(-) create mode 100644 public/js/app.js rename public/{ => old}/css/bootstrap.min.css (100%) create mode 100644 public/old/css/custom.css rename public/{ => old}/css/fontawesome.min.css (100%) rename public/{ => old}/css/images/layers-2x.png (100%) rename public/{ => old}/css/images/layers.png (100%) rename public/{ => old}/css/images/marker-icon-2x.png (100%) rename public/{ => old}/css/images/marker-icon-green.png (100%) rename public/{ => old}/css/images/marker-icon-red.png (100%) rename public/{ => old}/css/images/marker-icon.png (100%) rename public/{ => old}/css/images/marker-shadow.png (100%) rename public/{ => old}/css/images/markers-matte.png (100%) rename public/{ => old}/css/images/markers-matte@2x.png (100%) rename public/{ => old}/css/images/markers-plain.png (100%) rename public/{ => old}/css/images/markers-shadow.png (100%) rename public/{ => old}/css/images/markers-shadow@2x.png (100%) rename public/{ => old}/css/images/markers-soft.png (100%) rename public/{ => old}/css/images/markers-soft@2x.png (100%) rename public/{ => old}/css/leaflet.awesome-markers.css (100%) rename public/{ => old}/css/leaflet.css (100%) rename public/{ => old}/js/.gitignore (100%) create mode 100644 public/old/js/.jshintignore create mode 100644 public/old/js/.jshintrc rename public/{ => old}/js/LayerManager.js (100%) rename public/{ => old}/js/WebSocketChannel.js (100%) rename public/{ => old}/js/api.js (100%) rename public/{ => old}/js/compat.js (100%) rename public/{ => old}/js/components/LayerSelector.js (100%) rename public/{ => old}/js/components/Map.js (100%) rename public/{ => old}/js/components/Search.js (100%) rename public/{ => old}/js/components/SearchInput.js (100%) rename public/{ => old}/js/components/SearchResult.js (100%) rename public/{ => old}/js/components/WorldStats.js (100%) rename public/{ => old}/js/config.js (100%) rename public/{ => old}/js/lib/HtmlSanitizer.js (100%) rename public/{ => old}/js/lib/leaflet.awesome-markers.js (100%) rename public/{ => old}/js/lib/leaflet.js (100%) rename public/{ => old}/js/lib/mithril.min.js (100%) rename public/{ => old}/js/lib/moment.min.js (100%) create mode 100644 public/old/js/main.js rename public/{ => old}/js/map/CoordinatesDisplay.js (100%) rename public/{ => old}/js/map/CustomOverlay.js (100%) rename public/{ => old}/js/map/MapFactory.js (100%) rename public/{ => old}/js/map/Overlaysetup.js (100%) rename public/{ => old}/js/map/RealtimeTileLayer.js (100%) rename public/{ => old}/js/map/SimpleCRS.js (100%) rename public/{ => old}/js/map/TopRightControl.js (100%) rename public/{ => old}/js/map/WorldInfoDisplay.js (100%) rename public/{ => old}/js/map/overlays/ATMOverlay.js (100%) rename public/{ => old}/js/map/overlays/AbstractGeoJsonOverlay.js (100%) rename public/{ => old}/js/map/overlays/AbstractIconOverlay.js (100%) rename public/{ => old}/js/map/overlays/BonesOverlay.js (100%) rename public/{ => old}/js/map/overlays/BorderOverlay.js (100%) rename public/{ => old}/js/map/overlays/DigitermOverlay.js (100%) rename public/{ => old}/js/map/overlays/LabelOverlay.js (100%) rename public/{ => old}/js/map/overlays/LcdOverlay.js (100%) rename public/{ => old}/js/map/overlays/LocatorOverlay.js (100%) rename public/{ => old}/js/map/overlays/LuacontrollerOverlay.js (100%) rename public/{ => old}/js/map/overlays/MinecartOverlay.js (100%) rename public/{ => old}/js/map/overlays/MissionOverlay.js (100%) rename public/{ => old}/js/map/overlays/PlayerOverlay.js (100%) rename public/{ => old}/js/map/overlays/PoiOverlay.js (100%) rename public/{ => old}/js/map/overlays/PrivProtectorOverlay.js (100%) rename public/{ => old}/js/map/overlays/ProtectorOverlay.js (100%) rename public/{ => old}/js/map/overlays/ShopOverlay.js (100%) rename public/{ => old}/js/map/overlays/SignOverlay.js (100%) rename public/{ => old}/js/map/overlays/TechnicAnchorOverlay.js (100%) rename public/{ => old}/js/map/overlays/TechnicQuarryOverlay.js (100%) rename public/{ => old}/js/map/overlays/TechnicSwitchOverlay.js (100%) rename public/{ => old}/js/map/overlays/TrainOverlay.js (100%) rename public/{ => old}/js/map/overlays/TrainlineOverlay.js (100%) rename public/{ => old}/js/map/overlays/TrainsignalOverlay.js (100%) rename public/{ => old}/js/map/overlays/TravelnetOverlay.js (100%) rename public/{ => old}/js/map/overlays/XPProtectorOverlay.js (100%) create mode 100644 public/old/js/rollup.config.js create mode 100644 public/old/js/routes.js rename public/{ => old}/js/util/debounce.js (100%) rename public/{ => old}/webfonts/fa-brands-400.eot (100%) rename public/{ => old}/webfonts/fa-brands-400.svg (100%) rename public/{ => old}/webfonts/fa-brands-400.ttf (100%) rename public/{ => old}/webfonts/fa-brands-400.woff (100%) rename public/{ => old}/webfonts/fa-brands-400.woff2 (100%) rename public/{ => old}/webfonts/fa-regular-400.eot (100%) rename public/{ => old}/webfonts/fa-regular-400.svg (100%) rename public/{ => old}/webfonts/fa-regular-400.ttf (100%) rename public/{ => old}/webfonts/fa-regular-400.woff (100%) rename public/{ => old}/webfonts/fa-regular-400.woff2 (100%) rename public/{ => old}/webfonts/fa-solid-900.eot (100%) rename public/{ => old}/webfonts/fa-solid-900.svg (100%) rename public/{ => old}/webfonts/fa-solid-900.ttf (100%) rename public/{ => old}/webfonts/fa-solid-900.woff (100%) rename public/{ => old}/webfonts/fa-solid-900.woff2 (100%) diff --git a/public/css/custom.css b/public/css/custom.css index 2cd8b1c7..e69de29b 100644 --- a/public/css/custom.css +++ b/public/css/custom.css @@ -1,32 +0,0 @@ - -html { - height: 100%; - margin: 0; -} -body { - height: 100%; - margin: 0; -} - -#app { - height: 100%; -} - -#title { - text-align: center; -} - -.full-screen { - width: 100%; - height: 100%; -} - -.leaflet-custom-display { - background: #fff; - padding: 5px; -} - -.mapserver-label-icon { - margin-left: -100px !important; - margin-top: -100px !important; -} diff --git a/public/embed.go b/public/embed.go index d24fd420..ee35141a 100644 --- a/public/embed.go +++ b/public/embed.go @@ -2,12 +2,16 @@ package public import "embed" +//go:embed js/* css/* pics/* index.html +//go:embed node_modules/vue/dist/vue.global.prod.js +//go:embed node_modules/vue-router/dist/vue-router.global.prod.js +//go:embed node_modules/@fortawesome/fontawesome-free/css/all.min.css +//go:embed node_modules/@fortawesome/fontawesome-free/webfonts/* +//go:embed node_modules/leaflet/dist/leaflet.js +//go:embed node_modules/leaflet/dist/leaflet.css +//go:embed node_modules/leaflet/dist/images +//go:embed node_modules/leaflet.awesome-markers/dist/leaflet.awesome-markers.css //go:embed colors/* -//go:embed css/* -//go:embed pics/* //go:embed sql/* -//go:embed webfonts/* -//go:embed *.html //go:embed *.txt -//go:embed js/* var Files embed.FS diff --git a/public/index.html b/public/index.html index b3e8022e..285746c4 100644 --- a/public/index.html +++ b/public/index.html @@ -5,11 +5,11 @@ - - - - - + + + + + Minetest Mapserver @@ -21,10 +21,9 @@
Starting mapserver...
- - - - + + + diff --git a/public/js/.jshintignore b/public/js/.jshintignore index e3f620ea..0e804e3a 100644 --- a/public/js/.jshintignore +++ b/public/js/.jshintignore @@ -1,3 +1 @@ bundle.js -bundle-stats.js -lib/* diff --git a/public/js/.jshintrc b/public/js/.jshintrc index e0cc1ce6..bcc2cbc7 100644 --- a/public/js/.jshintrc +++ b/public/js/.jshintrc @@ -4,9 +4,9 @@ "esversion": 6, "browser": true, "globals": { - "L": true, - "m": true, - "THREE": true, - "console": true + "Vue": true, + "VueRouter": true, + "console": true, + "L": true } } diff --git a/public/js/app.js b/public/js/app.js new file mode 100644 index 00000000..9dfa6959 --- /dev/null +++ b/public/js/app.js @@ -0,0 +1,11 @@ +export default { + template: /*html*/` +
+
+
+ TODO: content + +
+
+ ` +}; diff --git a/public/js/main.js b/public/js/main.js index a24ce8fb..1151a827 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -1,21 +1,13 @@ - -import { getConfig } from './api.js'; +import App from './app.js'; import routes from './routes.js'; -import wsChannel from './WebSocketChannel.js'; -import config from './config.js'; -import { hashCompat } from './compat.js'; -import layerManager from './LayerManager.js'; - -// hash route compat -hashCompat(); -getConfig() -.then(cfg => { - layerManager.setup(cfg.layers); - config.set(cfg); - wsChannel.connect(); - m.route(document.getElementById("app"), "/map/0/12/0/0", routes); -}) -.catch(e => { - document.getElementById("app").innerHTML = e; +// create router instance +const router = VueRouter.createRouter({ + history: VueRouter.createWebHashHistory(), + routes: routes }); + +// start vue +const app = Vue.createApp(App); +app.use(router); +app.mount("#app"); diff --git a/public/js/rollup.config.js b/public/js/rollup.config.js index d1a98d16..163f6b50 100644 --- a/public/js/rollup.config.js +++ b/public/js/rollup.config.js @@ -1,5 +1,5 @@ -export default { +export default [{ input: 'main.js', output: { file :'bundle.js', @@ -7,4 +7,4 @@ export default { sourcemap: true, compact: true } -}; +}]; diff --git a/public/js/routes.js b/public/js/routes.js index d12e8dff..f555b1ac 100644 --- a/public/js/routes.js +++ b/public/js/routes.js @@ -1,8 +1,6 @@ -import Map from './components/Map.js'; -import Search from './components/Search.js'; - -export default { - "/map/:layerId/:zoom/:lon/:lat": Map, - "/search/:query": Search -}; +export default [{ + path: "/", component: { + template: "
start
" + } +}]; diff --git a/public/css/bootstrap.min.css b/public/old/css/bootstrap.min.css similarity index 100% rename from public/css/bootstrap.min.css rename to public/old/css/bootstrap.min.css diff --git a/public/old/css/custom.css b/public/old/css/custom.css new file mode 100644 index 00000000..2cd8b1c7 --- /dev/null +++ b/public/old/css/custom.css @@ -0,0 +1,32 @@ + +html { + height: 100%; + margin: 0; +} +body { + height: 100%; + margin: 0; +} + +#app { + height: 100%; +} + +#title { + text-align: center; +} + +.full-screen { + width: 100%; + height: 100%; +} + +.leaflet-custom-display { + background: #fff; + padding: 5px; +} + +.mapserver-label-icon { + margin-left: -100px !important; + margin-top: -100px !important; +} diff --git a/public/css/fontawesome.min.css b/public/old/css/fontawesome.min.css similarity index 100% rename from public/css/fontawesome.min.css rename to public/old/css/fontawesome.min.css diff --git a/public/css/images/layers-2x.png b/public/old/css/images/layers-2x.png similarity index 100% rename from public/css/images/layers-2x.png rename to public/old/css/images/layers-2x.png diff --git a/public/css/images/layers.png b/public/old/css/images/layers.png similarity index 100% rename from public/css/images/layers.png rename to public/old/css/images/layers.png diff --git a/public/css/images/marker-icon-2x.png b/public/old/css/images/marker-icon-2x.png similarity index 100% rename from public/css/images/marker-icon-2x.png rename to public/old/css/images/marker-icon-2x.png diff --git a/public/css/images/marker-icon-green.png b/public/old/css/images/marker-icon-green.png similarity index 100% rename from public/css/images/marker-icon-green.png rename to public/old/css/images/marker-icon-green.png diff --git a/public/css/images/marker-icon-red.png b/public/old/css/images/marker-icon-red.png similarity index 100% rename from public/css/images/marker-icon-red.png rename to public/old/css/images/marker-icon-red.png diff --git a/public/css/images/marker-icon.png b/public/old/css/images/marker-icon.png similarity index 100% rename from public/css/images/marker-icon.png rename to public/old/css/images/marker-icon.png diff --git a/public/css/images/marker-shadow.png b/public/old/css/images/marker-shadow.png similarity index 100% rename from public/css/images/marker-shadow.png rename to public/old/css/images/marker-shadow.png diff --git a/public/css/images/markers-matte.png b/public/old/css/images/markers-matte.png similarity index 100% rename from public/css/images/markers-matte.png rename to public/old/css/images/markers-matte.png diff --git a/public/css/images/markers-matte@2x.png b/public/old/css/images/markers-matte@2x.png similarity index 100% rename from public/css/images/markers-matte@2x.png rename to public/old/css/images/markers-matte@2x.png diff --git a/public/css/images/markers-plain.png b/public/old/css/images/markers-plain.png similarity index 100% rename from public/css/images/markers-plain.png rename to public/old/css/images/markers-plain.png diff --git a/public/css/images/markers-shadow.png b/public/old/css/images/markers-shadow.png similarity index 100% rename from public/css/images/markers-shadow.png rename to public/old/css/images/markers-shadow.png diff --git a/public/css/images/markers-shadow@2x.png b/public/old/css/images/markers-shadow@2x.png similarity index 100% rename from public/css/images/markers-shadow@2x.png rename to public/old/css/images/markers-shadow@2x.png diff --git a/public/css/images/markers-soft.png b/public/old/css/images/markers-soft.png similarity index 100% rename from public/css/images/markers-soft.png rename to public/old/css/images/markers-soft.png diff --git a/public/css/images/markers-soft@2x.png b/public/old/css/images/markers-soft@2x.png similarity index 100% rename from public/css/images/markers-soft@2x.png rename to public/old/css/images/markers-soft@2x.png diff --git a/public/css/leaflet.awesome-markers.css b/public/old/css/leaflet.awesome-markers.css similarity index 100% rename from public/css/leaflet.awesome-markers.css rename to public/old/css/leaflet.awesome-markers.css diff --git a/public/css/leaflet.css b/public/old/css/leaflet.css similarity index 100% rename from public/css/leaflet.css rename to public/old/css/leaflet.css diff --git a/public/js/.gitignore b/public/old/js/.gitignore similarity index 100% rename from public/js/.gitignore rename to public/old/js/.gitignore diff --git a/public/old/js/.jshintignore b/public/old/js/.jshintignore new file mode 100644 index 00000000..e3f620ea --- /dev/null +++ b/public/old/js/.jshintignore @@ -0,0 +1,3 @@ +bundle.js +bundle-stats.js +lib/* diff --git a/public/old/js/.jshintrc b/public/old/js/.jshintrc new file mode 100644 index 00000000..e0cc1ce6 --- /dev/null +++ b/public/old/js/.jshintrc @@ -0,0 +1,12 @@ +{ + "undef": true, + "unused": true, + "esversion": 6, + "browser": true, + "globals": { + "L": true, + "m": true, + "THREE": true, + "console": true + } +} diff --git a/public/js/LayerManager.js b/public/old/js/LayerManager.js similarity index 100% rename from public/js/LayerManager.js rename to public/old/js/LayerManager.js diff --git a/public/js/WebSocketChannel.js b/public/old/js/WebSocketChannel.js similarity index 100% rename from public/js/WebSocketChannel.js rename to public/old/js/WebSocketChannel.js diff --git a/public/js/api.js b/public/old/js/api.js similarity index 100% rename from public/js/api.js rename to public/old/js/api.js diff --git a/public/js/compat.js b/public/old/js/compat.js similarity index 100% rename from public/js/compat.js rename to public/old/js/compat.js diff --git a/public/js/components/LayerSelector.js b/public/old/js/components/LayerSelector.js similarity index 100% rename from public/js/components/LayerSelector.js rename to public/old/js/components/LayerSelector.js diff --git a/public/js/components/Map.js b/public/old/js/components/Map.js similarity index 100% rename from public/js/components/Map.js rename to public/old/js/components/Map.js diff --git a/public/js/components/Search.js b/public/old/js/components/Search.js similarity index 100% rename from public/js/components/Search.js rename to public/old/js/components/Search.js diff --git a/public/js/components/SearchInput.js b/public/old/js/components/SearchInput.js similarity index 100% rename from public/js/components/SearchInput.js rename to public/old/js/components/SearchInput.js diff --git a/public/js/components/SearchResult.js b/public/old/js/components/SearchResult.js similarity index 100% rename from public/js/components/SearchResult.js rename to public/old/js/components/SearchResult.js diff --git a/public/js/components/WorldStats.js b/public/old/js/components/WorldStats.js similarity index 100% rename from public/js/components/WorldStats.js rename to public/old/js/components/WorldStats.js diff --git a/public/js/config.js b/public/old/js/config.js similarity index 100% rename from public/js/config.js rename to public/old/js/config.js diff --git a/public/js/lib/HtmlSanitizer.js b/public/old/js/lib/HtmlSanitizer.js similarity index 100% rename from public/js/lib/HtmlSanitizer.js rename to public/old/js/lib/HtmlSanitizer.js diff --git a/public/js/lib/leaflet.awesome-markers.js b/public/old/js/lib/leaflet.awesome-markers.js similarity index 100% rename from public/js/lib/leaflet.awesome-markers.js rename to public/old/js/lib/leaflet.awesome-markers.js diff --git a/public/js/lib/leaflet.js b/public/old/js/lib/leaflet.js similarity index 100% rename from public/js/lib/leaflet.js rename to public/old/js/lib/leaflet.js diff --git a/public/js/lib/mithril.min.js b/public/old/js/lib/mithril.min.js similarity index 100% rename from public/js/lib/mithril.min.js rename to public/old/js/lib/mithril.min.js diff --git a/public/js/lib/moment.min.js b/public/old/js/lib/moment.min.js similarity index 100% rename from public/js/lib/moment.min.js rename to public/old/js/lib/moment.min.js diff --git a/public/old/js/main.js b/public/old/js/main.js new file mode 100644 index 00000000..a24ce8fb --- /dev/null +++ b/public/old/js/main.js @@ -0,0 +1,21 @@ + +import { getConfig } from './api.js'; +import routes from './routes.js'; +import wsChannel from './WebSocketChannel.js'; +import config from './config.js'; +import { hashCompat } from './compat.js'; +import layerManager from './LayerManager.js'; + +// hash route compat +hashCompat(); + +getConfig() +.then(cfg => { + layerManager.setup(cfg.layers); + config.set(cfg); + wsChannel.connect(); + m.route(document.getElementById("app"), "/map/0/12/0/0", routes); +}) +.catch(e => { + document.getElementById("app").innerHTML = e; +}); diff --git a/public/js/map/CoordinatesDisplay.js b/public/old/js/map/CoordinatesDisplay.js similarity index 100% rename from public/js/map/CoordinatesDisplay.js rename to public/old/js/map/CoordinatesDisplay.js diff --git a/public/js/map/CustomOverlay.js b/public/old/js/map/CustomOverlay.js similarity index 100% rename from public/js/map/CustomOverlay.js rename to public/old/js/map/CustomOverlay.js diff --git a/public/js/map/MapFactory.js b/public/old/js/map/MapFactory.js similarity index 100% rename from public/js/map/MapFactory.js rename to public/old/js/map/MapFactory.js diff --git a/public/js/map/Overlaysetup.js b/public/old/js/map/Overlaysetup.js similarity index 100% rename from public/js/map/Overlaysetup.js rename to public/old/js/map/Overlaysetup.js diff --git a/public/js/map/RealtimeTileLayer.js b/public/old/js/map/RealtimeTileLayer.js similarity index 100% rename from public/js/map/RealtimeTileLayer.js rename to public/old/js/map/RealtimeTileLayer.js diff --git a/public/js/map/SimpleCRS.js b/public/old/js/map/SimpleCRS.js similarity index 100% rename from public/js/map/SimpleCRS.js rename to public/old/js/map/SimpleCRS.js diff --git a/public/js/map/TopRightControl.js b/public/old/js/map/TopRightControl.js similarity index 100% rename from public/js/map/TopRightControl.js rename to public/old/js/map/TopRightControl.js diff --git a/public/js/map/WorldInfoDisplay.js b/public/old/js/map/WorldInfoDisplay.js similarity index 100% rename from public/js/map/WorldInfoDisplay.js rename to public/old/js/map/WorldInfoDisplay.js diff --git a/public/js/map/overlays/ATMOverlay.js b/public/old/js/map/overlays/ATMOverlay.js similarity index 100% rename from public/js/map/overlays/ATMOverlay.js rename to public/old/js/map/overlays/ATMOverlay.js diff --git a/public/js/map/overlays/AbstractGeoJsonOverlay.js b/public/old/js/map/overlays/AbstractGeoJsonOverlay.js similarity index 100% rename from public/js/map/overlays/AbstractGeoJsonOverlay.js rename to public/old/js/map/overlays/AbstractGeoJsonOverlay.js diff --git a/public/js/map/overlays/AbstractIconOverlay.js b/public/old/js/map/overlays/AbstractIconOverlay.js similarity index 100% rename from public/js/map/overlays/AbstractIconOverlay.js rename to public/old/js/map/overlays/AbstractIconOverlay.js diff --git a/public/js/map/overlays/BonesOverlay.js b/public/old/js/map/overlays/BonesOverlay.js similarity index 100% rename from public/js/map/overlays/BonesOverlay.js rename to public/old/js/map/overlays/BonesOverlay.js diff --git a/public/js/map/overlays/BorderOverlay.js b/public/old/js/map/overlays/BorderOverlay.js similarity index 100% rename from public/js/map/overlays/BorderOverlay.js rename to public/old/js/map/overlays/BorderOverlay.js diff --git a/public/js/map/overlays/DigitermOverlay.js b/public/old/js/map/overlays/DigitermOverlay.js similarity index 100% rename from public/js/map/overlays/DigitermOverlay.js rename to public/old/js/map/overlays/DigitermOverlay.js diff --git a/public/js/map/overlays/LabelOverlay.js b/public/old/js/map/overlays/LabelOverlay.js similarity index 100% rename from public/js/map/overlays/LabelOverlay.js rename to public/old/js/map/overlays/LabelOverlay.js diff --git a/public/js/map/overlays/LcdOverlay.js b/public/old/js/map/overlays/LcdOverlay.js similarity index 100% rename from public/js/map/overlays/LcdOverlay.js rename to public/old/js/map/overlays/LcdOverlay.js diff --git a/public/js/map/overlays/LocatorOverlay.js b/public/old/js/map/overlays/LocatorOverlay.js similarity index 100% rename from public/js/map/overlays/LocatorOverlay.js rename to public/old/js/map/overlays/LocatorOverlay.js diff --git a/public/js/map/overlays/LuacontrollerOverlay.js b/public/old/js/map/overlays/LuacontrollerOverlay.js similarity index 100% rename from public/js/map/overlays/LuacontrollerOverlay.js rename to public/old/js/map/overlays/LuacontrollerOverlay.js diff --git a/public/js/map/overlays/MinecartOverlay.js b/public/old/js/map/overlays/MinecartOverlay.js similarity index 100% rename from public/js/map/overlays/MinecartOverlay.js rename to public/old/js/map/overlays/MinecartOverlay.js diff --git a/public/js/map/overlays/MissionOverlay.js b/public/old/js/map/overlays/MissionOverlay.js similarity index 100% rename from public/js/map/overlays/MissionOverlay.js rename to public/old/js/map/overlays/MissionOverlay.js diff --git a/public/js/map/overlays/PlayerOverlay.js b/public/old/js/map/overlays/PlayerOverlay.js similarity index 100% rename from public/js/map/overlays/PlayerOverlay.js rename to public/old/js/map/overlays/PlayerOverlay.js diff --git a/public/js/map/overlays/PoiOverlay.js b/public/old/js/map/overlays/PoiOverlay.js similarity index 100% rename from public/js/map/overlays/PoiOverlay.js rename to public/old/js/map/overlays/PoiOverlay.js diff --git a/public/js/map/overlays/PrivProtectorOverlay.js b/public/old/js/map/overlays/PrivProtectorOverlay.js similarity index 100% rename from public/js/map/overlays/PrivProtectorOverlay.js rename to public/old/js/map/overlays/PrivProtectorOverlay.js diff --git a/public/js/map/overlays/ProtectorOverlay.js b/public/old/js/map/overlays/ProtectorOverlay.js similarity index 100% rename from public/js/map/overlays/ProtectorOverlay.js rename to public/old/js/map/overlays/ProtectorOverlay.js diff --git a/public/js/map/overlays/ShopOverlay.js b/public/old/js/map/overlays/ShopOverlay.js similarity index 100% rename from public/js/map/overlays/ShopOverlay.js rename to public/old/js/map/overlays/ShopOverlay.js diff --git a/public/js/map/overlays/SignOverlay.js b/public/old/js/map/overlays/SignOverlay.js similarity index 100% rename from public/js/map/overlays/SignOverlay.js rename to public/old/js/map/overlays/SignOverlay.js diff --git a/public/js/map/overlays/TechnicAnchorOverlay.js b/public/old/js/map/overlays/TechnicAnchorOverlay.js similarity index 100% rename from public/js/map/overlays/TechnicAnchorOverlay.js rename to public/old/js/map/overlays/TechnicAnchorOverlay.js diff --git a/public/js/map/overlays/TechnicQuarryOverlay.js b/public/old/js/map/overlays/TechnicQuarryOverlay.js similarity index 100% rename from public/js/map/overlays/TechnicQuarryOverlay.js rename to public/old/js/map/overlays/TechnicQuarryOverlay.js diff --git a/public/js/map/overlays/TechnicSwitchOverlay.js b/public/old/js/map/overlays/TechnicSwitchOverlay.js similarity index 100% rename from public/js/map/overlays/TechnicSwitchOverlay.js rename to public/old/js/map/overlays/TechnicSwitchOverlay.js diff --git a/public/js/map/overlays/TrainOverlay.js b/public/old/js/map/overlays/TrainOverlay.js similarity index 100% rename from public/js/map/overlays/TrainOverlay.js rename to public/old/js/map/overlays/TrainOverlay.js diff --git a/public/js/map/overlays/TrainlineOverlay.js b/public/old/js/map/overlays/TrainlineOverlay.js similarity index 100% rename from public/js/map/overlays/TrainlineOverlay.js rename to public/old/js/map/overlays/TrainlineOverlay.js diff --git a/public/js/map/overlays/TrainsignalOverlay.js b/public/old/js/map/overlays/TrainsignalOverlay.js similarity index 100% rename from public/js/map/overlays/TrainsignalOverlay.js rename to public/old/js/map/overlays/TrainsignalOverlay.js diff --git a/public/js/map/overlays/TravelnetOverlay.js b/public/old/js/map/overlays/TravelnetOverlay.js similarity index 100% rename from public/js/map/overlays/TravelnetOverlay.js rename to public/old/js/map/overlays/TravelnetOverlay.js diff --git a/public/js/map/overlays/XPProtectorOverlay.js b/public/old/js/map/overlays/XPProtectorOverlay.js similarity index 100% rename from public/js/map/overlays/XPProtectorOverlay.js rename to public/old/js/map/overlays/XPProtectorOverlay.js diff --git a/public/old/js/rollup.config.js b/public/old/js/rollup.config.js new file mode 100644 index 00000000..d1a98d16 --- /dev/null +++ b/public/old/js/rollup.config.js @@ -0,0 +1,10 @@ + +export default { + input: 'main.js', + output: { + file :'bundle.js', + format: 'iife', + sourcemap: true, + compact: true + } +}; diff --git a/public/old/js/routes.js b/public/old/js/routes.js new file mode 100644 index 00000000..d12e8dff --- /dev/null +++ b/public/old/js/routes.js @@ -0,0 +1,8 @@ + +import Map from './components/Map.js'; +import Search from './components/Search.js'; + +export default { + "/map/:layerId/:zoom/:lon/:lat": Map, + "/search/:query": Search +}; diff --git a/public/js/util/debounce.js b/public/old/js/util/debounce.js similarity index 100% rename from public/js/util/debounce.js rename to public/old/js/util/debounce.js diff --git a/public/webfonts/fa-brands-400.eot b/public/old/webfonts/fa-brands-400.eot similarity index 100% rename from public/webfonts/fa-brands-400.eot rename to public/old/webfonts/fa-brands-400.eot diff --git a/public/webfonts/fa-brands-400.svg b/public/old/webfonts/fa-brands-400.svg similarity index 100% rename from public/webfonts/fa-brands-400.svg rename to public/old/webfonts/fa-brands-400.svg diff --git a/public/webfonts/fa-brands-400.ttf b/public/old/webfonts/fa-brands-400.ttf similarity index 100% rename from public/webfonts/fa-brands-400.ttf rename to public/old/webfonts/fa-brands-400.ttf diff --git a/public/webfonts/fa-brands-400.woff b/public/old/webfonts/fa-brands-400.woff similarity index 100% rename from public/webfonts/fa-brands-400.woff rename to public/old/webfonts/fa-brands-400.woff diff --git a/public/webfonts/fa-brands-400.woff2 b/public/old/webfonts/fa-brands-400.woff2 similarity index 100% rename from public/webfonts/fa-brands-400.woff2 rename to public/old/webfonts/fa-brands-400.woff2 diff --git a/public/webfonts/fa-regular-400.eot b/public/old/webfonts/fa-regular-400.eot similarity index 100% rename from public/webfonts/fa-regular-400.eot rename to public/old/webfonts/fa-regular-400.eot diff --git a/public/webfonts/fa-regular-400.svg b/public/old/webfonts/fa-regular-400.svg similarity index 100% rename from public/webfonts/fa-regular-400.svg rename to public/old/webfonts/fa-regular-400.svg diff --git a/public/webfonts/fa-regular-400.ttf b/public/old/webfonts/fa-regular-400.ttf similarity index 100% rename from public/webfonts/fa-regular-400.ttf rename to public/old/webfonts/fa-regular-400.ttf diff --git a/public/webfonts/fa-regular-400.woff b/public/old/webfonts/fa-regular-400.woff similarity index 100% rename from public/webfonts/fa-regular-400.woff rename to public/old/webfonts/fa-regular-400.woff diff --git a/public/webfonts/fa-regular-400.woff2 b/public/old/webfonts/fa-regular-400.woff2 similarity index 100% rename from public/webfonts/fa-regular-400.woff2 rename to public/old/webfonts/fa-regular-400.woff2 diff --git a/public/webfonts/fa-solid-900.eot b/public/old/webfonts/fa-solid-900.eot similarity index 100% rename from public/webfonts/fa-solid-900.eot rename to public/old/webfonts/fa-solid-900.eot diff --git a/public/webfonts/fa-solid-900.svg b/public/old/webfonts/fa-solid-900.svg similarity index 100% rename from public/webfonts/fa-solid-900.svg rename to public/old/webfonts/fa-solid-900.svg diff --git a/public/webfonts/fa-solid-900.ttf b/public/old/webfonts/fa-solid-900.ttf similarity index 100% rename from public/webfonts/fa-solid-900.ttf rename to public/old/webfonts/fa-solid-900.ttf diff --git a/public/webfonts/fa-solid-900.woff b/public/old/webfonts/fa-solid-900.woff similarity index 100% rename from public/webfonts/fa-solid-900.woff rename to public/old/webfonts/fa-solid-900.woff diff --git a/public/webfonts/fa-solid-900.woff2 b/public/old/webfonts/fa-solid-900.woff2 similarity index 100% rename from public/webfonts/fa-solid-900.woff2 rename to public/old/webfonts/fa-solid-900.woff2 diff --git a/public/package-lock.json b/public/package-lock.json index c8b4670f..cd8c1788 100644 --- a/public/package-lock.json +++ b/public/package-lock.json @@ -9,54 +9,150 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@fortawesome/fontawesome-free": "^6.0.0", - "bootstrap": "^5.0.1", - "vue": "^2.6.14", - "vue-i18n": "^8.24.5", - "vue-router": "^3.5.2" + "@fortawesome/fontawesome-free": "^6.1.0", + "leaflet": "^1.7.1", + "leaflet.awesome-markers": "^2.0.5", + "vue": "^3.2.30", + "vue-router": "^4.0.14" }, "devDependencies": { "jshint": "2.13.4", "rollup": "2.70.1" } }, + "node_modules/@babel/parser": { + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.8.tgz", + "integrity": "sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ==", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@fortawesome/fontawesome-free": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.0.0.tgz", - "integrity": "sha512-6LB4PYBST1Rx40klypw1SmSDArjFOcfBf2LeX9Zg5EKJT2eXiyiJq+CyBYKeXyK0sXS2FsCJWSPr/luyhuvh0Q==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.1.0.tgz", + "integrity": "sha512-OgM74M6+Q7BuKAj8r+VfzwjnIGZrY62R4ipbiDvBW4FA0mLnB3yeuV/2bW63j+zppGyTvBp/3jqXp9ZXy43nFw==", "hasInstallScript": true, "engines": { "node": ">=6" } }, - "node_modules/@popperjs/core": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.9.2.tgz", - "integrity": "sha512-VZMYa7+fXHdwIq1TDhSXoVmSPEGM/aa+6Aiq3nVVJ9bXr24zScr+NlKFKC3iPljA7ho/GAZr+d2jOf5GIRC30Q==", - "peer": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/popperjs" + "node_modules/@vue/compiler-core": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.31.tgz", + "integrity": "sha512-aKno00qoA4o+V/kR6i/pE+aP+esng5siNAVQ422TkBNM6qA4veXiZbSe8OTXHXquEi/f6Akc+nLfB4JGfe4/WQ==", + "dependencies": { + "@babel/parser": "^7.16.4", + "@vue/shared": "3.2.31", + "estree-walker": "^2.0.2", + "source-map": "^0.6.1" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.31.tgz", + "integrity": "sha512-60zIlFfzIDf3u91cqfqy9KhCKIJgPeqxgveH2L+87RcGU/alT6BRrk5JtUso0OibH3O7NXuNOQ0cDc9beT0wrg==", + "dependencies": { + "@vue/compiler-core": "3.2.31", + "@vue/shared": "3.2.31" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.31.tgz", + "integrity": "sha512-748adc9msSPGzXgibHiO6T7RWgfnDcVQD+VVwYgSsyyY8Ans64tALHZANrKtOzvkwznV/F4H7OAod/jIlp/dkQ==", + "dependencies": { + "@babel/parser": "^7.16.4", + "@vue/compiler-core": "3.2.31", + "@vue/compiler-dom": "3.2.31", + "@vue/compiler-ssr": "3.2.31", + "@vue/reactivity-transform": "3.2.31", + "@vue/shared": "3.2.31", + "estree-walker": "^2.0.2", + "magic-string": "^0.25.7", + "postcss": "^8.1.10", + "source-map": "^0.6.1" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.31.tgz", + "integrity": "sha512-mjN0rqig+A8TVDnsGPYJM5dpbjlXeHUm2oZHZwGyMYiGT/F4fhJf/cXy8QpjnLQK4Y9Et4GWzHn9PS8AHUnSkw==", + "dependencies": { + "@vue/compiler-dom": "3.2.31", + "@vue/shared": "3.2.31" + } + }, + "node_modules/@vue/devtools-api": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.1.3.tgz", + "integrity": "sha512-79InfO2xHv+WHIrH1bHXQUiQD/wMls9qBk6WVwGCbdwP7/3zINtvqPNMtmSHXsIKjvUAHc8L0ouOj6ZQQRmcXg==" + }, + "node_modules/@vue/reactivity": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.31.tgz", + "integrity": "sha512-HVr0l211gbhpEKYr2hYe7hRsV91uIVGFYNHj73njbARVGHQvIojkImKMaZNDdoDZOIkMsBc9a1sMqR+WZwfSCw==", + "dependencies": { + "@vue/shared": "3.2.31" + } + }, + "node_modules/@vue/reactivity-transform": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.2.31.tgz", + "integrity": "sha512-uS4l4z/W7wXdI+Va5pgVxBJ345wyGFKvpPYtdSgvfJfX/x2Ymm6ophQlXXB6acqGHtXuBqNyyO3zVp9b1r0MOA==", + "dependencies": { + "@babel/parser": "^7.16.4", + "@vue/compiler-core": "3.2.31", + "@vue/shared": "3.2.31", + "estree-walker": "^2.0.2", + "magic-string": "^0.25.7" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.31.tgz", + "integrity": "sha512-Kcog5XmSY7VHFEMuk4+Gap8gUssYMZ2+w+cmGI6OpZWYOEIcbE0TPzzPHi+8XTzAgx1w/ZxDFcXhZeXN5eKWsA==", + "dependencies": { + "@vue/reactivity": "3.2.31", + "@vue/shared": "3.2.31" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.31.tgz", + "integrity": "sha512-N+o0sICVLScUjfLG7u9u5XCjvmsexAiPt17GNnaWHJUfsKed5e85/A3SWgKxzlxx2SW/Hw7RQxzxbXez9PtY3g==", + "dependencies": { + "@vue/runtime-core": "3.2.31", + "@vue/shared": "3.2.31", + "csstype": "^2.6.8" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.2.31.tgz", + "integrity": "sha512-8CN3Zj2HyR2LQQBHZ61HexF5NReqngLT3oahyiVRfSSvak+oAvVmu8iNLSu6XR77Ili2AOpnAt1y8ywjjqtmkg==", + "dependencies": { + "@vue/compiler-ssr": "3.2.31", + "@vue/shared": "3.2.31" + }, + "peerDependencies": { + "vue": "3.2.31" } }, + "node_modules/@vue/shared": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.31.tgz", + "integrity": "sha512-ymN2pj6zEjiKJZbrf98UM2pfDd6F2H7ksKw7NDt/ZZ1fh5Ei39X5tABugtT03ZRlWd9imccoK0hE8hpjpU7irQ==" + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "node_modules/bootstrap": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.0.1.tgz", - "integrity": "sha512-Fl79+wsLOZKoiU345KeEaWD0ik8WKRI5zm0YSPj2oF1Qr+BO7z0fco6GbUtqjoG1h4VI89PeKJnMsMMVQdKKTw==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/bootstrap" - }, - "peerDependencies": { - "@popperjs/core": "^2.9.2" - } - }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -101,6 +197,11 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, + "node_modules/csstype": { + "version": "2.6.20", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.20.tgz", + "integrity": "sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA==" + }, "node_modules/date-now": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", @@ -169,6 +270,11 @@ "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", "dev": true }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + }, "node_modules/exit": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", @@ -271,12 +377,30 @@ "jshint": "bin/jshint" } }, + "node_modules/leaflet": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.7.1.tgz", + "integrity": "sha512-/xwPEBidtg69Q3HlqPdU3DnrXQOvQU/CCHA1tcDQVzOwm91YMYaILjNp7L4Eaw5Z4sOYdbBz6koWyibppd8Zqw==" + }, + "node_modules/leaflet.awesome-markers": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/leaflet.awesome-markers/-/leaflet.awesome-markers-2.0.5.tgz", + "integrity": "sha512-Ne/xDjkGyaujwNVVkv2tyXQUV0ZW7gZ0Mo0FuQY4jp2qWrvXi0hwDBvmZyF/8YOvybyMabTMM/mFWCTd1jZIQA==" + }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, + "node_modules/magic-string": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", + "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "dependencies": { + "sourcemap-codec": "^1.4.8" + } + }, "node_modules/minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -289,6 +413,17 @@ "node": "*" } }, + "node_modules/nanoid": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", + "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -307,6 +442,34 @@ "node": ">=0.10.0" } }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "node_modules/postcss": { + "version": "8.4.12", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.12.tgz", + "integrity": "sha512-lg6eITwYe9v6Hr5CncVbK70SoioNQIq81nsaG86ev5hAidQvmOeETBqs7jm43K2F5/Ley3ytDtriImV6TpNiSg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + } + ], + "dependencies": { + "nanoid": "^3.3.1", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, "node_modules/readable-stream": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", @@ -334,6 +497,27 @@ "fsevents": "~2.3.2" } }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" + }, "node_modules/string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", @@ -353,19 +537,30 @@ } }, "node_modules/vue": { - "version": "2.6.14", - "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.14.tgz", - "integrity": "sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ==" - }, - "node_modules/vue-i18n": { - "version": "8.24.5", - "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.24.5.tgz", - "integrity": "sha512-p8W5xOmniuZ8fj76VXe0vBL3bRWVU87jHuC/v8VwmhKVH2iMQsKnheB1U+umxDBqC/5g9K+NwzokepcLxnBAVQ==" + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.31.tgz", + "integrity": "sha512-odT3W2tcffTiQCy57nOT93INw1auq5lYLLYtWpPYQQYQOOdHiqFct9Xhna6GJ+pJQaF67yZABraH47oywkJgFw==", + "dependencies": { + "@vue/compiler-dom": "3.2.31", + "@vue/compiler-sfc": "3.2.31", + "@vue/runtime-dom": "3.2.31", + "@vue/server-renderer": "3.2.31", + "@vue/shared": "3.2.31" + } }, "node_modules/vue-router": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.2.tgz", - "integrity": "sha512-807gn82hTnjCYGrnF3eNmIw/dk7/GE4B5h69BlyCK9KHASwSloD1Sjcn06zg9fVG4fYH2DrsNBZkpLtb25WtaQ==" + "version": "4.0.14", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.0.14.tgz", + "integrity": "sha512-wAO6zF9zxA3u+7AkMPqw9LjoUCjSxfFvINQj3E/DceTt6uEz1XZLraDhdg2EYmvVwTBSGlLYsUw8bDmx0754Mw==", + "dependencies": { + "@vue/devtools-api": "^6.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "vue": "^3.2.0" + } }, "node_modules/wrappy": { "version": "1.0.2", @@ -375,16 +570,119 @@ } }, "dependencies": { + "@babel/parser": { + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.8.tgz", + "integrity": "sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ==" + }, "@fortawesome/fontawesome-free": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.0.0.tgz", - "integrity": "sha512-6LB4PYBST1Rx40klypw1SmSDArjFOcfBf2LeX9Zg5EKJT2eXiyiJq+CyBYKeXyK0sXS2FsCJWSPr/luyhuvh0Q==" + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.1.0.tgz", + "integrity": "sha512-OgM74M6+Q7BuKAj8r+VfzwjnIGZrY62R4ipbiDvBW4FA0mLnB3yeuV/2bW63j+zppGyTvBp/3jqXp9ZXy43nFw==" + }, + "@vue/compiler-core": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.31.tgz", + "integrity": "sha512-aKno00qoA4o+V/kR6i/pE+aP+esng5siNAVQ422TkBNM6qA4veXiZbSe8OTXHXquEi/f6Akc+nLfB4JGfe4/WQ==", + "requires": { + "@babel/parser": "^7.16.4", + "@vue/shared": "3.2.31", + "estree-walker": "^2.0.2", + "source-map": "^0.6.1" + } + }, + "@vue/compiler-dom": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.31.tgz", + "integrity": "sha512-60zIlFfzIDf3u91cqfqy9KhCKIJgPeqxgveH2L+87RcGU/alT6BRrk5JtUso0OibH3O7NXuNOQ0cDc9beT0wrg==", + "requires": { + "@vue/compiler-core": "3.2.31", + "@vue/shared": "3.2.31" + } }, - "@popperjs/core": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.9.2.tgz", - "integrity": "sha512-VZMYa7+fXHdwIq1TDhSXoVmSPEGM/aa+6Aiq3nVVJ9bXr24zScr+NlKFKC3iPljA7ho/GAZr+d2jOf5GIRC30Q==", - "peer": true + "@vue/compiler-sfc": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.31.tgz", + "integrity": "sha512-748adc9msSPGzXgibHiO6T7RWgfnDcVQD+VVwYgSsyyY8Ans64tALHZANrKtOzvkwznV/F4H7OAod/jIlp/dkQ==", + "requires": { + "@babel/parser": "^7.16.4", + "@vue/compiler-core": "3.2.31", + "@vue/compiler-dom": "3.2.31", + "@vue/compiler-ssr": "3.2.31", + "@vue/reactivity-transform": "3.2.31", + "@vue/shared": "3.2.31", + "estree-walker": "^2.0.2", + "magic-string": "^0.25.7", + "postcss": "^8.1.10", + "source-map": "^0.6.1" + } + }, + "@vue/compiler-ssr": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.31.tgz", + "integrity": "sha512-mjN0rqig+A8TVDnsGPYJM5dpbjlXeHUm2oZHZwGyMYiGT/F4fhJf/cXy8QpjnLQK4Y9Et4GWzHn9PS8AHUnSkw==", + "requires": { + "@vue/compiler-dom": "3.2.31", + "@vue/shared": "3.2.31" + } + }, + "@vue/devtools-api": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.1.3.tgz", + "integrity": "sha512-79InfO2xHv+WHIrH1bHXQUiQD/wMls9qBk6WVwGCbdwP7/3zINtvqPNMtmSHXsIKjvUAHc8L0ouOj6ZQQRmcXg==" + }, + "@vue/reactivity": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.31.tgz", + "integrity": "sha512-HVr0l211gbhpEKYr2hYe7hRsV91uIVGFYNHj73njbARVGHQvIojkImKMaZNDdoDZOIkMsBc9a1sMqR+WZwfSCw==", + "requires": { + "@vue/shared": "3.2.31" + } + }, + "@vue/reactivity-transform": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.2.31.tgz", + "integrity": "sha512-uS4l4z/W7wXdI+Va5pgVxBJ345wyGFKvpPYtdSgvfJfX/x2Ymm6ophQlXXB6acqGHtXuBqNyyO3zVp9b1r0MOA==", + "requires": { + "@babel/parser": "^7.16.4", + "@vue/compiler-core": "3.2.31", + "@vue/shared": "3.2.31", + "estree-walker": "^2.0.2", + "magic-string": "^0.25.7" + } + }, + "@vue/runtime-core": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.31.tgz", + "integrity": "sha512-Kcog5XmSY7VHFEMuk4+Gap8gUssYMZ2+w+cmGI6OpZWYOEIcbE0TPzzPHi+8XTzAgx1w/ZxDFcXhZeXN5eKWsA==", + "requires": { + "@vue/reactivity": "3.2.31", + "@vue/shared": "3.2.31" + } + }, + "@vue/runtime-dom": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.31.tgz", + "integrity": "sha512-N+o0sICVLScUjfLG7u9u5XCjvmsexAiPt17GNnaWHJUfsKed5e85/A3SWgKxzlxx2SW/Hw7RQxzxbXez9PtY3g==", + "requires": { + "@vue/runtime-core": "3.2.31", + "@vue/shared": "3.2.31", + "csstype": "^2.6.8" + } + }, + "@vue/server-renderer": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.2.31.tgz", + "integrity": "sha512-8CN3Zj2HyR2LQQBHZ61HexF5NReqngLT3oahyiVRfSSvak+oAvVmu8iNLSu6XR77Ili2AOpnAt1y8ywjjqtmkg==", + "requires": { + "@vue/compiler-ssr": "3.2.31", + "@vue/shared": "3.2.31" + } + }, + "@vue/shared": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.31.tgz", + "integrity": "sha512-ymN2pj6zEjiKJZbrf98UM2pfDd6F2H7ksKw7NDt/ZZ1fh5Ei39X5tABugtT03ZRlWd9imccoK0hE8hpjpU7irQ==" }, "balanced-match": { "version": "1.0.2", @@ -392,12 +690,6 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "bootstrap": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.0.1.tgz", - "integrity": "sha512-Fl79+wsLOZKoiU345KeEaWD0ik8WKRI5zm0YSPj2oF1Qr+BO7z0fco6GbUtqjoG1h4VI89PeKJnMsMMVQdKKTw==", - "requires": {} - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -439,6 +731,11 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, + "csstype": { + "version": "2.6.20", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.20.tgz", + "integrity": "sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA==" + }, "date-now": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", @@ -500,6 +797,11 @@ "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", "dev": true }, + "estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + }, "exit": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", @@ -583,12 +885,30 @@ "strip-json-comments": "1.0.x" } }, + "leaflet": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.7.1.tgz", + "integrity": "sha512-/xwPEBidtg69Q3HlqPdU3DnrXQOvQU/CCHA1tcDQVzOwm91YMYaILjNp7L4Eaw5Z4sOYdbBz6koWyibppd8Zqw==" + }, + "leaflet.awesome-markers": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/leaflet.awesome-markers/-/leaflet.awesome-markers-2.0.5.tgz", + "integrity": "sha512-Ne/xDjkGyaujwNVVkv2tyXQUV0ZW7gZ0Mo0FuQY4jp2qWrvXi0hwDBvmZyF/8YOvybyMabTMM/mFWCTd1jZIQA==" + }, "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, + "magic-string": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", + "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "requires": { + "sourcemap-codec": "^1.4.8" + } + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -598,6 +918,11 @@ "brace-expansion": "^1.1.7" } }, + "nanoid": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", + "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==" + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -613,6 +938,21 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "postcss": { + "version": "8.4.12", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.12.tgz", + "integrity": "sha512-lg6eITwYe9v6Hr5CncVbK70SoioNQIq81nsaG86ev5hAidQvmOeETBqs7jm43K2F5/Ley3ytDtriImV6TpNiSg==", + "requires": { + "nanoid": "^3.3.1", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + } + }, "readable-stream": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", @@ -634,6 +974,21 @@ "fsevents": "~2.3.2" } }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==" + }, + "sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" + }, "string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", @@ -647,19 +1002,24 @@ "dev": true }, "vue": { - "version": "2.6.14", - "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.14.tgz", - "integrity": "sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ==" - }, - "vue-i18n": { - "version": "8.24.5", - "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.24.5.tgz", - "integrity": "sha512-p8W5xOmniuZ8fj76VXe0vBL3bRWVU87jHuC/v8VwmhKVH2iMQsKnheB1U+umxDBqC/5g9K+NwzokepcLxnBAVQ==" + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.31.tgz", + "integrity": "sha512-odT3W2tcffTiQCy57nOT93INw1auq5lYLLYtWpPYQQYQOOdHiqFct9Xhna6GJ+pJQaF67yZABraH47oywkJgFw==", + "requires": { + "@vue/compiler-dom": "3.2.31", + "@vue/compiler-sfc": "3.2.31", + "@vue/runtime-dom": "3.2.31", + "@vue/server-renderer": "3.2.31", + "@vue/shared": "3.2.31" + } }, "vue-router": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.2.tgz", - "integrity": "sha512-807gn82hTnjCYGrnF3eNmIw/dk7/GE4B5h69BlyCK9KHASwSloD1Sjcn06zg9fVG4fYH2DrsNBZkpLtb25WtaQ==" + "version": "4.0.14", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.0.14.tgz", + "integrity": "sha512-wAO6zF9zxA3u+7AkMPqw9LjoUCjSxfFvINQj3E/DceTt6uEz1XZLraDhdg2EYmvVwTBSGlLYsUw8bDmx0754Mw==", + "requires": { + "@vue/devtools-api": "^6.0.0" + } }, "wrappy": { "version": "1.0.2", diff --git a/public/package.json b/public/package.json index a40f1c89..cd88a4e0 100644 --- a/public/package.json +++ b/public/package.json @@ -6,16 +6,16 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "jshint": "cd js && jshint .", - "bundle": "cd js && rollup -c rollup.config.js" + "bundle": "cd js && rollup -c rollup.config.js" }, "author": "", "license": "ISC", "dependencies": { - "@fortawesome/fontawesome-free": "^6.0.0", - "bootstrap": "^5.0.1", - "vue": "^2.6.14", - "vue-i18n": "^8.24.5", - "vue-router": "^3.5.2" + "@fortawesome/fontawesome-free": "^6.1.0", + "leaflet": "^1.7.1", + "leaflet.awesome-markers": "^2.0.5", + "vue": "^3.2.30", + "vue-router": "^4.0.14" }, "devDependencies": { "jshint": "2.13.4", From 92ecab7c4493b552bb53e5903a0b19ec6e8b8cde Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Sat, 19 Mar 2022 17:45:37 +0100 Subject: [PATCH 02/12] update go versions --- .github/workflows/build.yml | 2 +- .github/workflows/go-test.yml | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dfbe9bbd..7e371f8f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3.0.0 with: - go-version: 1.16 + go-version: 1.17 - name: Set up nodejs uses: actions/setup-node@v3 diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index 5494d2c6..bac83431 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -11,10 +11,12 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3.0.0 with: - go-version: '1.16' + go-version: '1.17' - name: test - run: go test ./... -coverprofile=profile.cov + run: | + cd public && npm ci && cd .. + go test ./... -coverprofile=profile.cov - uses: shogo82148/actions-goveralls@v1.6.0 with: From eaa8cb5fc049832cb67c6b32a631e1a986fd4868 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Sat, 19 Mar 2022 17:48:22 +0100 Subject: [PATCH 03/12] fix indents --- public/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/index.html b/public/index.html index 285746c4..cecb1bf4 100644 --- a/public/index.html +++ b/public/index.html @@ -5,9 +5,9 @@ - - - + + + @@ -21,8 +21,8 @@
Starting mapserver...
- - + + From 0fb4f8fed6743d5ee697e780bb5671b3a559fe0f Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Sun, 20 Mar 2022 10:19:15 +0100 Subject: [PATCH 04/12] full screen map page --- public/css/custom.css | 13 +++++++++++++ public/js/app.js | 8 +------- public/js/pages/Map.js | 8 ++++++++ public/js/routes.js | 8 +++++--- 4 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 public/js/pages/Map.js diff --git a/public/css/custom.css b/public/css/custom.css index e69de29b..0716df6d 100644 --- a/public/css/custom.css +++ b/public/css/custom.css @@ -0,0 +1,13 @@ +html { + height: 100%; + margin: 0; +} + +body { + height: 100%; + margin: 0; +} + +#app { + height: 100%; +} \ No newline at end of file diff --git a/public/js/app.js b/public/js/app.js index 9dfa6959..70a8f8a7 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1,11 +1,5 @@ export default { template: /*html*/` -
-
-
- TODO: content - -
-
+ ` }; diff --git a/public/js/pages/Map.js b/public/js/pages/Map.js new file mode 100644 index 00000000..c4bad541 --- /dev/null +++ b/public/js/pages/Map.js @@ -0,0 +1,8 @@ + +export default { + template: /*html*/` +
+ Map +
+ ` +}; \ No newline at end of file diff --git a/public/js/routes.js b/public/js/routes.js index f555b1ac..2da2ddbf 100644 --- a/public/js/routes.js +++ b/public/js/routes.js @@ -1,6 +1,8 @@ +import Map from "./pages/Map.js"; + export default [{ - path: "/", component: { - template: "
start
" - } + path: "/map/:layerId/:zoom/:lon/:lat", component: Map +},{ + path: "/", redirect: "/map/0/13/0/0" }]; From 8e29829e96eccd463a86b0da0832e851c891004a Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Sun, 20 Mar 2022 10:54:53 +0100 Subject: [PATCH 05/12] map element setup --- public/js/components/Map.js | 25 +++++++++++++++++++++++++ public/js/pages/Map.js | 8 -------- public/js/pages/MapPage.js | 15 +++++++++++++++ public/js/routes.js | 4 ++-- public/js/utils/SimpleCRS.js | 6 ++++++ 5 files changed, 48 insertions(+), 10 deletions(-) create mode 100644 public/js/components/Map.js delete mode 100644 public/js/pages/Map.js create mode 100644 public/js/pages/MapPage.js create mode 100644 public/js/utils/SimpleCRS.js diff --git a/public/js/components/Map.js b/public/js/components/Map.js new file mode 100644 index 00000000..c3e714fa --- /dev/null +++ b/public/js/components/Map.js @@ -0,0 +1,25 @@ +import SimpleCRS from "../utils/SimpleCRS.js"; + +export default { + props: ["lat", "lon", "zoom", "layerId"], + mounted: function() { + const map = L.map(this.$refs.target, { + minZoom: 2, + maxZoom: 12, + center: [this.lat, this.lon], + zoom: this.zoom, + crs: SimpleCRS, + maxBounds: L.latLngBounds( + L.latLng(-31000, -31000), + L.latLng(31000, 31000) + ) + }); + + console.log(map); + }, + template: /*html*/` +
+ Map {{lat}} / {{lon}} / {{zoom}} / {{layerId}} +
+ ` +}; \ No newline at end of file diff --git a/public/js/pages/Map.js b/public/js/pages/Map.js deleted file mode 100644 index c4bad541..00000000 --- a/public/js/pages/Map.js +++ /dev/null @@ -1,8 +0,0 @@ - -export default { - template: /*html*/` -
- Map -
- ` -}; \ No newline at end of file diff --git a/public/js/pages/MapPage.js b/public/js/pages/MapPage.js new file mode 100644 index 00000000..789b5ca7 --- /dev/null +++ b/public/js/pages/MapPage.js @@ -0,0 +1,15 @@ +import Map from "../components/Map.js"; + +export default { + components: { + "map-component": Map + }, + template: /*html*/` + + ` +}; \ No newline at end of file diff --git a/public/js/routes.js b/public/js/routes.js index 2da2ddbf..6c986787 100644 --- a/public/js/routes.js +++ b/public/js/routes.js @@ -1,8 +1,8 @@ -import Map from "./pages/Map.js"; +import MapPage from "./pages/MapPage.js"; export default [{ - path: "/map/:layerId/:zoom/:lon/:lat", component: Map + path: "/map/:layerId/:zoom/:lon/:lat", component: MapPage },{ path: "/", redirect: "/map/0/13/0/0" }]; diff --git a/public/js/utils/SimpleCRS.js b/public/js/utils/SimpleCRS.js new file mode 100644 index 00000000..152342ab --- /dev/null +++ b/public/js/utils/SimpleCRS.js @@ -0,0 +1,6 @@ + +export default L.Util.extend({}, L.CRS.Simple, { + scale: function (zoom) { + return Math.pow(2, zoom-9); + } +}); From c701170a070a7ef9fea93dd5d642e005aade7990 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Sun, 20 Mar 2022 19:35:57 +0100 Subject: [PATCH 06/12] realtime layer stub --- public/js/api/config.js | 2 + public/js/api/stats.js | 2 + public/js/components/Map.js | 20 ++++++-- public/js/main.js | 35 ++++++++++---- public/js/service/ws.js | 72 ++++++++++++++++++++++++++++ public/js/store/config.js | 2 + public/js/utils/RealtimeTileLayer.js | 50 +++++++++++++++++++ 7 files changed, 171 insertions(+), 12 deletions(-) create mode 100644 public/js/api/config.js create mode 100644 public/js/api/stats.js create mode 100644 public/js/service/ws.js create mode 100644 public/js/store/config.js create mode 100644 public/js/utils/RealtimeTileLayer.js diff --git a/public/js/api/config.js b/public/js/api/config.js new file mode 100644 index 00000000..6a9ef681 --- /dev/null +++ b/public/js/api/config.js @@ -0,0 +1,2 @@ + +export const get = () => fetch("api/config").then(r => r.json()); diff --git a/public/js/api/stats.js b/public/js/api/stats.js new file mode 100644 index 00000000..3d64c36e --- /dev/null +++ b/public/js/api/stats.js @@ -0,0 +1,2 @@ + +export const get = () => fetch("api/stats").then(r => r.json()); diff --git a/public/js/components/Map.js b/public/js/components/Map.js index c3e714fa..185cf0d6 100644 --- a/public/js/components/Map.js +++ b/public/js/components/Map.js @@ -1,8 +1,11 @@ import SimpleCRS from "../utils/SimpleCRS.js"; +import RealtimeTileLayer from '../utils/RealtimeTileLayer.js'; +import ws from '../service/ws.js'; export default { props: ["lat", "lon", "zoom", "layerId"], mounted: function() { + console.log("Map::mounted", this.lat, this.lon, this.zoom, this.layerId); const map = L.map(this.$refs.target, { minZoom: 2, maxZoom: 12, @@ -15,11 +18,22 @@ export default { ) }); + map.attributionControl.addAttribution('Minetest Mapserver'); + + var tileLayer = new RealtimeTileLayer(ws, this.layerId, map); + tileLayer.addTo(map); + console.log(map); }, + methods: { + updateMap: function() { + console.log("Map::updateMap", this.lat, this.lon, this.zoom, this.layerId); + } + }, + watch: { + "$route": "updateMap" + }, template: /*html*/` -
- Map {{lat}} / {{lon}} / {{zoom}} / {{layerId}} -
+
` }; \ No newline at end of file diff --git a/public/js/main.js b/public/js/main.js index 1151a827..75cddc9c 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -1,13 +1,30 @@ import App from './app.js'; import routes from './routes.js'; +import { get as getConfig } from './api/config.js'; +import configStore from './store/config.js'; +import ws from './service/ws.js'; -// create router instance -const router = VueRouter.createRouter({ - history: VueRouter.createWebHashHistory(), - routes: routes -}); +function start() { + // create router instance + const router = VueRouter.createRouter({ + history: VueRouter.createWebHashHistory(), + routes: routes + }); -// start vue -const app = Vue.createApp(App); -app.use(router); -app.mount("#app"); + // start vue + const app = Vue.createApp(App); + app.use(router); + app.mount("#app"); +} + +// fetch config from server first +getConfig().then(cfg => { + // copy config to store + Object.keys(cfg).forEach(k => configStore[k] = cfg[k]); + + // start websocket/polling + ws.connect(); + + // start app + start(); +}); \ No newline at end of file diff --git a/public/js/service/ws.js b/public/js/service/ws.js new file mode 100644 index 00000000..1804b17b --- /dev/null +++ b/public/js/service/ws.js @@ -0,0 +1,72 @@ + +import { get } from '../api/stats.js'; + +class WebSocketChannel { + constructor(){ + this.wsUrl = window.location.protocol.replace("http", "ws") + + "//" + window.location.host + + window.location.pathname.substring(0, window.location.pathname.lastIndexOf("/")) + + "/api/ws"; + + this.listenerMap = {/* type -> [listeners] */}; + } + + addListener(type, listener){ + var list = this.listenerMap[type]; + if (!list){ + list = []; + this.listenerMap[type] = list; + } + + list.push(listener); + } + + removeListener(type, listener){ + var list = this.listenerMap[type]; + if (!list){ + return; + } + + this.listenerMap[type] = list.filter(l => l != listener); + } + + connect(){ + var ws = new WebSocket(this.wsUrl); + var self = this; + + ws.onmessage = function(e){ + var event = JSON.parse(e.data); + //rendered-tile, mapobject-created, mapobjects-cleared + + var listeners = self.listenerMap[event.type]; + if (listeners){ + listeners.forEach(function(listener){ + listener(event.data); + }); + } + }; + + function fallbackPolling(){ + get().then(function(stats){ + if (!stats){ + // no stats (yet) + return; + } + + var listeners = self.listenerMap["minetest-info"]; + if (listeners){ + listeners.forEach(function(listener){ + listener(stats); + }); + } + }); + } + + ws.onerror = function(){ + //fallback to polling stats + setInterval(fallbackPolling, 2000); + }; + } +} + +export default new WebSocketChannel(); diff --git a/public/js/store/config.js b/public/js/store/config.js new file mode 100644 index 00000000..e9bf258d --- /dev/null +++ b/public/js/store/config.js @@ -0,0 +1,2 @@ + +export default Vue.reactive({}); \ No newline at end of file diff --git a/public/js/utils/RealtimeTileLayer.js b/public/js/utils/RealtimeTileLayer.js new file mode 100644 index 00000000..e5c99bd6 --- /dev/null +++ b/public/js/utils/RealtimeTileLayer.js @@ -0,0 +1,50 @@ + +export default L.TileLayer.extend({ + + initialize: function(wsChannel, layerId, map) { + L.TileLayer.prototype.initialize.call(this); + + var self = this; + this.layerId = layerId; + + wsChannel.addListener("rendered-tile", function(tc){ + if (tc.layerid != self.layerId){ + //ignore other layers + return; + } + + if (tc.zoom != map.getZoom()){ + //ignore other zoom levels + return; + } + + var id = self.getImageId(tc.x, tc.y, tc.zoom); + var el = document.getElementById(id); + + if (el){ + //Update src attribute if img found + el.src = self.getTileSource(tc.x, tc.y, tc.zoom, true); + } + }); + }, + + getTileSource: function(x,y,zoom,cacheBust){ + return "api/tile/" + this.layerId + "/" + x + "/" + y + "/" + zoom + (cacheBust ? "?_=" + Date.now() : ""); + }, + + getImageId: function(x, y, zoom){ + return "tile-" + this.layerId + "/" + x + "/" + y + "/" + zoom; + }, + + createTile: function(coords, done){ + var tile = document.createElement('img'); + tile.src = this.getTileSource(coords.x, coords.y, coords.z, true); + tile.id = this.getImageId(coords.x, coords.y, coords.z); + + // trigger callbacks + tile.onload = () => done(null, tile); + tile.onerror = e => done(e, tile); + + return tile; + } +}); From 3735dbd24235b2a9ca827ea90c98d254b5c494d0 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Sun, 20 Mar 2022 19:44:17 +0100 Subject: [PATCH 07/12] persistent hash route --- public/js/components/Map.js | 24 ++++++++++++++++++++++++ public/js/routes.js | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/public/js/components/Map.js b/public/js/components/Map.js index 185cf0d6..5d746a9d 100644 --- a/public/js/components/Map.js +++ b/public/js/components/Map.js @@ -18,8 +18,32 @@ export default { ) }); + + const updateLink = () => { + const center = map.getCenter(); + const lon = Math.floor(center.lng); + const lat = Math.floor(center.lat); + console.log("Map::updateLink", map.getZoom(), lon, lat); + // change hash route + this.$router.push({ + name: "map", + params: { + lat: lat, + lon: lon, + zoom: map.getZoom(), + layerId: this.layerId + } + }); + }; + + // listen for route change + map.on('zoomend', updateLink); + map.on('moveend', updateLink); + + // add attribution map.attributionControl.addAttribution('Minetest Mapserver'); + // TODO: all layers var tileLayer = new RealtimeTileLayer(ws, this.layerId, map); tileLayer.addTo(map); diff --git a/public/js/routes.js b/public/js/routes.js index 6c986787..e75dbfa5 100644 --- a/public/js/routes.js +++ b/public/js/routes.js @@ -2,7 +2,7 @@ import MapPage from "./pages/MapPage.js"; export default [{ - path: "/map/:layerId/:zoom/:lon/:lat", component: MapPage + path: "/map/:layerId/:zoom/:lon/:lat", name: "map", component: MapPage },{ path: "/", redirect: "/map/0/13/0/0" }]; From bb4da68ef581d1c4dad22b0cbf6defeefee0e0ab Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Mon, 21 Mar 2022 18:47:54 +0100 Subject: [PATCH 08/12] layer service --- public/js/components/Map.js | 8 ++++++-- public/js/service/layer.js | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 public/js/service/layer.js diff --git a/public/js/components/Map.js b/public/js/components/Map.js index 5d746a9d..f5411840 100644 --- a/public/js/components/Map.js +++ b/public/js/components/Map.js @@ -1,11 +1,14 @@ import SimpleCRS from "../utils/SimpleCRS.js"; import RealtimeTileLayer from '../utils/RealtimeTileLayer.js'; import ws from '../service/ws.js'; +import { getLayerById } from "../service/layer.js"; export default { props: ["lat", "lon", "zoom", "layerId"], mounted: function() { - console.log("Map::mounted", this.lat, this.lon, this.zoom, this.layerId); + const layer = getLayerById(this.layerId); + console.log("Map::mounted", this.lat, this.lon, this.zoom, this.layerId, layer); + const map = L.map(this.$refs.target, { minZoom: 2, maxZoom: 12, @@ -51,7 +54,8 @@ export default { }, methods: { updateMap: function() { - console.log("Map::updateMap", this.lat, this.lon, this.zoom, this.layerId); + const layer = getLayerById(this.layerId); + console.log("Map::updateMap", this.lat, this.lon, this.zoom, this.layerId, layer); } }, watch: { diff --git a/public/js/service/layer.js b/public/js/service/layer.js new file mode 100644 index 00000000..7e3e1e85 --- /dev/null +++ b/public/js/service/layer.js @@ -0,0 +1,4 @@ + +import store from '../store/config.js'; + +export const getLayerById = id => store.layers.find(l => l.id == id); \ No newline at end of file From dbd13415dfd916d6c5a2531cf7a3057b8382b4b8 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Mon, 21 Mar 2022 18:51:06 +0100 Subject: [PATCH 09/12] coord display --- public/js/components/Map.js | 4 ++++ public/js/utils/CoordinatesDisplay.js | 34 +++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 public/js/utils/CoordinatesDisplay.js diff --git a/public/js/components/Map.js b/public/js/components/Map.js index f5411840..0e9f8239 100644 --- a/public/js/components/Map.js +++ b/public/js/components/Map.js @@ -2,6 +2,7 @@ import SimpleCRS from "../utils/SimpleCRS.js"; import RealtimeTileLayer from '../utils/RealtimeTileLayer.js'; import ws from '../service/ws.js'; import { getLayerById } from "../service/layer.js"; +import CoordinatesDisplay from "../../old/js/map/CoordinatesDisplay.js"; export default { props: ["lat", "lon", "zoom", "layerId"], @@ -50,6 +51,9 @@ export default { var tileLayer = new RealtimeTileLayer(ws, this.layerId, map); tileLayer.addTo(map); + // various map tools + new CoordinatesDisplay({ position: 'bottomleft' }).addTo(map); + console.log(map); }, methods: { diff --git a/public/js/utils/CoordinatesDisplay.js b/public/js/utils/CoordinatesDisplay.js new file mode 100644 index 00000000..932f6751 --- /dev/null +++ b/public/js/utils/CoordinatesDisplay.js @@ -0,0 +1,34 @@ + +export default L.Control.extend({ + onAdd: function(map) { + var div = L.DomUtil.create('div', 'leaflet-bar leaflet-custom-display'); + var hoverCoord, clickCoord; + + function updateHover(ev){ + hoverCoord = ev.latlng; + update(); + } + + function updateClick(ev){ + clickCoord = ev.latlng; + update(); + } + + function update(){ + var html = ""; + if (hoverCoord) + html = html + "X=" + parseInt(hoverCoord.lng) + " Z=" + parseInt(hoverCoord.lat); + + if (clickCoord) + html = html + " (marked: X=" + parseInt(clickCoord.lng) + " Z=" + parseInt(clickCoord.lat) + ")"; + + div.innerHTML = html; + } + + map.on('mousemove', updateHover); + map.on('click', updateClick); + map.on('touch', updateClick); + + return div; + } +}); From 2abe4f567ba065ba2b69265ec353d77b13548cd1 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Mon, 21 Mar 2022 19:21:06 +0100 Subject: [PATCH 10/12] world stats --- public/js/components/Map.js | 2 ++ public/js/components/WorldStats.js | 47 +++++++++++++++++++++++++++++ public/js/utils/WorldInfoDisplay.js | 15 +++++++++ 3 files changed, 64 insertions(+) create mode 100644 public/js/components/WorldStats.js create mode 100644 public/js/utils/WorldInfoDisplay.js diff --git a/public/js/components/Map.js b/public/js/components/Map.js index 0e9f8239..c5212d26 100644 --- a/public/js/components/Map.js +++ b/public/js/components/Map.js @@ -3,6 +3,7 @@ import RealtimeTileLayer from '../utils/RealtimeTileLayer.js'; import ws from '../service/ws.js'; import { getLayerById } from "../service/layer.js"; import CoordinatesDisplay from "../../old/js/map/CoordinatesDisplay.js"; +import WorldInfoDisplay from "../utils/WorldInfoDisplay.js"; export default { props: ["lat", "lon", "zoom", "layerId"], @@ -53,6 +54,7 @@ export default { // various map tools new CoordinatesDisplay({ position: 'bottomleft' }).addTo(map); + new WorldInfoDisplay(ws, { position: 'bottomright' }).addTo(map); console.log(map); }, diff --git a/public/js/components/WorldStats.js b/public/js/components/WorldStats.js new file mode 100644 index 00000000..c38bbc02 --- /dev/null +++ b/public/js/components/WorldStats.js @@ -0,0 +1,47 @@ +import ws from '../service/ws.js'; + +export default { + data: function(){ + return { + info: null + }; + }, + methods: { + infoListener: function(info){ + this.info = info; + } + }, + computed: { + lagColor: function(){ + if (this.info.max_lag > 0.8) + return "orange"; + else if (this.info.max_lag > 1.2) + return "red"; + else + return "green"; + }, + time: function() { + const min = Math.floor((this.info.time % 1000) / 1000 * 60); + return Math.floor(this.info.time/1000) + ":" + (min >= 10 ? min : "0" + min); + } + }, + created: function() { + // bind infoListener to this + this.infoListener = this.infoListener.bind(this); + ws.addListener("minetest-info", this.infoListener); + }, + beforeUnmount: function() { + ws.removeListener("minetest-info", this.infoListener); + }, + template: /*html*/` +
+ + {{ info.players.length }} + + {{ parseInt(info.max_lag*1000) }} ms + {{ time }} + + +
+ ` +}; \ No newline at end of file diff --git a/public/js/utils/WorldInfoDisplay.js b/public/js/utils/WorldInfoDisplay.js new file mode 100644 index 00000000..58e60b29 --- /dev/null +++ b/public/js/utils/WorldInfoDisplay.js @@ -0,0 +1,15 @@ +import WorldStats from '../components/WorldStats.js'; + +export default L.Control.extend({ + initialize: function(wsChannel, opts) { + L.Control.prototype.initialize.call(this, opts); + this.wsChannel = wsChannel; + }, + + onAdd: function() { + var div = L.DomUtil.create('div', 'leaflet-bar leaflet-custom-display'); + const app = Vue.createApp(WorldStats); + app.mount(div); + return div; + } +}); From 6a62d1410257b5602f0e610ec9ebaedb84fa2474 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Wed, 23 Mar 2022 08:39:45 +0100 Subject: [PATCH 11/12] sqlite open mode adjustements --- db/sqlite/sqlite.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/db/sqlite/sqlite.go b/db/sqlite/sqlite.go index 604c4100..cf3ae400 100644 --- a/db/sqlite/sqlite.go +++ b/db/sqlite/sqlite.go @@ -24,7 +24,7 @@ type Sqlite3Accessor struct { func (db *Sqlite3Accessor) Migrate() error { //RW connection - rwdb, err := sql.Open("sqlite", db.filename+"?mode=rw") + rwdb, err := sql.Open("sqlite", "file:"+db.filename+"?mode=rw") if err != nil { return err } @@ -164,13 +164,11 @@ func (db *Sqlite3Accessor) GetBlock(pos *coords.MapBlockCoords) (*db.Block, erro } func New(filename string) (*Sqlite3Accessor, error) { - db, err := sql.Open("sqlite", filename+"?mode=ro") + db, err := sql.Open("sqlite", "file:"+filename+"?mode=ro") if err != nil { return nil, err } - // limit connection and set a busy-timeout to prevent errors if the db should be locked sometimes - db.SetMaxOpenConns(1) _, err = db.Exec("pragma busy_timeout = 5000;") if err != nil { return nil, err From 27d12c20bcf136bfbe54887697f583d2ea0ef86c Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Tue, 5 Jul 2022 09:54:40 +0200 Subject: [PATCH 12/12] wal mode --- db/sqlite/sqlite.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/db/sqlite/sqlite.go b/db/sqlite/sqlite.go index cf3ae400..2a353b3c 100644 --- a/db/sqlite/sqlite.go +++ b/db/sqlite/sqlite.go @@ -2,6 +2,7 @@ package sqlite import ( "database/sql" + "errors" "mapserver/coords" "mapserver/db" "mapserver/public" @@ -164,7 +165,7 @@ func (db *Sqlite3Accessor) GetBlock(pos *coords.MapBlockCoords) (*db.Block, erro } func New(filename string) (*Sqlite3Accessor, error) { - db, err := sql.Open("sqlite", "file:"+filename+"?mode=ro") + db, err := sql.Open("sqlite", "file:"+filename) if err != nil { return nil, err } @@ -174,6 +175,11 @@ func New(filename string) (*Sqlite3Accessor, error) { return nil, err } + _, err = db.Exec("pragma journal_mode = wal;") + if err != nil { + return nil, errors.New("could not set db to wal-mode, please stop the minetest-server to allow this one-time fixup") + } + sq := &Sqlite3Accessor{db: db, filename: filename} return sq, nil }