diff --git a/back/dist/app.js b/back/dist/app.js index 2e8b024..48bef31 100644 --- a/back/dist/app.js +++ b/back/dist/app.js @@ -1,4 +1,5 @@ import express from 'express'; +import bodyParser from 'body-parser'; import { createClient } from 'hafas-client'; import { profile as dbProfile } from 'hafas-client/p/db/index.js'; import { profile as vbbProfile } from 'hafas-client/p/vbb/index.js'; @@ -11,6 +12,10 @@ import { profile as bartProfile } from 'hafas-client/p/bart/index.js'; import { profile as dartProfile } from 'hafas-client/p/dart/index.js'; import { profile as nrwProfile } from 'hafas-client/p/mobil-nrw/index.js'; import { profile as danmarkProfile } from 'hafas-client/p/rejseplanen/index.js'; +import { profile as blsProfile } from 'hafas-client/p/bls/index.js'; +import { profile as nrwbusradarProfile } from 'hafas-client/p/db-busradar-nrw/index.js'; +import { profile as cmtaProfile } from 'hafas-client/p/cmta/index.js'; +import { profile as vrnProfile } from 'hafas-client/p/vrn/index.js'; const app = express(); const port = 3000; // Adapt this to your project! createClient() won't work with this string. @@ -29,12 +34,17 @@ clients.set("bart", createClient(bartProfile, userAgent)); clients.set("dart", createClient(dartProfile, userAgent)); clients.set("nrw", createClient(nrwProfile, userAgent)); clients.set("danmark", createClient(danmarkProfile, userAgent)); +clients.set("bls", createClient(blsProfile, userAgent)); +clients.set("nrwbus", createClient(nrwbusradarProfile, userAgent)); +clients.set("cmta", createClient(cmtaProfile, userAgent)); +clients.set("vrn", createClient(vrnProfile, userAgent)); app.use((req, res, next) => { res.append('Access-Control-Allow-Origin', ['*']); res.append('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); res.append('Access-Control-Allow-Headers', 'Content-Type'); next(); }); +app.use(bodyParser.json()); app.get('/', (req, res) => { client.journeys('8011167', '8000261', { results: 1 }).then(result => res.send(result)).catch(error => res.status(500).send(error)); }); @@ -44,7 +54,7 @@ app.get('/searchStation', (req, res) => { } else { let query = req.query; - clients.get((String)(req.query.service)).locations(query.text, { results: 1 }).then(result => res.send({ name: result[0].name, id: result[0].id })).catch(error => res.status(500).send(error)); + clients.get((String)(req.query.service)).locations(query.text, { results: 1, subStops: false, entrances: false, language: query.language }).then(result => res.send(result[0])).catch(error => res.status(500).send(error)); } }); app.get('/searchStations', (req, res) => { @@ -55,26 +65,23 @@ app.get('/searchStations', (req, res) => { else { let query = req.query; try { - clients.get((String)(req.query.service)).locations(query.text, { results: 6 }).then(result => res.send(result - //.map(entry => {return {name:entry.name, id:entry.id}}) - )).catch(error => res.status(500).send(error)); + clients.get((String)(req.query.service)).locations(query.text, { results: 6, subStops: false, entrances: false, language: query.language }).then(result => res.send(result)).catch(error => res.status(500).send(error)); } catch (e) { res.status(500).send(e); } } }); -app.get('/searchConnection', (req, res) => { - if (!req.query || !req.query.from || !req.query.to || !req.query.date || !req.query.service) { - console.log(req.query); +app.post('/searchConnection', (req, res) => { + if (!req.body.data || !req.body.data.from || !req.body.data.to || !req.body.data.date || !req.body.data.service) { res.send([]); } else { - let query = req.query; - let date = new Date((String)(req.query.date)); + let query = req.body.data; + let date = new Date((String)(query.date)); try { - clients.get((String)(req.query.service)). - journeys(query.from, query.to, { results: 5, departure: date }) + console.log(query.language); + clients.get((String)(query.service)).journeys(query.from, query.to, { results: 5, departure: date, language: query.language }) .then(result => { let journeys = result.journeys; res.send(journeys.map(journey => { @@ -87,13 +94,40 @@ app.get('/searchConnection', (req, res) => { }; })); }) - .catch(error => res.status(500).send(error)); + .catch(error => { + console.log(error); + res.status(500).send(error); + }); } catch (e) { res.status(500).send(e); } } }); +app.get('/findNearby', (req, res) => { + if (!req.query || !req.query.location) { + res.send([]); + } + else { + let query = req.query; + try { + clients.get((String)(req.query.service)).nearby({ type: "location", latitude: parseFloat(query.location.latitude), longitude: parseFloat(query.location.longitude) }, { subStops: false, entrances: false, language: query.language }).then(result => res.send(result)).catch(error => { + console.log(error); + res.status(500).send(error); + }); + } + catch (e) { + res.status(500).send(e); + } + } +}); +app.get('/nearbyTest', (req, res) => { + client.nearby({ + type: 'location', + latitude: 52.5137344, + longitude: 13.4744798 + }, undefined).then(result => res.send(result)).catch(error => res.status(500).send(error)); +}); app.listen(port, () => { return console.log(`Express is listening at http://localhost:${port}`); }); diff --git a/back/dist/app.js.map b/back/dist/app.js.map index 0d0fe44..2436b38 100644 --- a/back/dist/app.js.map +++ b/back/dist/app.js.map @@ -1 +1 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,YAAY,EAAc,MAAM,cAAc,CAAA;AACtD,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,oCAAoC,CAAA;AAC1E,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,uCAAuC,CAAA;AAC1E,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,mCAAmC,CAAA;AACvE,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,qCAAqC,CAAA;AAE7E,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;AACtB,MAAM,IAAI,GAAG,IAAI,CAAC;AAElB,0EAA0E;AAC1E,MAAM,SAAS,GAAG,sBAAsB,CAAA;AAExC,iDAAiD;AACjD,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,EAAE,SAAS,CAAC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,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,GAAG,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IAChC,MAAM,CAAC,MAAM,CAAC;QACV,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE,UAAU;QACpB,SAAS,EAAE,UAAU;KACxB,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/F,CAAC,CAAC,CAAC;AAEH,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;IACpB,OAAO,OAAO,CAAC,GAAG,CAAC,4CAA4C,IAAI,EAAE,CAAC,CAAC;AACzE,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/back/node_modules/.package-lock.json b/back/node_modules/.package-lock.json index e3115bc..013f44b 100644 --- a/back/node_modules/.package-lock.json +++ b/back/node_modules/.package-lock.json @@ -180,6 +180,7 @@ "version": "1.20.3", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "license": "MIT", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.5", diff --git a/back/package-lock.json b/back/package-lock.json index bacbc2a..5e58841 100644 --- a/back/package-lock.json +++ b/back/package-lock.json @@ -10,6 +10,7 @@ "license": "ISC", "dependencies": { "@types/hafas-client": "^6.2.0", + "body-parser": "^1.20.3", "express": "^4.21.1", "hafas-client": "^6.3.2" }, @@ -194,6 +195,7 @@ "version": "1.20.3", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "license": "MIT", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.5", diff --git a/back/package.json b/back/package.json index 4012d1f..6e14bb3 100644 --- a/back/package.json +++ b/back/package.json @@ -14,8 +14,9 @@ }, "dependencies": { "@types/hafas-client": "^6.2.0", + "body-parser": "^1.20.3", "express": "^4.21.1", "hafas-client": "^6.3.2" }, - "type":"module" + "type": "module" } diff --git a/back/src/app.ts b/back/src/app.ts index b8cd4f3..7b68fde 100644 --- a/back/src/app.ts +++ b/back/src/app.ts @@ -1,4 +1,5 @@ import express from 'express'; +import bodyParser from 'body-parser'; import {createClient, HafasClient} from 'hafas-client' import {profile as dbProfile} from 'hafas-client/p/db/index.js' import {profile as vbbProfile} from 'hafas-client/p/vbb/index.js' @@ -11,6 +12,10 @@ import {profile as bartProfile} from 'hafas-client/p/bart/index.js' import {profile as dartProfile} from 'hafas-client/p/dart/index.js' import {profile as nrwProfile} from 'hafas-client/p/mobil-nrw/index.js' import {profile as danmarkProfile} from 'hafas-client/p/rejseplanen/index.js' +import {profile as blsProfile} from 'hafas-client/p/bls/index.js' +import {profile as nrwbusradarProfile} from 'hafas-client/p/db-busradar-nrw/index.js' +import {profile as cmtaProfile} from 'hafas-client/p/cmta/index.js' +import {profile as vrnProfile} from 'hafas-client/p/vrn/index.js' import {Journey} from 'hafas-client' const app = express(); const port = 3000; @@ -32,6 +37,10 @@ clients.set("bart", createClient(bartProfile, userAgent)); clients.set("dart", createClient(dartProfile, userAgent)); clients.set("nrw", createClient(nrwProfile, userAgent)); clients.set("danmark", createClient(danmarkProfile, userAgent)); +clients.set("bls", createClient(blsProfile, userAgent)); +clients.set("nrwbus", createClient(nrwbusradarProfile, userAgent)); +clients.set("cmta", createClient(cmtaProfile, userAgent)); +clients.set("vrn", createClient(vrnProfile, userAgent)); app.use((req, res, next) => { res.append('Access-Control-Allow-Origin', ['*']); res.append('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); @@ -39,6 +48,8 @@ app.use((req, res, next) => { next(); }); +app.use(bodyParser.json()); + app.get('/', (req, res) => { client.journeys('8011167', '8000261', {results: 1}).then(result => res.send(result)).catch(error => res.status(500).send(error)); }); @@ -47,7 +58,7 @@ app.get('/searchStation', (req, res) => { res.send([]); } else { let query: any = req.query; - clients.get((String) (req.query.service)).locations(query.text, {results:1}).then(result => res.send({name: result[0].name, id:result[0].id})).catch(error => res.status(500).send(error)); + clients.get((String) (req.query.service)).locations(query.text, {results:1, subStops:false, entrances:false, language:query.language}).then(result => res.send(result[0])).catch(error => res.status(500).send(error)); } }); app.get('/searchStations', (req, res) => { @@ -57,24 +68,22 @@ app.get('/searchStations', (req, res) => { } else { let query: any = req.query; try { - clients.get((String) (req.query.service)).locations(query.text, {results:6}).then(result => res.send(result - //.map(entry => {return {name:entry.name, id:entry.id}}) + clients.get((String) (req.query.service)).locations(query.text, {results:6, subStops:false, entrances:false, language:query.language}).then(result => res.send(result )).catch(error => res.status(500).send(error)); } catch (e) { res.status(500).send(e) } } }); -app.get('/searchConnection', (req, res) => { - if(!req.query || !req.query.from || !req.query.to || !req.query.date || !req.query.service){ - console.log(req.query); +app.post('/searchConnection', (req, res) => { + if(!req.body.data || !req.body.data.from || !req.body.data.to || !req.body.data.date || !req.body.data.service){ res.send([]); } else { - let query: any = req.query; - let date: Date = new Date((String)(req.query.date)); + let query: any = req.body.data; + let date: Date = new Date((String)(query.date)); try { - clients.get((String) (req.query.service)). - journeys(query.from, query.to,{results:5, departure:date}) + console.log(query.language) + clients.get((String) (query.service)).journeys(query.from, query.to,{results:5, departure:date, language:query.language}) .then(result => { let journeys: readonly Journey[] = result.journeys; res.send(journeys.map(journey => { return { @@ -85,13 +94,40 @@ app.get('/searchConnection', (req, res) => { price: journey.price, }})) }) - .catch(error => res.status(500).send(error)); + .catch(error => { + console.log(error); + res.status(500).send(error)} + ); + } catch (e) { + res.status(500).send(e) + } + } +}); +app.get('/findNearby', (req, res) => { + if(!req.query || !req.query.location){ + res.send([]); + } else { + let query: any = req.query; + try { + clients.get((String) (req.query.service)).nearby({type:"location", latitude: parseFloat(query.location.latitude), longitude: parseFloat(query.location.longitude)}, {subStops:false, entrances:false, language:query.language}).then(result => res.send(result + )).catch(error => { + console.log(error); + res.status(500).send(error); + }); } catch (e) { res.status(500).send(e) } } }); +app.get('/nearbyTest', (req, res) => { + client.nearby({ + type: 'location', + latitude: 52.5137344, + longitude: 13.4744798 + }, undefined).then(result => res.send(result)).catch(error => res.status(500).send(error)); +}); + app.listen(port, () => { return console.log(`Express is listening at http://localhost:${port}`); }); diff --git a/front/bahnui-front/src/App.vue b/front/bahnui-front/src/App.vue index bdcca70..12e8fe2 100644 --- a/front/bahnui-front/src/App.vue +++ b/front/bahnui-front/src/App.vue @@ -8,6 +8,7 @@
Search + Explore
diff --git a/front/bahnui-front/src/assets/icons/bicycle-conveyance-reservation.svg b/front/bahnui-front/src/assets/icons/bicycle-conveyance-reservation.svg index 312d459..3d66895 100644 --- a/front/bahnui-front/src/assets/icons/bicycle-conveyance-reservation.svg +++ b/front/bahnui-front/src/assets/icons/bicycle-conveyance-reservation.svg @@ -8,7 +8,7 @@ version="1.1" id="svg1" sodipodi:docname="bicycle-conveyance-reservation.svg" - inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)" + inkscape:version="1.2.2 (732a01da63, 2022-12-09)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" @@ -25,12 +25,12 @@ inkscape:document-units="px" showgrid="true" inkscape:zoom="8.8977601" - inkscape:cx="25.174875" + inkscape:cx="13.936092" inkscape:cy="22.814731" - inkscape:window-width="1368" - inkscape:window-height="842" - inkscape:window-x="-6" - inkscape:window-y="1073" + inkscape:window-width="2560" + inkscape:window-height="1377" + inkscape:window-x="-8" + inkscape:window-y="-8" inkscape:window-maximized="1" inkscape:current-layer="layer1"> - R + + + diff --git a/front/bahnui-front/src/assets/icons/compulsory-reservation.svg b/front/bahnui-front/src/assets/icons/compulsory-reservation.svg index 59902df..2ca6da0 100644 --- a/front/bahnui-front/src/assets/icons/compulsory-reservation.svg +++ b/front/bahnui-front/src/assets/icons/compulsory-reservation.svg @@ -8,7 +8,7 @@ version="1.1" id="svg1" sodipodi:docname="compulsory-reservation.svg" - inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)" + inkscape:version="1.2.2 (732a01da63, 2022-12-09)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" @@ -25,14 +25,14 @@ inkscape:document-units="px" showgrid="true" inkscape:zoom="7.7006757" - inkscape:cx="24.803018" + inkscape:cx="11.817145" inkscape:cy="25.971747" - inkscape:window-width="1368" - inkscape:window-height="842" - inkscape:window-x="-6" - inkscape:window-y="1073" + inkscape:window-width="2560" + inkscape:window-height="1377" + inkscape:window-x="-8" + inkscape:window-y="-8" inkscape:window-maximized="1" - inkscape:current-layer="layer1"> + inkscape:current-layer="text51"> - R + + + diff --git a/front/bahnui-front/src/assets/icons/deutschlandticket-gueltig.svg b/front/bahnui-front/src/assets/icons/deutschlandticket-gueltig.svg new file mode 100644 index 0000000..c2e97cc --- /dev/null +++ b/front/bahnui-front/src/assets/icons/deutschlandticket-gueltig.svg @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/front/bahnui-front/src/assets/icons/deutschlandticket-ungueltig.svg b/front/bahnui-front/src/assets/icons/deutschlandticket-ungueltig.svg new file mode 100644 index 0000000..e5dc30f --- /dev/null +++ b/front/bahnui-front/src/assets/icons/deutschlandticket-ungueltig.svg @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/front/bahnui-front/src/assets/icons/info.svg b/front/bahnui-front/src/assets/icons/info.svg new file mode 100644 index 0000000..e1e7387 --- /dev/null +++ b/front/bahnui-front/src/assets/icons/info.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + diff --git a/front/bahnui-front/src/assets/icons/komfort-check-in.svg b/front/bahnui-front/src/assets/icons/komfort-check-in.svg new file mode 100644 index 0000000..739430e --- /dev/null +++ b/front/bahnui-front/src/assets/icons/komfort-check-in.svg @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + diff --git a/front/bahnui-front/src/assets/icons/quiet-zone.svg b/front/bahnui-front/src/assets/icons/quiet-zone.svg new file mode 100644 index 0000000..c11dbff --- /dev/null +++ b/front/bahnui-front/src/assets/icons/quiet-zone.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + diff --git a/front/bahnui-front/src/assets/icons/reservation-suggested.svg b/front/bahnui-front/src/assets/icons/reservation-suggested.svg new file mode 100644 index 0000000..39e2528 --- /dev/null +++ b/front/bahnui-front/src/assets/icons/reservation-suggested.svg @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + diff --git a/front/bahnui-front/src/assets/icons/sleeper-couchette.svg b/front/bahnui-front/src/assets/icons/sleeper-couchette.svg new file mode 100644 index 0000000..3109bd8 --- /dev/null +++ b/front/bahnui-front/src/assets/icons/sleeper-couchette.svg @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/front/bahnui-front/src/assets/icons/special-ticket.svg b/front/bahnui-front/src/assets/icons/special-ticket.svg new file mode 100644 index 0000000..dc1a638 --- /dev/null +++ b/front/bahnui-front/src/assets/icons/special-ticket.svg @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + diff --git a/front/bahnui-front/src/assets/icons/ticket-required.svg b/front/bahnui-front/src/assets/icons/ticket-required.svg new file mode 100644 index 0000000..3681ce8 --- /dev/null +++ b/front/bahnui-front/src/assets/icons/ticket-required.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + diff --git a/front/bahnui-front/src/assets/icons/tilting-train.svg b/front/bahnui-front/src/assets/icons/tilting-train.svg new file mode 100644 index 0000000..52b7f6a --- /dev/null +++ b/front/bahnui-front/src/assets/icons/tilting-train.svg @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/front/bahnui-front/src/assets/logos/actransit.png b/front/bahnui-front/src/assets/logos/actransit.png new file mode 100644 index 0000000..5b31956 Binary files /dev/null and b/front/bahnui-front/src/assets/logos/actransit.png differ diff --git a/front/bahnui-front/src/assets/logos/actransit.svg b/front/bahnui-front/src/assets/logos/actransit.svg new file mode 100644 index 0000000..aa9dcf7 --- /dev/null +++ b/front/bahnui-front/src/assets/logos/actransit.svg @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/front/bahnui-front/src/assets/logos/caltrain.svg b/front/bahnui-front/src/assets/logos/caltrain.svg new file mode 100644 index 0000000..ecf7e8a --- /dev/null +++ b/front/bahnui-front/src/assets/logos/caltrain.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/front/bahnui-front/src/assets/logos/desmoinesart.svg b/front/bahnui-front/src/assets/logos/desmoinesart.svg new file mode 100644 index 0000000..080c884 --- /dev/null +++ b/front/bahnui-front/src/assets/logos/desmoinesart.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/front/bahnui-front/src/assets/logos/evb.svg b/front/bahnui-front/src/assets/logos/evb.svg new file mode 100644 index 0000000..6fd28c2 --- /dev/null +++ b/front/bahnui-front/src/assets/logos/evb.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front/bahnui-front/src/assets/logos/flixtrain.svg b/front/bahnui-front/src/assets/logos/flixtrain.svg new file mode 100644 index 0000000..24c5fd3 --- /dev/null +++ b/front/bahnui-front/src/assets/logos/flixtrain.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front/bahnui-front/src/assets/logos/gkb.svg b/front/bahnui-front/src/assets/logos/gkb.svg new file mode 100644 index 0000000..7e90e76 --- /dev/null +++ b/front/bahnui-front/src/assets/logos/gkb.svg @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/front/bahnui-front/src/assets/logos/goldengate.png b/front/bahnui-front/src/assets/logos/goldengate.png new file mode 100644 index 0000000..8442a27 Binary files /dev/null and b/front/bahnui-front/src/assets/logos/goldengate.png differ diff --git a/front/bahnui-front/src/assets/logos/hlb.svg b/front/bahnui-front/src/assets/logos/hlb.svg new file mode 100644 index 0000000..7bb27ca --- /dev/null +++ b/front/bahnui-front/src/assets/logos/hlb.svg @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/front/bahnui-front/src/assets/logos/ieir.svg b/front/bahnui-front/src/assets/logos/ieir.svg new file mode 100644 index 0000000..dee0f5b --- /dev/null +++ b/front/bahnui-front/src/assets/logos/ieir.svg @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/front/bahnui-front/src/assets/logos/liemobil.svg b/front/bahnui-front/src/assets/logos/liemobil.svg new file mode 100644 index 0000000..91224a1 --- /dev/null +++ b/front/bahnui-front/src/assets/logos/liemobil.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front/bahnui-front/src/assets/logos/luxtram.png b/front/bahnui-front/src/assets/logos/luxtram.png new file mode 100644 index 0000000..e8fc484 Binary files /dev/null and b/front/bahnui-front/src/assets/logos/luxtram.png differ diff --git a/front/bahnui-front/src/assets/logos/marintransit.svg b/front/bahnui-front/src/assets/logos/marintransit.svg new file mode 100644 index 0000000..ca663b0 --- /dev/null +++ b/front/bahnui-front/src/assets/logos/marintransit.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/front/bahnui-front/src/assets/logos/metronom.svg b/front/bahnui-front/src/assets/logos/metronom.svg new file mode 100644 index 0000000..97f6b0d --- /dev/null +++ b/front/bahnui-front/src/assets/logos/metronom.svg @@ -0,0 +1,2 @@ + +image/svg+xml \ No newline at end of file diff --git a/front/bahnui-front/src/assets/logos/regiostart.svg b/front/bahnui-front/src/assets/logos/regiostart.svg new file mode 100644 index 0000000..b5d83aa --- /dev/null +++ b/front/bahnui-front/src/assets/logos/regiostart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front/bahnui-front/src/assets/logos/rheinruhrbahn.svg b/front/bahnui-front/src/assets/logos/rheinruhrbahn.svg new file mode 100644 index 0000000..0a352e5 --- /dev/null +++ b/front/bahnui-front/src/assets/logos/rheinruhrbahn.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/front/bahnui-front/src/assets/logos/samtrans.svg b/front/bahnui-front/src/assets/logos/samtrans.svg new file mode 100644 index 0000000..65649b7 --- /dev/null +++ b/front/bahnui-front/src/assets/logos/samtrans.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/front/bahnui-front/src/assets/logos/sternhafferl.svg b/front/bahnui-front/src/assets/logos/sternhafferl.svg new file mode 100644 index 0000000..24cd613 --- /dev/null +++ b/front/bahnui-front/src/assets/logos/sternhafferl.svg @@ -0,0 +1,3 @@ + + +image/svg+xml \ No newline at end of file diff --git a/front/bahnui-front/src/assets/logos/stog.svg b/front/bahnui-front/src/assets/logos/stog.svg new file mode 100644 index 0000000..7088668 --- /dev/null +++ b/front/bahnui-front/src/assets/logos/stog.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/front/bahnui-front/src/assets/logos/vbglattal.svg b/front/bahnui-front/src/assets/logos/vbglattal.svg new file mode 100644 index 0000000..067b71a --- /dev/null +++ b/front/bahnui-front/src/assets/logos/vbglattal.svg @@ -0,0 +1,3 @@ + + +image/svg+xml \ No newline at end of file diff --git a/front/bahnui-front/src/assets/logos/vias.png b/front/bahnui-front/src/assets/logos/vias.png new file mode 100644 index 0000000..cb99937 Binary files /dev/null and b/front/bahnui-front/src/assets/logos/vias.png differ diff --git a/front/bahnui-front/src/components/explore.vue b/front/bahnui-front/src/components/explore.vue new file mode 100644 index 0000000..28b1d49 --- /dev/null +++ b/front/bahnui-front/src/components/explore.vue @@ -0,0 +1,107 @@ + + + + + + \ No newline at end of file diff --git a/front/bahnui-front/src/components/routing.vue b/front/bahnui-front/src/components/routing.vue index edb5e2a..c4da32b 100644 --- a/front/bahnui-front/src/components/routing.vue +++ b/front/bahnui-front/src/components/routing.vue @@ -12,7 +12,7 @@

{{ leg.line?.fahrtNr }}

{{ leg.line?.operator?.name }}

- +
{{ leg.destination.name }}
{{ timeWithDelay(leg.arrival, leg.arrivalDelay) }}

Gleis {{ leg.arrivalPlatform }}

@@ -96,7 +96,7 @@ diff --git a/front/bahnui-front/src/components/search/timeSelect.vue b/front/bahnui-front/src/components/search/timeSelect.vue new file mode 100644 index 0000000..3703861 --- /dev/null +++ b/front/bahnui-front/src/components/search/timeSelect.vue @@ -0,0 +1,52 @@ + + \ No newline at end of file diff --git a/front/bahnui-front/src/lib/operators.js b/front/bahnui-front/src/lib/operators.js index 0233aa4..abc78bf 100644 --- a/front/bahnui-front/src/lib/operators.js +++ b/front/bahnui-front/src/lib/operators.js @@ -32,7 +32,7 @@ let operatorfunctions = { return new URL('../assets/logos/blauwnet.png', import.meta.url); } else if (operator.id === "waldbahn-die-landerbahn-gmbh-dlb"){ return new URL('../assets/logos/waldbahn.png', import.meta.url); - } else if (operator.id === "ostdeutsche-eisenbahn-gmbh"){ + } else if (operator.id === "ostdeutsche-eisenbahn-gmbh" || operator.id === "odeg-ostdeutsche-eisenbahn-gmbh"){ return new URL('../assets/logos/odeg.svg', import.meta.url); } else if (operator.id === "trenitalia"){ return new URL('../assets/logos/trenitalia.svg', import.meta.url); @@ -42,7 +42,7 @@ let operatorfunctions = { return new URL('../assets/logos/sj.svg', import.meta.url); } else if (operator.id === "vy"){ return new URL('../assets/logos/vy.svg', import.meta.url); - } else if (operator.id === "danische-staatsbahnen"){ + } else if (operator.id === "danische-staatsbahnen" || operator.id === "dsb"){ return new URL('../assets/logos/dsb.png', import.meta.url); } else if (operator.id === "skanetrafiken-oresundstag"){ return new URL('../assets/logos/oresundtag.svg', import.meta.url); @@ -170,8 +170,48 @@ let operatorfunctions = { return new URL('../assets/logos/bart.svg', import.meta.url); } else if (operator.id === 'san-francisco-municipal-transportation-agency'){ return new URL('../assets/logos/muni.svg', import.meta.url); + } else if (operator.id === 'vias-gmbh'){ + return new URL('../assets/logos/vias.png', import.meta.url); + } else if (operator.id === 'ac-transit'){ + return new URL('../assets/logos/actransit.svg', import.meta.url); + } else if (operator.id === 'des-moines-area-regional-transit-authority'){ + return new URL('../assets/logos/desmoinesart.svg', import.meta.url); + } else if (operator.id === 'iarnrod-eireann-irish-rail'){ + return new URL('../assets/logos/ieir.svg', import.meta.url); + } else if (operator.id === 'caltrain'){ + return new URL('../assets/logos/caltrain.svg', import.meta.url); + } else if (operator.id === 'marin-transit'){ + return new URL('../assets/logos/marintransit.svg', import.meta.url); + } else if (operator.id === 'samtrans'){ + return new URL('../assets/logos/samtrans.svg', import.meta.url); + } else if (operator.id === 'golden-gate-transit'){ + return new URL('../assets/logos/goldengate.png', import.meta.url); + } else if (operator.id === 'regionalverkehre-start-deutschland-gmbh-start-unterelbe'){ + return new URL('../assets/logos/regiostart.svg', import.meta.url); + } else if (operator.id === 'evb-elbe-weser-gmbh'){ + return new URL('../assets/logos/evb.svg', import.meta.url); + } else if (operator.id === 'metronom'){ + return new URL('../assets/logos/metronom.svg', import.meta.url); + } else if (operator.id === 'flixtrain'){ + return new URL('../assets/logos/flixtrain.svg', import.meta.url); + } else if (operator.id === 'verkehrsbetrieb-liechtensteinmobil'){ + return new URL('../assets/logos/liemobil.svg', import.meta.url); + } else if (operator.id === 'rheinruhrbahn-transdev'){ + return new URL('../assets/logos/rheinruhrbahn.svg', import.meta.url); + } else if (operator.id === 'hlb-hessenbahn-gmbh'){ + return new URL('../assets/logos/hlb.svg', import.meta.url); + } else if (operator.id === 'verkehrsbetriebe-glattal'){ + return new URL('../assets/logos/vbglattal.svg', import.meta.url); + } else if (operator.id === 'stern-hafferl-verkehrs-gmbh'){ + return new URL('../assets/logos/sternhafferl.svg', import.meta.url); + } else if (operator.id === 'graz-koflacher-bahn-und-busbetrieb-gmbh'){ + return new URL('../assets/logos/gkb.svg', import.meta.url); + } else if (operator.id === 'luxtram'){ + return new URL('../assets/logos/luxtram.png', import.meta.url); + } else if (operator.id === 'dsb-s-tog'){ + return new URL('../assets/logos/stog.svg', import.meta.url); } else { - console.log(operator.id); + console.log("OPERATOR:"+operator.id); return (null); } } diff --git a/front/bahnui-front/src/lib/remarks.js b/front/bahnui-front/src/lib/remarks.js index 3e5bda8..ec342a8 100644 --- a/front/bahnui-front/src/lib/remarks.js +++ b/front/bahnui-front/src/lib/remarks.js @@ -18,18 +18,36 @@ let remarkfunctions = { return new URL('../assets/icons/power-sockets.svg', import.meta.url); } else if (remark.code === 'wheelchairs-space' || remark.code === "RO"){ return new URL('../assets/icons/wheelchair-space.svg', import.meta.url); - } else if (remark.code === "bicycle-conveyance" || remark.code === "FK"){ + } else if (remark.code === "bicycle-conveyance" || remark.code === "FK" || remark.code === "FB" || remark.code === "71"){ return new URL('../assets/icons/bicycle-conveyance.svg', import.meta.url); } else if (remark.code === "bicycle-conveyance-reservation" || remark.code === "FR"){ return new URL('../assets/icons/bicycle-conveyance-reservation.svg', import.meta.url); } else if (remark.code === "2nd-class-only" || remark.code === "J2" || remark.code === "K2"){ return new URL('../assets/icons/2nd-class-only.svg', import.meta.url); - } else if (remark.code === "boarding-ramp" || remark.code === "EF"){ + } else if (remark.code === "boarding-ramp" || remark.code === "EF" || remark.code === "ER"){ return new URL('../assets/icons/boarding-ramp.svg', import.meta.url); } else if (remark.code === "no-bicycle-conveyance"){ return new URL('../assets/icons/no-bicycle-conveyance.svg', import.meta.url); - + } else if (remark.code === "RE"){ + return new URL('../assets/icons/reservation-suggested.svg', import.meta.url); + } else if (remark.code === "9N"){ + return new URL('../assets/icons/deutschlandticket-ungueltig.svg', import.meta.url); + } else if (remark.code === "HD"){ + return new URL('../assets/icons/quiet-zone.svg', import.meta.url); + } else if (remark.code === "SB"){ + return new URL('../assets/icons/ticket-required.svg', import.meta.url); + } else if (remark.code === "komfort-checkin"){ + return new URL('../assets/icons/komfort-check-in.svg', import.meta.url); + } else if (remark.code === "QT"){ + return new URL('../assets/icons/tilting-train.svg', import.meta.url); + } else if (remark.code === "SL"){ + return new URL('../assets/icons/sleeper-couchette.svg', import.meta.url); + } else if (remark.code === "DU"){ + return new URL('../assets/icons/special-ticket.svg', import.meta.url); + } else if (remark.code === "RC" || remark.code === "OJ"){ + return new URL('../assets/icons/info.svg', import.meta.url); } else { + console.log("REMARK type:"+remark.type+", code:"+remark.code+": "+remark.text) return null; } } diff --git a/front/bahnui-front/src/lib/routes.js b/front/bahnui-front/src/lib/routes.js index 11c639b..2475b64 100644 --- a/front/bahnui-front/src/lib/routes.js +++ b/front/bahnui-front/src/lib/routes.js @@ -3,15 +3,15 @@ let routefunctions = { let line = leg?.line if (!line){ return (['black', 'white']); - } else if (line.productName === "STB"){ + } else if (line.productName === "STB" || line.productName === "U"){ return (['white', 'blue']); } else if (line.productName === "S"){ return (['white', 'green']); - } else if (line.productName === "RE" || line.productName === "RB" || line.productName === "R"){ + } else if (line.productName === "RE" || line.productName === "RB" || line.productName === "R" || line.productName === "Re" || line.productName === "REX"){ return (['white', 'red']); } else if (line.productName === "IR"){ return (['green', 'white']); - } else if (line.productName === "IC" || line.productName === "ICE" || line.productName === "RJ" || line.productName === "RJX"){ + } else if (line.productName === "IC" || line.productName === "ICE" || line.productName === "RJ" || line.productName === "RJX" || line.productName === "ICL"){ return (['red', 'white']); } else if (line.productName === "EC" || line.productName === "ECE"){ return (['blue', 'white']); @@ -21,10 +21,10 @@ let routefunctions = { return (['yellow', 'blue']); } else if (line.productName === "TGV"){ return (['IndianRed', 'white']); - } else if (line.productName === "EN"){ + } else if (line.productName === "EN" || line.productName === "NJ"){ return (['white', 'navy']); } else { - console.log(line.productName) + console.log("Line Product:"+line.productName) return (['black', 'white']); } }, @@ -49,14 +49,17 @@ let routefunctions = { } else if (leg.line.product === 'national'){ return "NAT" } else { + console.log("Route Number, LEG:") console.log(leg) return "" } } else { + console.log("Route Number, LEG:") console.log(leg) return "" } } else { + console.log("Route Number, LEG:") console.log(leg) return "" } diff --git a/front/bahnui-front/src/lib/services.js b/front/bahnui-front/src/lib/services.js new file mode 100644 index 0000000..68916a1 --- /dev/null +++ b/front/bahnui-front/src/lib/services.js @@ -0,0 +1,18 @@ +let services = [ + {id:"db", name:"Deutsche Bahn"}, + {id:"vbb", name:"Verkehrsverbund Berlin-Brandenburg"}, + {id:"pkp", name:"Polskie Koleje Panstwowe"}, + {id:"irish", name:"Iarnrod Eireann"}, + {id:"oebb", name:"Oesterreichische Bundesbahnen"}, + {id:"lu", name:"Mobiliteitszentral (Luxembourg)"}, + {id:"bart", name:"Bay Area Rapid Transit (BART)"}, + {id:"dart", name:"Des Moines Area Rapid Transit (DART)"}, + //{id:"nrw", name:"mobil.nrw"}, + {id:"danmark", name:"Rejseplanen in Denmark"}, + //{id:"zvv", name:"Züricher Verkehrsverbund"}, + {id:"bls", name:"BLS AG (Bern)"}, + {id:"nrwbus", name:"DB Busradar NRW"}, + {id:"cmta", name:"Austin, Texas (CMTA/CapMetro)"}, + {id:"vrn", name:"Verkehrsverbund Rhein-Neckar (VRN)"}, +] +export default services; diff --git a/front/bahnui-front/src/locales/en.json b/front/bahnui-front/src/locales/en.json index 7a9e3ab..32875db 100644 --- a/front/bahnui-front/src/locales/en.json +++ b/front/bahnui-front/src/locales/en.json @@ -32,7 +32,9 @@ "compulsary-reservation":"reservation compulsary", "2nd-class-only":"2nd class only", "RZ":"barrier-free boarding for wheelchairs", - "on-board-restaurant":"on-board restaurant" + "on-board-restaurant":"on-board restaurant", + "RC":"Reservations at DB ticket machines/travel centres & many DB agencies", + "OJ":"ÖBB Nightjet (www.nightjet.com)" } } } \ No newline at end of file diff --git a/front/bahnui-front/src/main.js b/front/bahnui-front/src/main.js index 78c94a9..01ba81a 100644 --- a/front/bahnui-front/src/main.js +++ b/front/bahnui-front/src/main.js @@ -9,6 +9,7 @@ import { createVuetify } from 'vuetify' import * as components from 'vuetify/components' import * as directives from 'vuetify/directives' import SearchBahn from './components/search.vue' +import ExploreBahn from './components/explore.vue' import { createI18n } from 'vue-i18n' import de from "./locales/de.json"; import en from "./locales/en.json"; @@ -19,6 +20,7 @@ const app = createApp(App) const routes = [ { path: '/search', component: SearchBahn }, + { path: '/explore', component: ExploreBahn }, ] const router = createRouter({