Merge pull request #16 from Spythere/development

v1.5.2
This commit is contained in:
Spythere
2025-05-02 14:47:08 +02:00
committed by GitHub
4 changed files with 41 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "genera-tor", "name": "genera-tor",
"version": "1.5.1", "version": "1.5.2",
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
+28 -2
View File
@@ -143,8 +143,9 @@ export default defineComponent({
this.fetchSceneriesData(); this.fetchSceneriesData();
}, },
activated() { async activated() {
this.fetchActiveData(); await this.fetchActiveData();
this.handleQueries();
this.refreshInterval = window.setInterval(() => { this.refreshInterval = window.setInterval(() => {
this.fetchActiveData(); this.fetchActiveData();
@@ -254,6 +255,31 @@ export default defineComponent({
} }
this.store.orderMode = 'OrderMessage'; this.store.orderMode = 'OrderMessage';
},
handleQueries() {
const query = new URLSearchParams(window.location.search);
const id = query.get('sceneryId');
if (id) {
const [sceneryName, sceneryRegion] = id.split('|');
this.selectedRegion = sceneryRegion;
const queryScenery = this.activeData?.activeSceneries?.find(
(sc) => sc.stationName == sceneryName && sc.region == sceneryRegion && sc.isOnline
);
if (queryScenery) {
this.selectedSceneryId = `${queryScenery.stationName}|${queryScenery.stationHash}|${queryScenery.dispatcherName}|${queryScenery.region}`;
console.log(this.selectedRegion);
this.selectOption();
this.store.orderMode = 'OrderTrainPicker';
}
}
} }
} }
}); });
+10
View File
@@ -77,6 +77,16 @@ export default defineComponent({
}; };
}, },
created() {
const query = new URLSearchParams(window.location.search);
const id = query.get('sceneryId');
if (id != null) {
this.store.orderMode = 'OrderTrainPicker';
}
},
computed: { computed: {
orderModeComponent() { orderModeComponent() {
switch (this.store.orderMode) { switch (this.store.orderMode) {
+2 -1
View File
@@ -42,7 +42,8 @@ export default defineConfig({
], ],
}, },
devOptions: { devOptions: {
enabled: true, // enabled: true,
suppressWarnings: true
}, },
}), }),
], ],