mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-04 22:08:12 +00:00
Aktualizacja 1.9.9
Aktualizacja 1.9.9
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "stacjownik",
|
"name": "stacjownik",
|
||||||
"version": "1.9.8",
|
"version": "1.9.9",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve",
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
<?xml version="1.0" ?><svg height="21px" version="1.1" viewBox="0 0 20 21" width="20px" xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" xmlns:xlink="http://www.w3.org/1999/xlink"><title/><desc/><defs/><g fill="none" fill-rule="evenodd" id="Page-1" stroke="none" stroke-width="1"><g fill="#ffffff" id="Core" opacity="0.9" transform="translate(-464.000000, -254.000000)"><g id="history" transform="translate(464.000000, 254.500000)"><path d="M10.5,0 C7,0 3.9,1.9 2.3,4.8 L0,2.5 L0,9 L6.5,9 L3.7,6.2 C5,3.7 7.5,2 10.5,2 C14.6,2 18,5.4 18,9.5 C18,13.6 14.6,17 10.5,17 C7.2,17 4.5,14.9 3.4,12 L1.3,12 C2.4,16 6.1,19 10.5,19 C15.8,19 20,14.7 20,9.5 C20,4.3 15.7,0 10.5,0 L10.5,0 Z M9,5 L9,10.1 L13.7,12.9 L14.5,11.6 L10.5,9.2 L10.5,5 L9,5 L9,5 Z" id="Shape"/></g></g></g></svg>
|
|
||||||
|
Before Width: | Height: | Size: 813 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg width="144" height="144" viewBox="0 0 144 144" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path d="M77.9831 61.3284L97.9732 7L44 74.9104H69.9871L51.996 137L99.9722 61.3284H77.9831Z" fill="#FFF500"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 216 B |
@@ -1,4 +0,0 @@
|
|||||||
<svg width="144" height="144" viewBox="0 0 144 144" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path d="M77.9831 61.3284L97.9732 7L44 74.9104H69.9871L51.996 137L99.9722 61.3284H77.9831Z" fill="#FFF500"/>
|
|
||||||
<path d="M46 19L98.4444 123.889" stroke="#FF0000" stroke-width="6.33884" stroke-linecap="round"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 314 B |
@@ -1,5 +0,0 @@
|
|||||||
<svg width="144" height="144" viewBox="0 0 144 144" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<rect x="9.20437" y="2.4661" width="36.5457" height="57.8287" rx="16.7449" transform="matrix(0.869001 -0.494811 0.505207 0.862998 50.006 87.4256)" stroke="white" stroke-width="13.3959"/>
|
|
||||||
<rect x="9.20437" y="2.4661" width="36.5457" height="57.8287" rx="16.7449" transform="matrix(0.869001 -0.494811 0.505207 0.862998 14.9599 29.6039)" stroke="white" stroke-width="13.3959"/>
|
|
||||||
<path d="M65.1132 58.145L79.8523 84.3103" stroke="white" stroke-width="10.0469" stroke-linecap="round" stroke-linejoin="bevel"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 611 B |
@@ -1,3 +0,0 @@
|
|||||||
<svg width="144" height="144" viewBox="0 0 144 144" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path d="M7.19995 72L44.3741 93.9988L44.8386 50.8056L7.19995 72ZM139.192 73.4193L102.018 51.4204L101.554 94.6137L139.192 73.4193ZM40.8255 76.1026L105.486 76.7979L105.567 69.3166L40.9059 68.6214L40.8255 76.1026Z" fill="white"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 334 B |
@@ -190,7 +190,7 @@ ul.options {
|
|||||||
|
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|
||||||
z-index: 10;
|
z-index: 100;
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,9 +46,9 @@
|
|||||||
<span class="region-badge" :class="doc.region">PL1</span>
|
<span class="region-badge" :class="doc.region">PL1</span>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<span :data-status="doc.isOnline"
|
<span :data-status="doc.isOnline">
|
||||||
>{{ doc.isOnline ? $t('journal.online-since') : 'OFFLINE' }} </span
|
{{ doc.isOnline ? $t('journal.online-since') : 'OFFLINE' }}
|
||||||
>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
{{ new Date(doc.timestampFrom).toLocaleTimeString('pl-PL', { timeStyle: 'short' }) }}
|
{{ new Date(doc.timestampFrom).toLocaleTimeString('pl-PL', { timeStyle: 'short' }) }}
|
||||||
</span>
|
</span>
|
||||||
@@ -196,7 +196,7 @@ export default defineComponent({
|
|||||||
computedHistoryList() {
|
computedHistoryList() {
|
||||||
return this.historyList.filter(
|
return this.historyList.filter(
|
||||||
(doc) => doc.isOnline || (doc.currentDuration && doc.currentDuration > 10 * 60000)
|
(doc) => doc.isOnline || (doc.currentDuration && doc.currentDuration > 10 * 60000)
|
||||||
); //.sort((a, b) => (b.isOnline ? 1 : 0) - (a.isOnline ? 1 : 0));
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -231,16 +231,6 @@ export default defineComponent({
|
|||||||
this.$router.push(`/scenery?station=${name.trim().replace(/ /g, '_')}`);
|
this.$router.push(`/scenery?station=${name.trim().replace(/ /g, '_')}`);
|
||||||
},
|
},
|
||||||
|
|
||||||
calculateDuration(timestampMs: number) {
|
|
||||||
const minsTotal = Math.round(timestampMs / 60000);
|
|
||||||
const hoursTotal = Math.floor(minsTotal / 60);
|
|
||||||
const minsInHour = minsTotal % 60;
|
|
||||||
|
|
||||||
return minsTotal > 60
|
|
||||||
? this.$t('journal.hours', { hours: hoursTotal, minutes: minsInHour })
|
|
||||||
: this.$t('journal.minutes', { minutes: minsTotal });
|
|
||||||
},
|
|
||||||
|
|
||||||
isAnotherDay(prevIndex: number, currIndex: number) {
|
isAnotherDay(prevIndex: number, currIndex: number) {
|
||||||
if (currIndex == 0) return true;
|
if (currIndex == 0) return true;
|
||||||
|
|
||||||
@@ -333,13 +323,6 @@ export default defineComponent({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (responseData.errorMessage) {
|
|
||||||
// this.historyDataStatus.status = DataStatus.Error;
|
|
||||||
// this.historyDataStatus.error = responseData.errorMessage;
|
|
||||||
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (!responseData) return;
|
if (!responseData) return;
|
||||||
|
|
||||||
// Response data exists
|
// Response data exists
|
||||||
@@ -439,3 +422,4 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,112 @@
|
|||||||
|
<template>
|
||||||
|
<section class="scenery-dispatchers-history scenery-section">
|
||||||
|
<Loading v-if="dataStatus != 2" />
|
||||||
|
|
||||||
|
<div class="list-warning" v-else-if="dispatcherHistoryList.length == 0">{{ $t('scenery.history-list-empty') }}</div>
|
||||||
|
|
||||||
|
<ul class="history-list" v-else>
|
||||||
|
<li class="list-item" v-for="historyItem in dispatcherHistoryList">
|
||||||
|
<div>
|
||||||
|
<span class="text--grayed">#{{ historyItem.stationHash }} </span>
|
||||||
|
<b class="text--primary">{{ historyItem.dispatcherName }}</b>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="historyItem.timestampTo">
|
||||||
|
<b>{{ $d(historyItem.timestampFrom) }}</b>
|
||||||
|
|
||||||
|
{{ timestampToString(historyItem.timestampFrom) }}
|
||||||
|
- {{ timestampToString(historyItem.timestampTo) }} ({{ calculateDuration(historyItem.currentDuration) }})
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="dispatcher-online" v-else>
|
||||||
|
{{ $t('journal.online-since') }}
|
||||||
|
<b>{{ timestampToString(historyItem.timestampFrom) }}</b>
|
||||||
|
({{ calculateDuration(historyItem.currentDuration) }})
|
||||||
|
<span></span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import dateMixin from '@/mixins/dateMixin';
|
||||||
|
import { DataStatus } from '@/scripts/enums/DataStatus';
|
||||||
|
import { DispatcherHistory } from '@/scripts/interfaces/api/DispatchersAPIData';
|
||||||
|
import Station from '@/scripts/interfaces/Station';
|
||||||
|
import { URLs } from '@/scripts/utils/apiURLs';
|
||||||
|
import axios from 'axios';
|
||||||
|
import { defineComponent, PropType } from 'vue';
|
||||||
|
import Loading from '../Global/Loading.vue';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'SceneryDispatchersHistory',
|
||||||
|
mixins: [dateMixin],
|
||||||
|
props: {
|
||||||
|
station: {
|
||||||
|
type: Object as PropType<Station>,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dispatcherHistoryList: [] as DispatcherHistory[],
|
||||||
|
dataStatus: DataStatus.Loading,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.fetchAPIData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async fetchAPIData(countFrom = 0, countLimit = 30) {
|
||||||
|
try {
|
||||||
|
const requestString = `${URLs.stacjownikAPI}/api/getDispatchers?stationName=${this.station.name}&countFrom=${countFrom}&countLimit=${countLimit}`;
|
||||||
|
const historyAPIData: DispatcherHistory[] = await (await axios.get(requestString)).data;
|
||||||
|
|
||||||
|
this.dispatcherHistoryList = historyAPIData;
|
||||||
|
this.dataStatus = DataStatus.Loaded;
|
||||||
|
|
||||||
|
console.log(this.dispatcherHistoryList);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
components: { Loading },
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import '../../styles/responsive.scss';
|
||||||
|
@import '../../styles/SceneryView/styles.scss';
|
||||||
|
|
||||||
|
|
||||||
|
.history-list {
|
||||||
|
padding: 0 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-item {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
text-align: left;
|
||||||
|
background-color: #353535;
|
||||||
|
padding: 0.5em;
|
||||||
|
margin: 0.5em 0;
|
||||||
|
|
||||||
|
line-height: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dispatcher-online {
|
||||||
|
color: springgreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
@include smallScreen {
|
||||||
|
.list-item {
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
@@ -3,18 +3,12 @@
|
|||||||
<div class="scenery-name">
|
<div class="scenery-name">
|
||||||
<a v-if="station.generalInfo?.url" :href="station.generalInfo.url" target="_blank" rel="noopener noreferrer">
|
<a v-if="station.generalInfo?.url" :href="station.generalInfo.url" target="_blank" rel="noopener noreferrer">
|
||||||
{{ station.name }}
|
{{ station.name }}
|
||||||
<sup v-if="station.generalInfo?.project" style="color: salmon; font-size: 0.5em; vertical-align: text-top">
|
|
||||||
{{ station.generalInfo.project }}
|
|
||||||
</sup>
|
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<span v-else>{{ station.name }}</span>
|
<span v-else>{{ station.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="scenery-authors" v-if="station.generalInfo?.authors">
|
<div class="scenery-hash" v-if="station.onlineInfo?.hash">#{{ station.onlineInfo.hash }}</div>
|
||||||
Autorzy: {{ station.generalInfo?.authors?.join(', ') }}
|
|
||||||
</div>
|
|
||||||
<!-- <div class="scenery-hash" v-if="station.onlineInfo?.hash">#{{ station.onlineInfo.hash }}</div> -->
|
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -37,10 +31,6 @@ export default defineComponent({
|
|||||||
@import '../../styles/variables.scss';
|
@import '../../styles/variables.scss';
|
||||||
@import '../../styles/responsive.scss';
|
@import '../../styles/responsive.scss';
|
||||||
|
|
||||||
.info-header {
|
|
||||||
padding-top: 2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.scenery-name {
|
.scenery-name {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: $accentCol;
|
color: $accentCol;
|
||||||
@@ -48,7 +38,7 @@ export default defineComponent({
|
|||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
font-size: 3.5em;
|
font-size: 3.5em;
|
||||||
margin-top: 0.25em;
|
padding: 0 0.5em;
|
||||||
|
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
|
|
||||||
@@ -59,15 +49,6 @@ export default defineComponent({
|
|||||||
|
|
||||||
.scenery-hash {
|
.scenery-hash {
|
||||||
color: #aaa;
|
color: #aaa;
|
||||||
font-size: 0.3em;
|
font-size: 1.2em;
|
||||||
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.scenery-authors {
|
|
||||||
color: #999;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,52 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="scenery-info">
|
<div class="scenery-info">
|
||||||
<section v-if="!timetableOnly">
|
<section v-if="!timetableOnly">
|
||||||
<!-- info stats -->
|
<div class="info-general" v-if="station.generalInfo">
|
||||||
<!-- <scenery-info-stats :station="station" /> -->
|
|
||||||
|
|
||||||
<!-- info icons -->
|
|
||||||
<scenery-info-icons :station="station" />
|
<scenery-info-icons :station="station" />
|
||||||
|
|
||||||
<!-- info routes -->
|
<div class="general-list">
|
||||||
|
<span>
|
||||||
|
<b>{{ $t('availability.title') }}:</b> {{ $t(`availability.${station.generalInfo.availability}`) }}
|
||||||
|
|
||||||
|
<span v-if="station.generalInfo.reqLevel > -1">
|
||||||
|
- {{ $tc('scenery.req-level', station.generalInfo.reqLevel, { lvl: station.generalInfo.reqLevel }) }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- <span v-if="station.generalInfo.reqLevel > 0">
|
||||||
|
- minimum {{ station.generalInfo.reqLevel }} poziom dyżurnego
|
||||||
|
</span>
|
||||||
|
<span v-else-if="station.generalInfo.reqLevel == 0">- dla wszystkich poziomów</span> -->
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span>
|
||||||
|
• <b>{{ $t('controls.title') }}:</b> {{ $t(`controls.${station.generalInfo.controlType}`) }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span>
|
||||||
|
• <b>{{ $t('signals.title') }}:</b> {{ $t(`signals.${station.generalInfo.signalType}`) }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span v-if="station.generalInfo.lines">
|
||||||
|
• <b>{{ $t('scenery.lines-title') }}:</b> {{ station.generalInfo.lines }}
|
||||||
|
</span>
|
||||||
|
<span v-if="station.generalInfo.project">
|
||||||
|
• <b>{{ $t('scenery.project-title') }}: </b>
|
||||||
|
<b style="color: salmon">{{ station.generalInfo.project }}</b>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<scenery-info-routes :station="station" />
|
<scenery-info-routes :station="station" />
|
||||||
|
|
||||||
|
<div class="scenery-authors" v-if="station.generalInfo.authors && station.generalInfo.authors.length > 0">
|
||||||
|
<b> {{ $tc('scenery.authors-title', station.generalInfo.authors.length) }}: </b>
|
||||||
|
{{ station.generalInfo.authors.join(', ') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="margin: 2em 0; height: 2px; background-color: white" />
|
||||||
|
|
||||||
|
<!-- info stats -->
|
||||||
|
<!-- <scenery-info-stats :station="station" /> -->
|
||||||
<!-- info dispatcher -->
|
<!-- info dispatcher -->
|
||||||
<scenery-info-dispatcher :station="station" :onlineFrom="onlineFrom" />
|
<scenery-info-dispatcher :station="station" :onlineFrom="onlineFrom" />
|
||||||
|
|
||||||
@@ -20,6 +57,10 @@
|
|||||||
<!-- spawn list -->
|
<!-- spawn list -->
|
||||||
<scenery-info-spawn-list :station="station" />
|
<scenery-info-spawn-list :station="station" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- info icons -->
|
||||||
|
|
||||||
|
<!-- info routes -->
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -80,9 +121,26 @@ h3.section-header {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.info-lists {
|
.info-lists {
|
||||||
display: grid;
|
display: flex;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(300px, 400px));
|
flex-wrap: wrap;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
|
|
||||||
|
margin-top: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-general {
|
||||||
|
margin-top: 1em;
|
||||||
|
font-size: 1.1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.general-list {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
span {
|
||||||
|
margin: 0 0.15em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.badge {
|
.badge {
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="info-icons" v-if="station.generalInfo">
|
<section class="info-icons">
|
||||||
<span
|
<span
|
||||||
|
v-if="station.generalInfo && station.generalInfo.reqLevel >= 0"
|
||||||
|
class="scenery-icon icon-info level"
|
||||||
|
:style="calculateExpStyle(station.generalInfo.reqLevel)"
|
||||||
|
>
|
||||||
|
{{ station.generalInfo.reqLevel >= 2 ? station.generalInfo.reqLevel : 'L' }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span
|
||||||
|
v-if="station.generalInfo"
|
||||||
class="scenery-icon icon-info"
|
class="scenery-icon icon-info"
|
||||||
:class="station.generalInfo.controlType.replace('+', '-')"
|
:class="station.generalInfo.controlType.replace('+', '-')"
|
||||||
:title="$t('desc.control-type') + $t(`controls.${station.generalInfo.controlType}`)"
|
:title="$t('desc.control-type') + $t(`controls.${station.generalInfo.controlType}`)"
|
||||||
@@ -9,54 +18,60 @@
|
|||||||
</span>
|
</span>
|
||||||
|
|
||||||
<img
|
<img
|
||||||
|
v-if="station.generalInfo?.SUP"
|
||||||
class="icon-info"
|
class="icon-info"
|
||||||
v-if="station.generalInfo.SUP"
|
|
||||||
:src="require(`@/assets/icon-SUP.svg`)"
|
:src="require(`@/assets/icon-SUP.svg`)"
|
||||||
alt="SUP (RASP-UZK)"
|
alt="SUP (RASP-UZK)"
|
||||||
:title="$t('desc.SUP')"
|
:title="$t('desc.SUP')"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<img
|
<img
|
||||||
|
v-if="station.generalInfo?.signalType"
|
||||||
class="icon-info"
|
class="icon-info"
|
||||||
v-if="station.generalInfo.signalType"
|
|
||||||
:src="require(`@/assets/icon-${station.generalInfo.signalType}.svg`)"
|
:src="require(`@/assets/icon-${station.generalInfo.signalType}.svg`)"
|
||||||
:alt="station.generalInfo.signalType"
|
:alt="station.generalInfo.signalType"
|
||||||
:title="$t('desc.signals-type') + $t(`signals.${station.generalInfo.signalType}`)"
|
:title="$t('desc.signals-type') + $t(`signals.${station.generalInfo.signalType}`)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<img
|
<img
|
||||||
|
v-if="station.generalInfo?.availability == 'nonPublic'"
|
||||||
class="icon-info"
|
class="icon-info"
|
||||||
v-if="station.generalInfo.availability == 'nonPublic'"
|
|
||||||
:src="icons.lock"
|
:src="icons.lock"
|
||||||
alt="Non-public scenery"
|
alt="Non-public scenery"
|
||||||
:title="$t('desc.non-public')"
|
:title="$t('desc.non-public')"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<img
|
<img
|
||||||
|
v-if="station.generalInfo?.availability == 'unavailable'"
|
||||||
class="icon-info"
|
class="icon-info"
|
||||||
v-if="station.generalInfo.availability == 'unavailable'"
|
|
||||||
:src="icons.unavailable"
|
:src="icons.unavailable"
|
||||||
alt="Unavailable scenery"
|
alt="Unavailable scenery"
|
||||||
:title="$t('desc.unavailable')"
|
:title="$t('desc.unavailable')"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<img
|
<img
|
||||||
|
v-if="station.generalInfo?.availability == 'abandoned'"
|
||||||
class="icon-info"
|
class="icon-info"
|
||||||
v-if="station.generalInfo.availability == 'abandoned'"
|
|
||||||
:src="icons.abandoned"
|
:src="icons.abandoned"
|
||||||
alt="Abandoned scenery"
|
alt="Abandoned scenery"
|
||||||
:title="$t('desc.abandoned')"
|
:title="$t('desc.abandoned')"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<img
|
<img
|
||||||
|
v-if="station.generalInfo?.lines"
|
||||||
class="icon-info"
|
class="icon-info"
|
||||||
v-if="station.generalInfo && station.generalInfo.lines != ''"
|
|
||||||
:src="icons.real"
|
:src="icons.real"
|
||||||
alt="real scenery"
|
alt="real scenery"
|
||||||
:title="`${$t('desc.real')} ${station.generalInfo.lines}`"
|
:title="`${$t('desc.real')} ${station.generalInfo.lines}`"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<img v-if="!station.generalInfo" :src="icons.unknown" alt="icon-unknown" :title="$t('desc.unknown')" />
|
<img
|
||||||
|
v-if="!station.generalInfo"
|
||||||
|
class="icon-info"
|
||||||
|
:src="icons.unknown"
|
||||||
|
alt="icon-unknown"
|
||||||
|
:title="$t('desc.unknown')"
|
||||||
|
/>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -65,9 +80,10 @@ import { defineComponent } from 'vue';
|
|||||||
import stationInfoMixin from '@/mixins/stationInfoMixin';
|
import stationInfoMixin from '@/mixins/stationInfoMixin';
|
||||||
|
|
||||||
import Station from '@/scripts/interfaces/Station';
|
import Station from '@/scripts/interfaces/Station';
|
||||||
|
import styleMixin from '@/mixins/styleMixin';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
mixins: [stationInfoMixin],
|
mixins: [stationInfoMixin, styleMixin],
|
||||||
props: {
|
props: {
|
||||||
station: {
|
station: {
|
||||||
type: Object as () => Station,
|
type: Object as () => Station,
|
||||||
@@ -94,6 +110,9 @@ export default defineComponent({
|
|||||||
.info-icons {
|
.info-icons {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
margin: 1em;
|
||||||
}
|
}
|
||||||
.icon-info {
|
.icon-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -101,11 +120,13 @@ export default defineComponent({
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
width: 3em;
|
width: 3em;
|
||||||
font-size: 1.2em;
|
margin: 0.25em;
|
||||||
|
|
||||||
margin: 1em 0.5em;
|
|
||||||
|
|
||||||
border: 2px solid #4e4e4e;
|
border: 2px solid #4e4e4e;
|
||||||
border-radius: 0.5em;
|
border-radius: 0.5em;
|
||||||
|
|
||||||
|
&.level {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,24 +1,49 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="info-routes" v-if="station.generalInfo">
|
<section class="info-routes" v-if="station.generalInfo">
|
||||||
<div
|
<div class="routes one-way" v-if="station.generalInfo.routes.oneWay.length > 0">
|
||||||
|
<b>{{ $t('scenery.one-way-routes') }}</b>
|
||||||
|
|
||||||
|
<ul class="routes-list">
|
||||||
|
<li
|
||||||
|
v-for="route in station.generalInfo.routes.oneWay"
|
||||||
|
:class="{ 'no-catenary': !route.catenary, internal: route.isInternal }"
|
||||||
|
>
|
||||||
|
{{ route.name }}
|
||||||
|
<b v-if="route.SBL">SBL</b>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="routes two-way" v-if="station.generalInfo.routes.twoWay.length > 0">
|
||||||
|
<b>{{ $t('scenery.two-way-routes') }}</b>
|
||||||
|
|
||||||
|
<ul class="routes-list">
|
||||||
|
<li
|
||||||
|
v-for="route in station.generalInfo.routes.twoWay"
|
||||||
|
:class="{ 'no-catenary': !route.catenary, internal: route.isInternal }"
|
||||||
|
>
|
||||||
|
{{ route.name }} <b v-if="route.SBL">SBL</b>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <div
|
||||||
class="route-info"
|
class="route-info"
|
||||||
:class="{ 'no-catenary': !route.catenary, internal: route.isInternal }"
|
:class="{ 'no-catenary': !route.catenary, internal: route.isInternal }"
|
||||||
v-for="route in [...station.generalInfo.routes.oneWay, ...station.generalInfo.routes.twoWay].filter(
|
v-for="route in [...station.generalInfo.routes.oneWay, ...station.generalInfo.routes.twoWay].filter(
|
||||||
(route) => route.name != '-'
|
(route) => route.name != '-'
|
||||||
)"
|
)"
|
||||||
:key="route.name"
|
:key="route.name"
|
||||||
:title="
|
:title="`Szlak ${route.name}: ${route.isInternal ? 'wewnętrzny' : 'zewnętrzny'}, ${
|
||||||
`Szlak ${route.name}: ${route.isInternal ? 'wewnętrzny' : 'zewnętrzny'}, ${
|
|
||||||
route.tracks == 2 ? 'dwutorowy' : 'jednotorowy'
|
route.tracks == 2 ? 'dwutorowy' : 'jednotorowy'
|
||||||
}, ${route.catenary ? 'zelektryfikowany' : 'niezelektryfikowany'} z ${route.SBL ? 'SBL' : 'PBL'} ${
|
}, ${route.catenary ? 'zelektryfikowany' : 'niezelektryfikowany'} z ${route.SBL ? 'SBL' : 'PBL'} ${
|
||||||
route.TWB ? 'i blokadą dwukierunkową' : ''
|
route.TWB ? 'i blokadą dwukierunkową' : ''
|
||||||
}`
|
}`"
|
||||||
"
|
> -->
|
||||||
>
|
<!-- <span class="track-name">
|
||||||
<span class="track-name">
|
|
||||||
<b>{{ route.name }}</b>
|
<b>{{ route.name }}</b>
|
||||||
</span>
|
</span> -->
|
||||||
|
<!--
|
||||||
<span class="track-specs">
|
<span class="track-specs">
|
||||||
{{ route.tracks }}tor
|
{{ route.tracks }}tor
|
||||||
<img v-if="route.catenary" :src="icons.trackCatenary" alt="icon track catenary" />
|
<img v-if="route.catenary" :src="icons.trackCatenary" alt="icon track catenary" />
|
||||||
@@ -26,8 +51,8 @@
|
|||||||
|
|
||||||
<img v-if="route.TWB" :src="icons.trackTWB" alt="icon track twb" />
|
<img v-if="route.TWB" :src="icons.trackTWB" alt="icon track twb" />
|
||||||
<img v-if="route.SBL" :src="icons.trackSBL" alt="icon track sbl" />
|
<img v-if="route.SBL" :src="icons.trackSBL" alt="icon track sbl" />
|
||||||
</span>
|
</span> -->
|
||||||
</div>
|
<!-- </div> -->
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -42,52 +67,48 @@ export default defineComponent({
|
|||||||
default: {},
|
default: {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
icons: {
|
|
||||||
trackTWB: require('@/assets/icon-track-twb.svg'),
|
|
||||||
trackSBL: require('@/assets/icon-track-sbl.svg'),
|
|
||||||
trackCatenary: require('@/assets/icon-track-catenary.svg'),
|
|
||||||
trackNoCatenary: require('@/assets/icon-track-nocatenary.svg'),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.info-routes {
|
.info-routes {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
padding: 1em 3em;
|
margin: 1em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.route-info {
|
.routes {
|
||||||
margin: 0.45em 0.25em;
|
display: flex;
|
||||||
font-size: 1.05em;
|
justify-content: center;
|
||||||
cursor: help;
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
span {
|
padding: 0.25em;
|
||||||
height: 100%;
|
}
|
||||||
background-color: #009dce;
|
|
||||||
|
ul.routes-list {
|
||||||
|
margin: 0.45em 0.25em;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
li {
|
||||||
|
background-color: #007599;
|
||||||
|
|
||||||
padding: 0.2em 0.25em;
|
padding: 0.2em 0.25em;
|
||||||
}
|
margin-left: 0.25em;
|
||||||
|
|
||||||
&.no-catenary > span {
|
&.no-catenary {
|
||||||
background-color: #686868;
|
background-color: #686868;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.internal > .track-name {
|
&.internal {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
b {
|
||||||
height: 1.2em;
|
color: var(--clr-primary);
|
||||||
vertical-align: text-bottom;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ $terminated: salmon;
|
|||||||
$disconnected: slategray;
|
$disconnected: slategray;
|
||||||
|
|
||||||
.info-user-list {
|
.info-user-list {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -1,23 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="scenery-timetable">
|
<section class="scenery-timetable">
|
||||||
<h3 class="timetable-header">
|
<div class="timetable-header">
|
||||||
|
<h3>
|
||||||
<img :src="icons.timetable" alt="icon-timetable" />
|
<img :src="icons.timetable" alt="icon-timetable" />
|
||||||
<span>{{ $t('scenery.timetables') }}</span>
|
<span>{{ $t('scenery.timetables') }}</span>
|
||||||
|
|
||||||
<span class="timetable-count">
|
|
||||||
<span class="text--primary">{{ station.onlineInfo?.scheduledTrains?.length || '0' }}</span>
|
<span class="text--primary">{{ station.onlineInfo?.scheduledTrains?.length || '0' }}</span>
|
||||||
/
|
<span> / </span>
|
||||||
<span class="text--grayed">
|
<span class="text--grayed">
|
||||||
{{ station.onlineInfo?.scheduledTrains?.filter((train) => train.stopInfo.confirmed).length || '0' }}
|
{{ station.onlineInfo?.scheduledTrains?.filter((train) => train.stopInfo.confirmed).length || '0' }}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
|
||||||
|
|
||||||
<a :href="currentURL + '&timetable_only=1'" v-if="!timetableOnly" target="_blank" class="timetable-only">
|
|
||||||
<img :src="viewIcon" alt="icon-view" :title="$t('timetables.timetable-only')" />
|
|
||||||
</a>
|
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<div class="checkpoints" v-if="station && station.generalInfo?.checkpoints">
|
<div class="timetable-checkpoints" v-if="station && station.generalInfo?.checkpoints">
|
||||||
<button
|
<button
|
||||||
v-for="cp in station.generalInfo.checkpoints"
|
v-for="cp in station.generalInfo.checkpoints"
|
||||||
:key="cp.checkpointName"
|
:key="cp.checkpointName"
|
||||||
@@ -28,9 +23,11 @@
|
|||||||
{{ cp.checkpointName }}
|
{{ cp.checkpointName }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<transition name="scenery-timetable-list-anim" mode="out-in">
|
<div class="timetable-list">
|
||||||
<div :key="store.dataStatuses.trains + selectedCheckpoint">
|
<!-- <transition name="scenery-timetable-list-anim" mode="out-in"> -->
|
||||||
|
<!-- <div :key="store.dataStatuses.trains + selectedCheckpoint" class="scenery-timetable-list"> -->
|
||||||
<div style="padding-bottom: 5em" v-if="store.dataStatuses.trains == 0 && computedScheduledTrains.length == 0">
|
<div style="padding-bottom: 5em" v-if="store.dataStatuses.trains == 0 && computedScheduledTrains.length == 0">
|
||||||
<Loading />
|
<Loading />
|
||||||
</div>
|
</div>
|
||||||
@@ -63,11 +60,11 @@
|
|||||||
<span class="content" v-html="scheduledTrain.stopInfo.comments"> </span>
|
<span class="content" v-html="scheduledTrain.stopInfo.comments"> </span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
|
||||||
<span style="color: white">
|
<span style="color: white">
|
||||||
{{ scheduledTrain.driverName }}
|
{{ scheduledTrain.driverName }}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
|
||||||
<span class="general-status">
|
<span class="general-status">
|
||||||
<span :class="scheduledTrain.stopStatus">
|
<span :class="scheduledTrain.stopStatus">
|
||||||
{{ $t(`timetables.${scheduledTrain.stopStatus}`) }}
|
{{ $t(`timetables.${scheduledTrain.stopStatus}`) }}
|
||||||
@@ -103,8 +100,7 @@
|
|||||||
|
|
||||||
<span>
|
<span>
|
||||||
{{ timestampToString(scheduledTrain.stopInfo.arrivalRealTimestamp) }}
|
{{ timestampToString(scheduledTrain.stopInfo.arrivalRealTimestamp) }}
|
||||||
({{ scheduledTrain.stopInfo.arrivalDelay > 0 ? '+' : ''
|
({{ scheduledTrain.stopInfo.arrivalDelay > 0 ? '+' : '' }}{{ scheduledTrain.stopInfo.arrivalDelay }})
|
||||||
}}{{ scheduledTrain.stopInfo.arrivalDelay }})
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
@@ -156,14 +152,15 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
|
||||||
</div>
|
<!-- </transition> -->
|
||||||
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Station from '@/scripts/interfaces/Station';
|
import Station from '@/scripts/interfaces/Station';
|
||||||
import SelectBox from '../Global/SelectBox.vue';
|
import SelectBox from '../Global/SelectBox.vue';
|
||||||
import { computed, defineComponent, ref } from '@vue/runtime-core';
|
import { computed, defineComponent, PropType, ref } from '@vue/runtime-core';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import dateMixin from '@/mixins/dateMixin';
|
import dateMixin from '@/mixins/dateMixin';
|
||||||
import routerMixin from '@/mixins/routerMixin';
|
import routerMixin from '@/mixins/routerMixin';
|
||||||
@@ -171,18 +168,17 @@ import { useStore } from '@/store/store';
|
|||||||
import Loading from '../Global/Loading.vue';
|
import Loading from '../Global/Loading.vue';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
name: 'SceneryTimetable',
|
||||||
|
|
||||||
components: { SelectBox, Loading },
|
components: { SelectBox, Loading },
|
||||||
|
|
||||||
mixins: [dateMixin, routerMixin],
|
mixins: [dateMixin, routerMixin],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
station: {
|
station: {
|
||||||
type: Object as () => Station,
|
type: Object as PropType<Station>,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
timetableOnly: {
|
|
||||||
type: Boolean,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
@@ -271,50 +267,34 @@ export default defineComponent({
|
|||||||
@import '../../styles/responsive.scss';
|
@import '../../styles/responsive.scss';
|
||||||
@import '../../styles/variables.scss';
|
@import '../../styles/variables.scss';
|
||||||
|
|
||||||
h3.timetable-header {
|
// .scenery-timetable {
|
||||||
margin: 0.5em 0;
|
// height: 85vh;
|
||||||
padding: 0.3em;
|
// max-height: 900px;
|
||||||
|
// min-height: 450px;
|
||||||
|
// }
|
||||||
|
|
||||||
|
.scenery-timetable {
|
||||||
|
height: 100%;
|
||||||
|
overflow-y: scroll;
|
||||||
|
padding: 0 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timetable-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-wrap: wrap;
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
font-size: 1.5em;
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 99;
|
||||||
|
|
||||||
a {
|
background-color: #181818;
|
||||||
|
|
||||||
|
h3 {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
align-items: center;
|
||||||
|
font-size: 1.4em;
|
||||||
img {
|
|
||||||
width: 1.2em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.timetable-only {
|
|
||||||
margin-left: 0.5em;
|
|
||||||
|
|
||||||
img {
|
|
||||||
width: 1.1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus {
|
|
||||||
outline: 1px solid white;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.scenery-timetable-list-anim {
|
|
||||||
&-enter-from,
|
|
||||||
&-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-enter-active {
|
|
||||||
transition: all 100ms ease-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-leave-active {
|
|
||||||
transition: all 100ms ease-out 100ms;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,7 +304,7 @@ h3.timetable-header {
|
|||||||
}
|
}
|
||||||
|
|
||||||
&-item {
|
&-item {
|
||||||
margin: 1em auto;
|
margin: 0.5em auto;
|
||||||
padding: 0 0.5em;
|
padding: 0 0.5em;
|
||||||
max-width: 1100px;
|
max-width: 1100px;
|
||||||
|
|
||||||
@@ -332,7 +312,7 @@ h3.timetable-header {
|
|||||||
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
|
||||||
gap: 0 0.5em;
|
gap: 0 0.5em;
|
||||||
|
|
||||||
background: $bgCol;
|
background: #353535;
|
||||||
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
@@ -358,18 +338,20 @@ h3.timetable-header {
|
|||||||
&-schedule {
|
&-schedule {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(30px, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(30px, 1fr));
|
||||||
font-size: 1.15em;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.checkpoints {
|
.timetable-list {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timetable-checkpoints {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
font-size: 1.1em;
|
||||||
font-size: 1.2em;
|
padding: 0.75em 0;
|
||||||
|
|
||||||
.checkpoint_item {
|
.checkpoint_item {
|
||||||
&.current {
|
&.current {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@@ -412,17 +394,23 @@ h3.timetable-header {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.general-info {
|
.general-info {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
.info-number {
|
.info-number {
|
||||||
color: $accentCol;
|
color: $accentCol;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-route {
|
.info-route {
|
||||||
margin-top: 0.5em;
|
margin-top: 0.5em;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.g-tooltip > .content {
|
.g-tooltip > .content {
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
color: white;
|
color: white;
|
||||||
|
|
||||||
|
left: 110%;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
@@ -471,6 +459,7 @@ h3.timetable-header {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
margin: 0 0.3rem;
|
margin: 0 0.3rem;
|
||||||
|
font-size: 1.1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-stop {
|
&-stop {
|
||||||
@@ -496,6 +485,21 @@ h3.timetable-header {
|
|||||||
font-size: 0.85em;
|
font-size: 0.85em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.scenery-timetable-list-anim {
|
||||||
|
&-enter-from,
|
||||||
|
&-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-enter-active {
|
||||||
|
transition: all 100ms ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-leave-active {
|
||||||
|
transition: all 100ms ease-out 100ms;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@include smallScreen() {
|
@include smallScreen() {
|
||||||
.timetable {
|
.timetable {
|
||||||
&-item {
|
&-item {
|
||||||
@@ -503,7 +507,7 @@ h3.timetable-header {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
font-size: 1.2em;
|
font-size: 1.05em;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-general {
|
&-general {
|
||||||
@@ -512,7 +516,6 @@ h3.timetable-header {
|
|||||||
|
|
||||||
&-schedule {
|
&-schedule {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0.5em 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,110 @@
|
|||||||
|
<template>
|
||||||
|
<section class="scenery-timetables-history scenery-section">
|
||||||
|
<Loading v-if="dataStatus != 2" />
|
||||||
|
|
||||||
|
<div class="list-warning" v-else-if="sceneryHistoryList.length == 0">{{ $t('scenery.history-list-empty') }}</div>
|
||||||
|
<ul class="history-list" v-else>
|
||||||
|
<li class="list-item" v-for="historyItem in sceneryHistoryList">
|
||||||
|
<div>
|
||||||
|
<b>{{ localeDay(historyItem.beginDate, $i18n.locale) }}</b>
|
||||||
|
{{ localeTime(historyItem.beginDate, $i18n.locale) }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="text--grayed"> #{{ historyItem.timetableId }} </span>
|
||||||
|
<b class="text--primary"> {{ historyItem.trainCategoryCode }} {{ historyItem.trainNo }}</b>
|
||||||
|
<div>{{ historyItem.driverName }}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>{{ historyItem.route.replace('|', ' -> ') }}</div>
|
||||||
|
<!-- <div>{{ historyItem.routeDistance }} km</div> -->
|
||||||
|
<div>
|
||||||
|
{{ $t('scenery.timetable-author-title') }}:
|
||||||
|
<b v-if="historyItem.authorName">{{ historyItem.authorName }}</b>
|
||||||
|
<i v-else>{{ $t('scenery.timetable-author-unknown') }}</i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <div v-if="historyItem.authorId">{{ historyItem.authorName }}</div> -->
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import dateMixin from '@/mixins/dateMixin';
|
||||||
|
import { DataStatus } from '@/scripts/enums/DataStatus';
|
||||||
|
import { SceneryTimetableHistory, TimetableHistory } from '@/scripts/interfaces/api/TimetablesAPIData';
|
||||||
|
import Station from '@/scripts/interfaces/Station';
|
||||||
|
import { URLs } from '@/scripts/utils/apiURLs';
|
||||||
|
import axios from 'axios';
|
||||||
|
import { defineComponent, PropType } from 'vue';
|
||||||
|
import Loading from '../Global/Loading.vue';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'SceneryTimetablesHistory',
|
||||||
|
mixins: [dateMixin],
|
||||||
|
props: {
|
||||||
|
station: {
|
||||||
|
type: Object as PropType<Station>,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
sceneryHistoryList: [] as TimetableHistory[],
|
||||||
|
dataStatus: DataStatus.Loading,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.fetchAPIData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async fetchAPIData(countFrom = 0, countLimit = 15) {
|
||||||
|
try {
|
||||||
|
const requestString = `${URLs.stacjownikAPI}/api/getSceneryTimetables?name=${this.station.name}&countFrom=${countFrom}&countLimit=${countLimit}`;
|
||||||
|
const historyAPIData: SceneryTimetableHistory = await (await axios.get(requestString)).data;
|
||||||
|
|
||||||
|
this.sceneryHistoryList = historyAPIData.sceneryTimetables;
|
||||||
|
this.dataStatus = DataStatus.Loaded;
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
components: { Loading },
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import '../../styles/responsive.scss';
|
||||||
|
@import '../../styles/SceneryView/styles.scss';
|
||||||
|
|
||||||
|
.list-warning {
|
||||||
|
padding: 1em 0.5em;
|
||||||
|
background-color: #444;
|
||||||
|
font-size: 1.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.history-list {
|
||||||
|
padding: 0 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-item {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 2fr 2fr 1fr;
|
||||||
|
gap: 1em;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
background-color: #353535;
|
||||||
|
padding: 0.5em;
|
||||||
|
margin: 0.5em 0;
|
||||||
|
|
||||||
|
line-height: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
@include smallScreen {
|
||||||
|
.list-item {
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
font-size: 1.05em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+27
-2
@@ -34,12 +34,14 @@
|
|||||||
"real": "Scenery with real lines: "
|
"real": "Scenery with real lines: "
|
||||||
},
|
},
|
||||||
"signals": {
|
"signals": {
|
||||||
|
"title": "Signal type",
|
||||||
"współczesna": "modern",
|
"współczesna": "modern",
|
||||||
"mieszana": "mixed",
|
"mieszana": "mixed",
|
||||||
"kształtowa": "mechanical",
|
"kształtowa": "mechanical",
|
||||||
"historyczna": "historyczna"
|
"historyczna": "historical"
|
||||||
},
|
},
|
||||||
"controls": {
|
"controls": {
|
||||||
|
"title": "Control type",
|
||||||
"SPK": "SPK",
|
"SPK": "SPK",
|
||||||
"SCS": "SCS",
|
"SCS": "SCS",
|
||||||
"SCS-SPK": "SCS/SPK",
|
"SCS-SPK": "SCS/SPK",
|
||||||
@@ -241,7 +243,30 @@
|
|||||||
"no-scenery": "Oops! This scenery doesn't exist!",
|
"no-scenery": "Oops! This scenery doesn't exist!",
|
||||||
"return-btn": "Return to main site",
|
"return-btn": "Return to main site",
|
||||||
"history-btn": "View the dispatcher history",
|
"history-btn": "View the dispatcher history",
|
||||||
"info-btn": "Return to the scenery view"
|
"info-btn": "Return to the scenery view",
|
||||||
|
"authors-title": "Scenery author | Scenery authors",
|
||||||
|
"lines-title": "Real lines",
|
||||||
|
"project-title": "Project name",
|
||||||
|
"one-way-routes": "One way routes",
|
||||||
|
"two-way-routes": "Two way routes",
|
||||||
|
|
||||||
|
"option-active-timetables": "Active timetables",
|
||||||
|
"option-timetables-history": "Scenery timetables history",
|
||||||
|
"option-dispatchers-history": "Scenery dispatchers history",
|
||||||
|
|
||||||
|
"timetable-author-title": "Issued by",
|
||||||
|
"timetable-author-unknown": "Author unknown",
|
||||||
|
|
||||||
|
"req-level": "all dispatcher levels | dispatcher level {lvl} required | dispatcher level {lvl} required",
|
||||||
|
"history-list-empty": "No recorded scenery history!"
|
||||||
|
},
|
||||||
|
"availability": {
|
||||||
|
"title": "Availability",
|
||||||
|
"default": "in-game",
|
||||||
|
"nonDefault": "downloadable",
|
||||||
|
"unavailable": "unavailable",
|
||||||
|
"nonPublic": "private",
|
||||||
|
"abandoned": "abandoned"
|
||||||
},
|
},
|
||||||
"timetables": {
|
"timetables": {
|
||||||
"timetable-only": "Switch to timetable-only view",
|
"timetable-only": "Switch to timetable-only view",
|
||||||
|
|||||||
+30
-5
@@ -35,22 +35,24 @@
|
|||||||
"abandoned": "Sceneria wycofana z rozgrywki"
|
"abandoned": "Sceneria wycofana z rozgrywki"
|
||||||
},
|
},
|
||||||
"signals": {
|
"signals": {
|
||||||
|
"title": "Sygnalizacja",
|
||||||
"współczesna": "współczesna",
|
"współczesna": "współczesna",
|
||||||
"mieszana": "mieszana",
|
"mieszana": "mieszana",
|
||||||
"kształtowa": "kształtowa",
|
"kształtowa": "kształtowa",
|
||||||
"historyczna": "historyczna"
|
"historyczna": "historyczna"
|
||||||
},
|
},
|
||||||
"controls": {
|
"controls": {
|
||||||
|
"title": "Sterowanie",
|
||||||
"SPK": "SPK",
|
"SPK": "SPK",
|
||||||
"SCS": "SCS",
|
"SCS": "SCS",
|
||||||
"SCS-SPK": "SCS/SPK",
|
"SCS-SPK": "SCS/SPK",
|
||||||
"SPE": "SPE",
|
"SPE": "SPE",
|
||||||
"ręczne": "ręczne",
|
"ręczne": "ręczne",
|
||||||
"ręczne+SPK": "ręczne + SPK",
|
"ręczne+SPK": "ręczne z SPK",
|
||||||
"ręczne+SCS": "ręczne + SCS",
|
"ręczne+SCS": "ręczne z SCS",
|
||||||
"mechaniczne": "mechaniczne",
|
"mechaniczne": "mechaniczne",
|
||||||
"mechaniczne+SPK": "mechaniczne + SPK",
|
"mechaniczne+SPK": "mechaniczne z SPK",
|
||||||
"mechaniczne+SCS": "mechaniczne + SCS"
|
"mechaniczne+SCS": "mechaniczne z SCS"
|
||||||
},
|
},
|
||||||
"status": {
|
"status": {
|
||||||
"online": "DO ",
|
"online": "DO ",
|
||||||
@@ -242,7 +244,30 @@
|
|||||||
"no-scenery": "Ups! Ta sceneria nie istnieje!",
|
"no-scenery": "Ups! Ta sceneria nie istnieje!",
|
||||||
"return-btn": "Wróć na stronę główną",
|
"return-btn": "Wróć na stronę główną",
|
||||||
"history-btn": "Przejdź do widoku historii dyżurnych ruchu",
|
"history-btn": "Przejdź do widoku historii dyżurnych ruchu",
|
||||||
"info-btn": "Wróc do widoku scenerii"
|
"info-btn": "Wróc do widoku scenerii",
|
||||||
|
"authors-title": "Autor scenerii | Autorzy scenerii",
|
||||||
|
"lines-title": "Rzeczywiste linie",
|
||||||
|
"project-title": "Projekt",
|
||||||
|
"one-way-routes": "Szlaki jednotorowe",
|
||||||
|
"two-way-routes": "Szlaki dwutorowe",
|
||||||
|
|
||||||
|
"option-active-timetables": "Aktywne rozkłady jazdy",
|
||||||
|
"option-timetables-history": "Historia rozkładów scenerii",
|
||||||
|
"option-dispatchers-history": "Historia dyżurów scenerii",
|
||||||
|
|
||||||
|
"timetable-author-title": "Wydany przez",
|
||||||
|
"timetable-author-unknown": "Autor nieznany",
|
||||||
|
|
||||||
|
"req-level": "ogólnodostępna | minimum {lvl} poziom dyżurnego | minimum {lvl} poziom dyżurnego",
|
||||||
|
"history-list-empty": "Brak historii dla tej scenerii!"
|
||||||
|
},
|
||||||
|
"availability": {
|
||||||
|
"title": "Dostępność",
|
||||||
|
"default": "w paczce",
|
||||||
|
"nonDefault": "poza paczką",
|
||||||
|
"unavailable": "niedostępna",
|
||||||
|
"nonPublic": "niepubliczna",
|
||||||
|
"abandoned": "wycofana"
|
||||||
},
|
},
|
||||||
"timetables": {
|
"timetables": {
|
||||||
"timetable-only": "Wyodrębnij rozkłady jazdy",
|
"timetable-only": "Wyodrębnij rozkłady jazdy",
|
||||||
|
|||||||
+31
-21
@@ -4,37 +4,47 @@ export default defineComponent({
|
|||||||
methods: {
|
methods: {
|
||||||
localeDate(dateString: string, locale: string) {
|
localeDate(dateString: string, locale: string) {
|
||||||
return new Date(dateString).toLocaleDateString(locale == 'pl' ? 'pl-PL' : 'en-GB', {
|
return new Date(dateString).toLocaleDateString(locale == 'pl' ? 'pl-PL' : 'en-GB', {
|
||||||
weekday: "long",
|
weekday: 'long',
|
||||||
day: "numeric",
|
day: 'numeric',
|
||||||
month: "2-digit",
|
month: '2-digit',
|
||||||
year: "numeric",
|
year: 'numeric',
|
||||||
hour: "2-digit",
|
hour: '2-digit',
|
||||||
minute: "2-digit"
|
minute: '2-digit',
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
localeDay(dateString: string, locale: string) {
|
localeDay(dateString: string, locale: string) {
|
||||||
return new Date(dateString).toLocaleDateString(locale == 'pl' ? 'pl-PL' : 'en-GB', {
|
return new Date(dateString).toLocaleDateString(locale == 'pl' ? 'pl-PL' : 'en-GB', {
|
||||||
day: "numeric",
|
day: 'numeric',
|
||||||
month: "2-digit",
|
month: '2-digit',
|
||||||
year: "numeric"
|
year: 'numeric',
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
localeTime(dateString: string, locale: string) {
|
localeTime(dateString: string, locale: string) {
|
||||||
return new Date(dateString).toLocaleTimeString(locale == 'pl' ? 'pl-PL' : 'en-GB', {
|
return new Date(dateString).toLocaleTimeString(locale == 'pl' ? 'pl-PL' : 'en-GB', {
|
||||||
hour: "2-digit",
|
hour: '2-digit',
|
||||||
minute: "2-digit"
|
minute: '2-digit',
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
timestampToString(timestamp: number | null) {
|
timestampToString(timestamp: number | null) {
|
||||||
return timestamp
|
return timestamp
|
||||||
? new Date(timestamp).toLocaleTimeString("pl-PL", {
|
? new Date(timestamp).toLocaleTimeString('pl-PL', {
|
||||||
hour: "2-digit",
|
hour: '2-digit',
|
||||||
minute: "2-digit"
|
minute: '2-digit',
|
||||||
})
|
|
||||||
: "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
: '';
|
||||||
|
},
|
||||||
|
|
||||||
|
calculateDuration(timestampMs: number) {
|
||||||
|
const minsTotal = Math.round(timestampMs / 60000);
|
||||||
|
const hoursTotal = Math.floor(minsTotal / 60);
|
||||||
|
const minsInHour = minsTotal % 60;
|
||||||
|
|
||||||
|
return minsTotal > 60
|
||||||
|
? this.$t('journal.hours', { hours: hoursTotal, minutes: minsInHour })
|
||||||
|
: this.$t('journal.minutes', { minutes: minsTotal });
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
export interface DispatcherHistory {
|
||||||
|
currentDuration: number;
|
||||||
|
dispatcherId: number;
|
||||||
|
dispatcherName: string;
|
||||||
|
isOnline: boolean;
|
||||||
|
lastOnlineTimestamp: number;
|
||||||
|
region: string;
|
||||||
|
stationHash: string;
|
||||||
|
stationName: string;
|
||||||
|
timestampFrom: number;
|
||||||
|
timestampTo?: number;
|
||||||
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
export interface TimetableHistory {
|
export interface TimetableHistory {
|
||||||
timetableId: number;
|
timetableId: number;
|
||||||
trainNo: number;
|
trainNo: number;
|
||||||
@@ -28,3 +27,9 @@ export interface TimetableHistory {
|
|||||||
authorName?: string;
|
authorName?: string;
|
||||||
authorId?: number;
|
authorId?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface SceneryTimetableHistory {
|
||||||
|
sceneryTimetables: TimetableHistory[];
|
||||||
|
totalCount: number;
|
||||||
|
sceneryName: string;
|
||||||
|
}
|
||||||
|
|||||||
@@ -117,15 +117,16 @@ export function getScheduledTrain(train: Train, trainStopIndex: number, stationN
|
|||||||
let prevStationName = '',
|
let prevStationName = '',
|
||||||
nextStationName = '';
|
nextStationName = '';
|
||||||
|
|
||||||
|
|
||||||
for (let i = trainStopIndex - 1; i >= 0; i--) {
|
for (let i = trainStopIndex - 1; i >= 0; i--) {
|
||||||
if (followingStops[i].stopName.startsWith('<strong>')) {
|
if (/strong|podg/g.test(followingStops[i].stopName)) {
|
||||||
prevStationName = followingStops[i].stopNameRAW;
|
prevStationName = followingStops[i].stopNameRAW;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = trainStopIndex + 1; i < followingStops.length; i++) {
|
for (let i = trainStopIndex + 1; i < followingStops.length; i++) {
|
||||||
if (followingStops[i].stopName.startsWith('<strong>')) {
|
if (/strong|podg/g.test(followingStops[i].stopName)) {
|
||||||
nextStationName = followingStops[i].stopNameRAW;
|
nextStationName = followingStops[i].stopNameRAW;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -344,6 +344,7 @@ export const useStore = defineStore('store', {
|
|||||||
|
|
||||||
socket.on('UPDATE', (data: APIData) => {
|
socket.on('UPDATE', (data: APIData) => {
|
||||||
this.apiData = data;
|
this.apiData = data;
|
||||||
|
this.dataStatuses.connection = DataStatus.Loaded;
|
||||||
this.setOnlineData();
|
this.setOnlineData();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -353,7 +354,6 @@ export const useStore = defineStore('store', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.webSocket = socket;
|
this.webSocket = socket;
|
||||||
this.dataStatuses.connection = DataStatus.Loaded;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async connectToAPI() {
|
async connectToAPI() {
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
.scenery-section {
|
||||||
|
position: relative;
|
||||||
|
height: 100%;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-warning {
|
||||||
|
padding: 1em 0.5em;
|
||||||
|
background-color: #444;
|
||||||
|
font-size: 1.2em;
|
||||||
|
}
|
||||||
+9
-24
@@ -25,7 +25,6 @@ body {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
font-family: 'Quicksand', sans-serif;
|
font-family: 'Quicksand', sans-serif;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*:focus-visible {
|
*:focus-visible {
|
||||||
@@ -59,19 +58,16 @@ body {
|
|||||||
|
|
||||||
.content {
|
.content {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 0;
|
||||||
top: 0;
|
|
||||||
|
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
|
|
||||||
transform: translate(-50%, -120%);
|
|
||||||
|
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|
||||||
min-width: 250px;
|
min-width: 250px;
|
||||||
|
|
||||||
background-color: gray;
|
background-color: #202020;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
border-radius: 0.5em;
|
border-radius: 0.5em;
|
||||||
@@ -79,25 +75,14 @@ body {
|
|||||||
transition: opacity 0.3s;
|
transition: opacity 0.3s;
|
||||||
padding: 0.25em;
|
padding: 0.25em;
|
||||||
|
|
||||||
&::after {
|
// @include smallScreen() {
|
||||||
content: '';
|
// right: 0;
|
||||||
position: absolute;
|
// left: 0;
|
||||||
top: 100%;
|
|
||||||
left: 50%;
|
|
||||||
margin-left: -5px;
|
|
||||||
border-width: 5px;
|
|
||||||
border-style: solid;
|
|
||||||
border-color: gray transparent transparent transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
@include smallScreen() {
|
// &::after {
|
||||||
right: 0;
|
// left: 75%;
|
||||||
left: 0;
|
// }
|
||||||
|
// }
|
||||||
&::after {
|
|
||||||
left: 75%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover > .content {
|
&:hover > .content {
|
||||||
|
|||||||
+177
-63
@@ -9,31 +9,33 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="scenery-wrapper" v-if="stationInfo" ref="card-wrapper">
|
<div class="scenery-wrapper" v-if="stationInfo" ref="card-wrapper">
|
||||||
<button
|
<div class="scenery-left">
|
||||||
v-if="!timetableOnly"
|
<div class="scenery-actions">
|
||||||
class="back-btn btn btn--image"
|
<button v-if="!timetableOnly" class="back-btn btn" :title="$t('scenery.return-btn')" @click="navigateTo('/')">
|
||||||
:title="$t('scenery.return-btn')"
|
|
||||||
@click="navigateTo('/')"
|
|
||||||
>
|
|
||||||
<img :src="icons.back" alt="Back to scenery" />
|
<img :src="icons.back" alt="Back to scenery" />
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
<button
|
|
||||||
v-if="!timetableOnly && store.region.id == 'eu' && stationInfo"
|
|
||||||
class="history-btn btn btn--image"
|
|
||||||
@click="
|
|
||||||
navigateTo('/journal/dispatchers', {
|
|
||||||
sceneryName: stationInfo?.name,
|
|
||||||
})
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<img :src="viewMode == 'history' ? icons.user : icons.history" alt="icon" />
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<SceneryHeader :station="stationInfo" />
|
<SceneryHeader :station="stationInfo" />
|
||||||
|
|
||||||
<SceneryInfo :station="stationInfo" :timetableOnly="timetableOnly" />
|
<SceneryInfo :station="stationInfo" :timetableOnly="timetableOnly" />
|
||||||
<SceneryTimetable :station="stationInfo" :timetableOnly="timetableOnly" />
|
</div>
|
||||||
|
|
||||||
|
<div class="scenery-right">
|
||||||
|
<div class="info-actions">
|
||||||
|
<button
|
||||||
|
v-for="viewMode in viewModes"
|
||||||
|
class="btn btn--option"
|
||||||
|
@click="setViewMode(viewMode.component)"
|
||||||
|
:data-checked="currentViewCompontent == viewMode.component"
|
||||||
|
>
|
||||||
|
{{ $t(viewMode.id) }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<keep-alive>
|
||||||
|
<component :is="currentViewCompontent" :station="stationInfo" :key="currentViewCompontent"></component>
|
||||||
|
</keep-alive>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -41,34 +43,69 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import SceneryInfo from '@/components/SceneryView/SceneryInfo.vue';
|
import SceneryInfo from '@/components/SceneryView/SceneryInfo.vue';
|
||||||
import SceneryTimetable from '@/components/SceneryView/SceneryTimetable.vue';
|
import SceneryTimetable from '@/components/SceneryView/SceneryTimetable.vue';
|
||||||
|
import SceneryTimetablesHistory from '../components/SceneryView/SceneryTimetablesHistory.vue';
|
||||||
|
import SceneryDispatchersHistory from '@/components/SceneryView/SceneryDispatchersHistory.vue';
|
||||||
import SceneryHeader from '@/components/SceneryView/SceneryHeader.vue';
|
import SceneryHeader from '@/components/SceneryView/SceneryHeader.vue';
|
||||||
|
|
||||||
import ActionButton from '@/components/Global/ActionButton.vue';
|
import ActionButton from '@/components/Global/ActionButton.vue';
|
||||||
|
|
||||||
import { computed, defineComponent } from '@vue/runtime-core';
|
import { computed, defineComponent, ref } from '@vue/runtime-core';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import { useStore } from '@/store/store';
|
import { useStore } from '@/store/store';
|
||||||
import routerMixin from '@/mixins/routerMixin';
|
import routerMixin from '@/mixins/routerMixin';
|
||||||
|
|
||||||
|
enum SceneryViewMode {
|
||||||
|
'TIMETABLES_ACTIVE',
|
||||||
|
'TIMETABLES_HISTORY',
|
||||||
|
'SCENERY_HISTORY',
|
||||||
|
}
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { SceneryInfo, SceneryTimetable, ActionButton, SceneryHeader },
|
components: {
|
||||||
|
SceneryInfo,
|
||||||
|
SceneryTimetable,
|
||||||
|
ActionButton,
|
||||||
|
SceneryHeader,
|
||||||
|
SceneryTimetablesHistory,
|
||||||
|
SceneryDispatchersHistory,
|
||||||
|
},
|
||||||
|
|
||||||
mixins: [routerMixin],
|
mixins: [routerMixin],
|
||||||
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
icons: {
|
icons: {
|
||||||
history: require('@/assets/icon-history.svg'),
|
|
||||||
user: require('@/assets/icon-user.svg'),
|
user: require('@/assets/icon-user.svg'),
|
||||||
back: require('@/assets/icon-back.svg'),
|
back: require('@/assets/icon-back.svg'),
|
||||||
},
|
},
|
||||||
|
|
||||||
viewMode: 'info',
|
viewModes: [
|
||||||
|
{
|
||||||
|
id: 'scenery.option-active-timetables',
|
||||||
|
component: 'SceneryTimetable',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'scenery.option-timetables-history',
|
||||||
|
component: 'SceneryTimetablesHistory',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'scenery.option-dispatchers-history',
|
||||||
|
component: 'SceneryDispatchersHistory',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
sceneryViewMode: SceneryViewMode,
|
||||||
|
|
||||||
|
selectedCheckpoint: '',
|
||||||
|
|
||||||
|
currentViewCompontent: 'SceneryTimetable',
|
||||||
|
|
||||||
onlineFrom: -1,
|
onlineFrom: -1,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
activated() {},
|
activated() {
|
||||||
|
this.loadSelectedCheckpoint();
|
||||||
|
},
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
@@ -91,8 +128,19 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
setCardViewMode(mode: string) {
|
setViewMode(componentName: string) {
|
||||||
this.viewMode = mode;
|
this.currentViewCompontent = componentName;
|
||||||
|
},
|
||||||
|
|
||||||
|
loadSelectedCheckpoint() {
|
||||||
|
if (!this.stationInfo?.generalInfo?.checkpoints) return;
|
||||||
|
if (this.stationInfo.generalInfo.checkpoints.length == 0) return;
|
||||||
|
|
||||||
|
this.selectedCheckpoint = this.stationInfo.generalInfo.checkpoints[0].checkpointName;
|
||||||
|
},
|
||||||
|
|
||||||
|
selectCheckpoint(cp: { checkpointName: string }) {
|
||||||
|
this.selectedCheckpoint = cp.checkpointName;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -102,29 +150,18 @@ export default defineComponent({
|
|||||||
@import '../styles/responsive.scss';
|
@import '../styles/responsive.scss';
|
||||||
@import '../styles/variables.scss';
|
@import '../styles/variables.scss';
|
||||||
|
|
||||||
$sceneryBgCol: #333;
|
button.back-btn {
|
||||||
|
img {
|
||||||
.scenery-view-anim {
|
width: 2em;
|
||||||
&-enter-from,
|
|
||||||
&-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-enter-active {
|
|
||||||
transition: all 100ms ease-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-leave-active {
|
|
||||||
transition: all 100ms ease-out 100ms;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.scenery {
|
.scenery {
|
||||||
&-view {
|
&-view {
|
||||||
min-height: 550px;
|
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
|
min-height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-offline {
|
&-offline {
|
||||||
@@ -142,42 +179,119 @@ $sceneryBgCol: #333;
|
|||||||
margin: 1em auto;
|
margin: 1em auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.scenery-wrapper {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 4fr 5fr;
|
||||||
|
gap: 0 1em;
|
||||||
|
|
||||||
&-wrapper {
|
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 1100px;
|
max-width: 1700px;
|
||||||
|
|
||||||
@include midScreen {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
background: #292929;
|
|
||||||
padding: 1em;
|
|
||||||
margin: 1rem 0;
|
margin: 1rem 0;
|
||||||
|
|
||||||
border-radius: 1.5em;
|
|
||||||
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.scenery-left {
|
||||||
|
position: relative;
|
||||||
|
background-color: #181818;
|
||||||
|
padding: 1em 0.5em;
|
||||||
|
|
||||||
|
height: 95vh;
|
||||||
|
min-height: 550px;
|
||||||
|
max-height: 1000px;
|
||||||
|
|
||||||
|
overflow: auto;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
button.btn {
|
.scenery-right {
|
||||||
position: absolute;
|
background: #181818;
|
||||||
padding: 0.25em;
|
padding: 2em 0.5em;
|
||||||
|
|
||||||
top: 0.5em;
|
height: 95vh;
|
||||||
img {
|
min-height: 550px;
|
||||||
width: 2em;
|
max-height: 1000px;
|
||||||
|
|
||||||
|
display: grid;
|
||||||
|
grid-template-rows: auto 1fr;
|
||||||
|
gap: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scenery-actions {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-actions {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
margin: 0.5em;
|
||||||
|
padding: 0.5em;
|
||||||
|
box-shadow: 0 0 10px 4px #242424;
|
||||||
|
|
||||||
|
&[data-checked='true'] {
|
||||||
|
color: var(--clr-primary);
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
button.history-btn {
|
.timetable-checkpoints {
|
||||||
right: 0.5em;
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
flex-wrap: wrap;
|
||||||
|
font-size: 1.1em;
|
||||||
|
margin: 0.75em 0;
|
||||||
|
|
||||||
|
.checkpoint_item {
|
||||||
|
&.current {
|
||||||
|
font-weight: bold;
|
||||||
|
color: $accentCol;
|
||||||
}
|
}
|
||||||
|
|
||||||
button.back-btn {
|
&:not(:last-child)::after {
|
||||||
left: 0.5em;
|
margin: 0 0.5em;
|
||||||
|
content: '•';
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@include midScreen {
|
||||||
|
.scenery-wrapper {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
gap: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scenery-left {
|
||||||
|
border-radius: 1em;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scenery-right {
|
||||||
|
border-radius: 1em;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-actions {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@include smallScreen {
|
||||||
|
.scenery-left, .scenery-right {
|
||||||
|
max-height: 100vh;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user