From 85a1a0216e269072774a2226da35c675a856545f Mon Sep 17 00:00:00 2001 From: Spythere Date: Mon, 2 Oct 2023 22:05:54 +0200 Subject: [PATCH] poprawki miniatur --- .gitignore | 4 + src/assets/icon-unknown.png | Bin 953 -> 0 bytes .../{unknown.png => icon-vehicle-unknown.png} | Bin src/components/Global/TrainThumbnail.vue | 60 +- .../JournalTimetables/TimetableExtra.vue | 17 +- src/components/SceneryView/SceneryInfo.vue | 26 +- .../SceneryView/SceneryTimetable.vue | 74 +- src/components/TrainsView/TrainInfo.vue | 12 +- src/components/TrainsView/TrainSchedule.vue | 41 +- src/data/mockWebsocketData.json | 15863 ---------------- src/views/SceneryView.vue | 1 + 11 files changed, 106 insertions(+), 15992 deletions(-) delete mode 100644 src/assets/icon-unknown.png rename src/assets/{unknown.png => icon-vehicle-unknown.png} (100%) delete mode 100644 src/data/mockWebsocketData.json diff --git a/.gitignore b/.gitignore index b4c4f95..2976f5b 100644 --- a/.gitignore +++ b/.gitignore @@ -31,7 +31,11 @@ node_modules .firebase .firebaserc +# Env .env +# Mock data +mockWebsocketData.json + .fake .ionide \ No newline at end of file diff --git a/src/assets/icon-unknown.png b/src/assets/icon-unknown.png deleted file mode 100644 index 0a930b9d944319307688642ef5c00bc1fd98f7c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 953 zcmeAS@N?(olHy`uVBq!ia0y~yV2lT{wK>>;XJIEZ35AIgd5tiDo{M8w?>Zhi3J zc+%B_MPSVwo&NIga^>$C76vBHx@yXou`74kWKP4` z(W1NK6%|@I+7wTnF?yz=$$I}|X+J~!`$smX|KFLfyy%%O8;i@M$g~+|AK5;BS(aOH zPrYx`q%}hGh5KigI6iV;r!BX?P;Zychchc?dY%_{?>w5st}T1UYnhvkt4y%z+)u4* zj%z*FJr}j~Sk(6?`aI9SPEB2RS;k4IJEDn2kSj}LF_Uy*RB4dTl1%%DkL64L3hfjr zntJfW#s)2u6YJ#v@Yj`Ri>j&bSyI5nvDf00DY=53%se)dn>2R^O;{G7!SFu)i?8K^|6(sTavfC3&Vd9T(EcfWS|IV zfk$L91B0G22s2hJwJ!q-vX^-Jy0SlKV&zq5+xT_aX`ql~iEBiObAE1aYF-J0b5Uwy zNotBhd1gt5g1e`0KzJjcI54&+dAc};RNQ)d)4Qx$L89T}gvqv>*}`(&{iqFKZ z3i}RmU$}o=h@nHj;Rln#K88o!K)OR8NCP=wK@<)`1s3IJ4qaDlY-&C9>udOLUfw;Idyr@vl!e=F+sv-EW;nJoBeOeSz%u{u8$MHTOTbu@MGJp3wNwP-<;3Utre$x{k-Qpo$Xo2 zr@oeOyLV@^_ -
- + - + - - - - - -
+ + + + + + + + diff --git a/src/components/JournalView/JournalTimetables/TimetableExtra.vue b/src/components/JournalView/JournalTimetables/TimetableExtra.vue index ebe9b78..b5db63a 100644 --- a/src/components/JournalView/JournalTimetables/TimetableExtra.vue +++ b/src/components/JournalView/JournalTimetables/TimetableExtra.vue @@ -17,12 +17,18 @@ {{ $t('journal.stock-length') }} - {{ currentHistoryIndex == 0 ? timetable.stockLength : stockHistory[currentHistoryIndex].stockLength || timetable.stockLength }}m + + {{ currentHistoryIndex == 0 ? timetable.stockLength : stockHistory[currentHistoryIndex].stockLength || timetable.stockLength }}m + {{ $t('journal.stock-mass') }} - {{ Math.floor((currentHistoryIndex == 0 ? timetable.stockMass! : stockHistory[currentHistoryIndex].stockMass || timetable.stockMass) / 1000) }}t + + {{ + Math.floor((currentHistoryIndex == 0 ? timetable.stockMass! : stockHistory[currentHistoryIndex].stockMass || timetable.stockMass) / 1000) + }}t + @@ -34,9 +40,9 @@
    -
  • - -
    {{ car.replace(/_/g, ' ').split(':')[0] }}
    +
  • + +
    {{ stockName.split(':')[0].split('_').splice(0, 2).join(' ') }} {{ stockName.split(':')[1] }}
@@ -146,6 +152,5 @@ ul.stock-list { color: #aaa; font-size: 0.9em; } - } diff --git a/src/components/SceneryView/SceneryInfo.vue b/src/components/SceneryView/SceneryInfo.vue index 1e62113..a7a2a56 100644 --- a/src/components/SceneryView/SceneryInfo.vue +++ b/src/components/SceneryView/SceneryInfo.vue @@ -2,7 +2,7 @@
- +
@@ -26,28 +26,16 @@ {{ $t('scenery.project-title') }}: - + {{ station.generalInfo.project }}
- +
- - {{ - $t( - 'scenery.authors-title', - { authors: station.generalInfo.authors.length }, - station.generalInfo.authors.length - ) - }}: - + {{ $t('scenery.authors-title', { authors: station.generalInfo.authors.length }, station.generalInfo.authors.length) }}: {{ station.generalInfo.authors.join(', ') }}
@@ -55,14 +43,14 @@
- +
- + - +
diff --git a/src/components/SceneryView/SceneryTimetable.vue b/src/components/SceneryView/SceneryTimetable.vue index 82f1a36..2385167 100644 --- a/src/components/SceneryView/SceneryTimetable.vue +++ b/src/components/SceneryView/SceneryTimetable.vue @@ -14,19 +14,11 @@ - + icon-pragotron - + icon-tablice @@ -39,8 +31,8 @@ @@ -106,15 +98,12 @@
- {{ - timestampToString(scheduledTrain.stopInfo.arrivalTimestamp) - }} + {{ timestampToString(scheduledTrain.stopInfo.arrivalTimestamp) }}
{{ timestampToString(scheduledTrain.stopInfo.arrivalRealTimestamp) }} - ({{ scheduledTrain.stopInfo.arrivalDelay > 0 ? '+' : '' - }}{{ scheduledTrain.stopInfo.arrivalDelay }}) + ({{ scheduledTrain.stopInfo.arrivalDelay > 0 ? '+' : '' }}{{ scheduledTrain.stopInfo.arrivalDelay }})
@@ -146,15 +135,12 @@
- {{ - timestampToString(scheduledTrain.stopInfo.departureTimestamp) - }} + {{ timestampToString(scheduledTrain.stopInfo.departureTimestamp) }}
{{ timestampToString(scheduledTrain.stopInfo.departureRealTimestamp) }} - ({{ scheduledTrain.stopInfo.departureDelay > 0 ? '+' : '' - }}{{ scheduledTrain.stopInfo.departureDelay }}) + ({{ scheduledTrain.stopInfo.departureDelay > 0 ? '+' : '' }}{{ scheduledTrain.stopInfo.departureDelay }})
@@ -203,16 +189,22 @@ export default defineComponent({ listOpen: false, }), + mounted() { + this.loadSelectedOption(); + }, + + activated() { + this.loadSelectedOption(); + }, + setup(props) { const route = useRoute(); const currentURL = computed(() => `${location.origin}${route.fullPath}`); const store = useStore(); - const selectedCheckpoint = ref( - props.station?.generalInfo?.checkpoints?.length == 0 - ? '' - : props.station?.generalInfo?.checkpoints[0].checkpointName || '' + const chosenCheckpoint = ref( + props.station?.generalInfo?.checkpoints?.length == 0 ? '' : props.station?.generalInfo?.checkpoints[0].checkpointName || null ); const computedScheduledTrains = computed(() => { @@ -221,8 +213,7 @@ export default defineComponent({ const station = props.station as Station; let scheduledTrains = - station.generalInfo?.checkpoints.find((cp) => cp.checkpointName === selectedCheckpoint.value) - ?.scheduledTrains || + station.generalInfo?.checkpoints.find((cp) => cp.checkpointName === chosenCheckpoint.value)?.scheduledTrains || station.onlineInfo?.scheduledTrains || []; @@ -243,12 +234,21 @@ export default defineComponent({ return { currentURL, - selectedCheckpoint, + chosenCheckpoint, computedScheduledTrains, store, }; }, + computed: { + tabliceZbiorczeHref() { + let url = `https://tablice-td2.web.app/?station=${this.station.name}`; + if (this.chosenCheckpoint) url += `&checkpoint=${this.chosenCheckpoint}`; + + return url; + }, + }, + methods: { loadSelectedOption() { if (!this.station) return; @@ -256,27 +256,19 @@ export default defineComponent({ if (!this.station.generalInfo.checkpoints) return; if (this.station.generalInfo.checkpoints.length == 0) return; - if (this.selectedCheckpoint != '') return; + if (this.chosenCheckpoint != '') return; - this.selectedCheckpoint = this.station.generalInfo.checkpoints[0].checkpointName; + this.chosenCheckpoint = this.station.generalInfo.checkpoints[0].checkpointName; }, - selectCheckpoint(cp: { checkpointName: string }) { - this.selectedCheckpoint = cp.checkpointName; + setCheckpoint(cp: { checkpointName: string }) { + this.chosenCheckpoint = cp.checkpointName; }, showTimetableOnlyView() { this.$router.push(`${this.$route.fullPath}&timetableOnly=1`); }, }, - - mounted() { - this.loadSelectedOption(); - }, - - activated() { - this.loadSelectedOption(); - }, }); diff --git a/src/components/TrainsView/TrainInfo.vue b/src/components/TrainsView/TrainInfo.vue index 26f740f..2bcf6f3 100644 --- a/src/components/TrainsView/TrainInfo.vue +++ b/src/components/TrainsView/TrainInfo.vue @@ -107,7 +107,14 @@ export default defineComponent({ }); + + +