mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 130732921b | |||
| 1b2cd34e86 | |||
| 17bda9e6e7 | |||
| c66ff8feed | |||
| 027cdee25a | |||
| 435cfb3b3f | |||
| 425241c8e7 | |||
| f24f961d52 | |||
| 4718eeeaaf | |||
| 931fd7b21b | |||
| bb79c5033a | |||
| ee290788dc | |||
| a87d1060d3 | |||
| 1804d6d0f0 | |||
| 77250e30c7 | |||
| c5aefd03b8 | |||
| 2ec4694bd3 | |||
| 729f66bcdb | |||
| b746843086 | |||
| cbbd06fecd | |||
| 11e99b6af0 |
@@ -22,6 +22,11 @@
|
||||
|
||||
<link rel="icon" href="favicon.ico" />
|
||||
|
||||
<link rel="stylesheet" href="fa/css/fontawesome.css" />
|
||||
<link rel="stylesheet" href="fa/css/brands.css" />
|
||||
<link rel="stylesheet" href="fa/css/regular.css" />
|
||||
<link rel="stylesheet" href="fa/css/solid.css" />
|
||||
|
||||
<!-- Static OpenGraph meta -->
|
||||
<meta name="description" content="Pomocnik maszynisty i dyżurnego symulatora Train Driver 2" />
|
||||
<meta property="og:url" content="https://stacjownik-td2.web.app/" />
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "stacjownik",
|
||||
"version": "1.28.3",
|
||||
"version": "1.28.7",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Vendored
+6243
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,19 @@
|
||||
/*!
|
||||
* Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
|
||||
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
||||
* Copyright 2024 Fonticons, Inc.
|
||||
*/
|
||||
:root, :host {
|
||||
--fa-style-family-classic: 'Font Awesome 6 Free';
|
||||
--fa-font-regular: normal 400 1em/1 'Font Awesome 6 Free'; }
|
||||
|
||||
@font-face {
|
||||
font-family: 'Font Awesome 6 Free';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: block;
|
||||
src: url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.ttf") format("truetype"); }
|
||||
|
||||
.far,
|
||||
.fa-regular {
|
||||
font-weight: 400; }
|
||||
@@ -0,0 +1,19 @@
|
||||
/*!
|
||||
* Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
|
||||
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
||||
* Copyright 2024 Fonticons, Inc.
|
||||
*/
|
||||
:root, :host {
|
||||
--fa-style-family-classic: 'Font Awesome 6 Free';
|
||||
--fa-font-solid: normal 900 1em/1 'Font Awesome 6 Free'; }
|
||||
|
||||
@font-face {
|
||||
font-family: 'Font Awesome 6 Free';
|
||||
font-style: normal;
|
||||
font-weight: 900;
|
||||
font-display: block;
|
||||
src: url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.ttf") format("truetype"); }
|
||||
|
||||
.fas,
|
||||
.fa-solid {
|
||||
font-weight: 900; }
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 18 KiB |
@@ -18,7 +18,12 @@
|
||||
|
||||
<span class="header_brand">
|
||||
<router-link to="/">
|
||||
<img src="/images/stacjownik-header-logo.svg" alt="Stacjownik" />
|
||||
<img
|
||||
v-if="isChristmas"
|
||||
src="/images/stacjownik-header-logo-christmas.svg"
|
||||
alt="Stacjownik logo (christmas)"
|
||||
/>
|
||||
<img v-else src="/images/stacjownik-header-logo.svg" alt="Stacjownik logo" />
|
||||
</router-link>
|
||||
</span>
|
||||
|
||||
@@ -69,7 +74,10 @@ import Clock from './Clock.vue';
|
||||
import RegionDropdown from '../Global/RegionDropdown.vue';
|
||||
|
||||
export default defineComponent({
|
||||
components: { StatusIndicator, Clock, RegionDropdown },
|
||||
|
||||
emits: ['changeLang'],
|
||||
|
||||
props: {
|
||||
currentLang: {
|
||||
type: String,
|
||||
@@ -98,9 +106,14 @@ export default defineComponent({
|
||||
return this.store.activeSceneryList.filter(
|
||||
(scenery) => scenery.region == this.store.region.id && scenery.dispatcherId != -1
|
||||
).length;
|
||||
},
|
||||
|
||||
isChristmas() {
|
||||
const date = new Date();
|
||||
|
||||
return date.getUTCMonth() == 11 && date.getUTCDate() >= 20 && date.getUTCDate() <= 31;
|
||||
}
|
||||
},
|
||||
components: { StatusIndicator, Clock, RegionDropdown }
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="stock-dangers" v-if="timetable.twr || timetable.skr">
|
||||
<div class="stock-dangers" v-if="timetable.warningNotes">
|
||||
<div class="g-separator"></div>
|
||||
|
||||
<b>{{ $t('journal.stock-dangers') }}:</b>
|
||||
@@ -95,7 +95,11 @@
|
||||
<div class="g-separator"></div>
|
||||
<b>{{ $t('journal.stock-preview') }}:</b>
|
||||
|
||||
<div class="stock-history" v-if="stockHistory.length > 1">
|
||||
<div class="stock-history">
|
||||
<button class="btn btn--action" @click="copyStockToClipboard()">
|
||||
<i class="fa-regular fa-copy"></i> {{ $t('journal.stock-copy') }}
|
||||
</button>
|
||||
|
||||
<button
|
||||
v-for="(sh, i) in stockHistory"
|
||||
:key="i"
|
||||
@@ -128,6 +132,7 @@ import StockList from '../../Global/StockList.vue';
|
||||
import { API } from '../../../typings/api';
|
||||
import { RouteLocationRaw } from 'vue-router';
|
||||
import EntryStops from './EntryStops.vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
export default defineComponent({
|
||||
components: { StockList, EntryStops },
|
||||
@@ -146,7 +151,8 @@ export default defineComponent({
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
currentHistoryIndex: 0
|
||||
currentHistoryIndex: 0,
|
||||
i18n: useI18n()
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -167,6 +173,7 @@ export default defineComponent({
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
driverRouteLocation(): RouteLocationRaw | null {
|
||||
if (this.timetable.terminated) return null;
|
||||
return {
|
||||
@@ -185,6 +192,25 @@ export default defineComponent({
|
||||
|
||||
toggleExtraInfo() {
|
||||
this.$emit('toggleExtraInfo', this.timetable.id);
|
||||
},
|
||||
|
||||
copyStockToClipboard() {
|
||||
const currentStockString =
|
||||
this.stockHistory[this.currentHistoryIndex]?.stockString ?? this.timetable.stockString;
|
||||
|
||||
if (!currentStockString) {
|
||||
alert(this.i18n.t('journal.stock-clipboard-failure'));
|
||||
return;
|
||||
}
|
||||
|
||||
navigator.clipboard
|
||||
.writeText(currentStockString)
|
||||
.then(() => {
|
||||
prompt(this.i18n.t('journal.stock-clipboard-success'), currentStockString);
|
||||
})
|
||||
.catch(() => {
|
||||
alert(this.i18n.t('journal.stock-clipboard-failure'));
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
>
|
||||
</span>
|
||||
|
||||
<span class="text--grayed" v-if="timetable.currentSceneryName">
|
||||
<span class="entry-location" v-if="timetable.currentSceneryName">
|
||||
<b>
|
||||
{{ $t(`journal.${timetable.terminated ? 'last-seen-at' : 'currently-at'}`) }}
|
||||
{{ timetable.currentSceneryName.replace(/.[a-zA-Z0-9]+.sc/, '') }}
|
||||
@@ -71,4 +71,9 @@ export default defineComponent({
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.entry-location {
|
||||
text-align: center;
|
||||
color: #ccc;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -221,6 +221,10 @@ export default defineComponent({
|
||||
.stop-name {
|
||||
font-weight: bold;
|
||||
color: #ccc;
|
||||
|
||||
i {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.stop-date {
|
||||
|
||||
@@ -19,8 +19,25 @@
|
||||
:data-status="status"
|
||||
>
|
||||
<router-link :to="train.driverRouteLocation" class="a-block">
|
||||
<span class="user_train">{{ train.trainNo }}</span>
|
||||
<span class="user_name">{{ train.driverName }}</span>
|
||||
<span class="user_train"> {{ train.trainNo }}</span>
|
||||
<span class="user_name">
|
||||
{{ train.driverName }}
|
||||
<i
|
||||
v-if="train.timetableData != undefined && train.lastSeen <= Date.now() - 120000"
|
||||
class="fa-solid fa-user-slash"
|
||||
style="color: lightcoral"
|
||||
data-tooltip-type="BaseTooltip"
|
||||
:data-tooltip-content="$t('app.tooltip-driver-offline')"
|
||||
></i>
|
||||
|
||||
<i
|
||||
v-if="train.currentStationName.indexOf('.sc') != -1"
|
||||
class="fa-solid fa-ban"
|
||||
style="color: lightcoral"
|
||||
data-tooltip-type="BaseTooltip"
|
||||
:data-tooltip-content="$t('app.tooltip-scenery-offline')"
|
||||
></i>
|
||||
</span>
|
||||
</router-link>
|
||||
</li>
|
||||
</transition-group>
|
||||
@@ -66,8 +83,13 @@ export default defineComponent({
|
||||
this.station?.generalInfo?.checkpoints.includes(stop.stopNameRAW)
|
||||
);
|
||||
|
||||
const sceneryName =
|
||||
train.currentStationName.indexOf('.sc') != -1
|
||||
? train.currentStationName.split(' ').slice(0, -1).join(' ')
|
||||
: train.currentStationName;
|
||||
|
||||
const status = stop
|
||||
? getTrainStopStatus(stop, train.currentStationName, this.onlineScenery!.name)
|
||||
? getTrainStopStatus(stop, sceneryName, this.onlineScenery!.name)
|
||||
: 'no-timetable';
|
||||
|
||||
return {
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<template>
|
||||
<div class="tooltip-content">
|
||||
<div class="image-box">
|
||||
<div v-if="imageState == 'loading'" class="loading-info">
|
||||
{{ $t('vehicle-preview.loading') }}
|
||||
</div>
|
||||
|
||||
<div v-if="imageState == 'error'" class="loading-info">{{ $t('vehicle-preview.error') }}</div>
|
||||
<Loading v-if="imageState == 'loading'" class="loading-info" />
|
||||
|
||||
<img
|
||||
v-if="tooltipStore.type"
|
||||
@@ -34,8 +30,11 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import { useTooltipStore } from '../../store/tooltipStore';
|
||||
import { useApiStore } from '../../store/apiStore';
|
||||
import Loading from '../Global/Loading.vue';
|
||||
|
||||
export default defineComponent({
|
||||
components: { Loading },
|
||||
|
||||
data() {
|
||||
return {
|
||||
tooltipStore: useTooltipStore(),
|
||||
@@ -60,9 +59,12 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
onImageError(e: Event) {
|
||||
if (!e.target || !(e.target instanceof HTMLImageElement) || this.imageState == 'error')
|
||||
return;
|
||||
|
||||
this.imageState = 'error';
|
||||
|
||||
(e.target as HTMLElement).style.display = 'none';
|
||||
e.target.src = '/images/no-vehicle-image.png';
|
||||
}
|
||||
},
|
||||
|
||||
@@ -99,14 +101,13 @@ export default defineComponent({
|
||||
|
||||
.image-box {
|
||||
position: relative;
|
||||
min-height: 150px;
|
||||
min-height: 170px;
|
||||
}
|
||||
|
||||
.loading-info {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
font-size: 1.15em;
|
||||
top: 35%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,19 @@
|
||||
:data-minor="stop.isSBL || (stop.nameRaw.endsWith(', po') && !stop.duration)"
|
||||
>
|
||||
<router-link v-if="/(, podg$|<strong>)/.test(stop.nameHtml)" :to="sceneryHref">
|
||||
<span class="stop-name" v-html="stop.nameHtml"></span>
|
||||
<b class="stop-name"
|
||||
><i
|
||||
v-if="!stop.isSceneryOnline"
|
||||
class="fa-solid fa-ban"
|
||||
data-tooltip-type="BaseTooltip"
|
||||
:data-tooltip-content="$t('app.tooltip-scenery-offline')"
|
||||
style="margin-right: 0.25rem; color: salmon"
|
||||
></i>
|
||||
{{ stop.nameRaw }}
|
||||
</b>
|
||||
</router-link>
|
||||
|
||||
<span v-else class="stop-name" v-html="stop.nameHtml"></span>
|
||||
<span v-else class="stop-name">{{ stop.nameRaw }}</span>
|
||||
|
||||
<span
|
||||
v-if="stop.position != 'begin'"
|
||||
@@ -139,6 +148,10 @@ s {
|
||||
color: #aaa;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
i {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.stop {
|
||||
|
||||
@@ -1,203 +1,183 @@
|
||||
<template>
|
||||
<div class="train-info" :data-extended="extended">
|
||||
<section class="train-general">
|
||||
<div class="general-top-bar">
|
||||
<div class="top-bar-header">
|
||||
<b class="warning-timeout" v-if="train.isTimeout" :title="$t('trains.timeout')">?</b>
|
||||
<span class="timetable-id" v-if="train.timetableData">
|
||||
#{{ train.timetableData.timetableId }}
|
||||
</span>
|
||||
<div class="general-top-bar">
|
||||
<div class="top-bar-header">
|
||||
<b class="warning-timeout" v-if="train.isTimeout" :title="$t('trains.timeout')">?</b>
|
||||
<span class="timetable-id" v-if="train.timetableData">
|
||||
#{{ train.timetableData.timetableId }}
|
||||
</span>
|
||||
|
||||
<span
|
||||
class="train-badge twr"
|
||||
v-if="train.timetableData?.TWR"
|
||||
data-tooltip-type="BaseTooltip"
|
||||
:data-tooltip-content="$t('warnings.TWR')"
|
||||
>
|
||||
TWR
|
||||
</span>
|
||||
<span
|
||||
class="train-badge twr"
|
||||
v-if="train.timetableData?.TWR"
|
||||
data-tooltip-type="BaseTooltip"
|
||||
:data-tooltip-content="$t('warnings.TWR')"
|
||||
>
|
||||
TWR
|
||||
</span>
|
||||
|
||||
<span
|
||||
class="train-badge tn"
|
||||
v-if="train.timetableData?.hasDangerousCargo"
|
||||
data-tooltip-type="BaseTooltip"
|
||||
:data-tooltip-content="$t('warnings.TN')"
|
||||
>
|
||||
TN
|
||||
</span>
|
||||
<span
|
||||
class="train-badge tn"
|
||||
v-if="train.timetableData?.hasDangerousCargo"
|
||||
data-tooltip-type="BaseTooltip"
|
||||
:data-tooltip-content="$t('warnings.TN')"
|
||||
>
|
||||
TN
|
||||
</span>
|
||||
|
||||
<span
|
||||
class="train-badge pn"
|
||||
v-if="train.timetableData?.hasExtraDeliveries"
|
||||
data-tooltip-type="BaseTooltip"
|
||||
:data-tooltip-content="$t('warnings.PN')"
|
||||
>
|
||||
PN
|
||||
</span>
|
||||
<span
|
||||
class="train-badge pn"
|
||||
v-if="train.timetableData?.hasExtraDeliveries"
|
||||
data-tooltip-type="BaseTooltip"
|
||||
:data-tooltip-content="$t('warnings.PN')"
|
||||
>
|
||||
PN
|
||||
</span>
|
||||
|
||||
<b
|
||||
v-if="train.timetableData"
|
||||
data-tooltip-type="BaseTooltip"
|
||||
:data-tooltip-content="getCategoryExplanation(train.timetableData.category)"
|
||||
class="text--primary tooltip-help"
|
||||
>
|
||||
{{ train.timetableData.category }}
|
||||
</b>
|
||||
|
||||
<b class="train-number">{{ train.trainNo }}</b>
|
||||
|
||||
<span>•</span>
|
||||
|
||||
<div class="train-driver">
|
||||
<b
|
||||
v-if="train.timetableData"
|
||||
data-tooltip-type="BaseTooltip"
|
||||
:data-tooltip-content="getCategoryExplanation(train.timetableData.category)"
|
||||
class="text--primary tooltip-help"
|
||||
class="level-badge driver"
|
||||
:style="calculateExpStyle(train.driverLevel, train.isSupporter)"
|
||||
>
|
||||
{{ train.timetableData.category }}
|
||||
{{ train.driverLevel < 2 ? 'L' : `${train.driverLevel}` }}
|
||||
</b>
|
||||
|
||||
<b class="train-number">{{ train.trainNo }}</b>
|
||||
<b
|
||||
v-if="apiStore.donatorsData.includes(train.driverName)"
|
||||
data-tooltip-type="DonatorTooltip"
|
||||
:data-tooltip-content="$t('donations.driver-message')"
|
||||
>
|
||||
{{ train.driverName }}
|
||||
<img src="/images/icon-diamond.svg" alt="donator diamond icon" />
|
||||
</b>
|
||||
|
||||
<span>•</span>
|
||||
|
||||
<div class="train-driver">
|
||||
<b
|
||||
class="level-badge driver"
|
||||
:style="calculateExpStyle(train.driverLevel, train.isSupporter)"
|
||||
>
|
||||
{{ train.driverLevel < 2 ? 'L' : `${train.driverLevel}` }}
|
||||
</b>
|
||||
|
||||
<b
|
||||
v-if="apiStore.donatorsData.includes(train.driverName)"
|
||||
data-tooltip-type="DonatorTooltip"
|
||||
:data-tooltip-content="$t('donations.driver-message')"
|
||||
>
|
||||
{{ train.driverName }}
|
||||
<img src="/images/icon-diamond.svg" alt="donator diamond icon" />
|
||||
</b>
|
||||
|
||||
<span v-else>{{ train.driverName }}</span>
|
||||
</div>
|
||||
<span v-else>{{ train.driverName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="general-timetable" v-if="train.timetableData">
|
||||
<strong>{{ train.timetableData.route.replace('|', ' - ') }}</strong>
|
||||
<span
|
||||
v-if="getSceneriesWithComments(train.timetableData).length > 0"
|
||||
data-tooltip-type="BaseTooltip"
|
||||
:data-tooltip-content="`${$t('trains.timetable-comments')} (${getSceneriesWithComments(
|
||||
train.timetableData
|
||||
)})`"
|
||||
>
|
||||
<img class="image-warning" src="/images/icon-warning.svg" />
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<hr style="margin: 0.25em 0" />
|
||||
|
||||
<div class="general-stops" v-if="train.timetableData">
|
||||
<span v-if="train.timetableData.followingStops.length > 2">
|
||||
{{ $t('trains.via-title') }}
|
||||
<span v-html="getTrainStopsHtml(train.timetableData.followingStops)"></span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="general-status">
|
||||
<div class="status-timetable-progress" v-if="train.timetableData">
|
||||
<ProgressBar :progressPercent="confirmedPercentage(train.timetableData.followingStops)" />
|
||||
|
||||
<span class="progress-distance">
|
||||
<span>{{ currentDistance(train.timetableData.followingStops) }} km</span>
|
||||
<span>/</span>
|
||||
<span class="text--primary">{{ train.timetableData.routeDistance }} km </span>
|
||||
<span>|</span>
|
||||
<span v-html="currentDelay(train.timetableData.followingStops)"></span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="status-badges">
|
||||
<div v-if="!train.currentStationHash" class="train-badge offline">
|
||||
<img src="/images/icon-offline.svg" alt="offline train icon" />
|
||||
{{ $t('trains.scenery-offline') }}
|
||||
</div>
|
||||
|
||||
<div v-if="!train.online" class="train-badge offline">
|
||||
<img src="/images/icon-offline.svg" alt="offline train icon" />
|
||||
Offline {{ lastSeenMessage(train.lastSeen) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="general-stats" v-if="extended">
|
||||
<div>
|
||||
<img src="/images/icon-length.svg" alt="length icon" />
|
||||
{{ train.length }}m
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<img src="/images/icon-mass.svg" alt="mass icon" />
|
||||
{{ (train.mass / 1000).toFixed(1) }}t
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<img src="/images/icon-speed.svg" alt="speed icon" />
|
||||
{{ train.speed }} km/h
|
||||
|
||||
<span v-if="stockSpeedLimit != Infinity">
|
||||
•
|
||||
<em
|
||||
class="text--grayed"
|
||||
style="text-decoration: underline dotted"
|
||||
tabindex="0"
|
||||
:data-tooltip="$t('trains.vmax-tooltip')"
|
||||
>
|
||||
{{ stockSpeedLimit }} km/h
|
||||
</em>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text--grayed" style="margin-top: 0.25em">
|
||||
{{ displayTrainPosition(train) }}
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="train-dangers"
|
||||
v-if="extended && train.timetableData && train.timetableData.warningNotes"
|
||||
<div class="general-timetable" v-if="train.timetableData">
|
||||
<strong>{{ train.timetableData.route.replace('|', ' - ') }}</strong>
|
||||
<span
|
||||
v-if="getSceneriesWithComments(train.timetableData).length > 0"
|
||||
data-tooltip-type="BaseTooltip"
|
||||
:data-tooltip-content="`${$t('trains.timetable-comments')} (${getSceneriesWithComments(
|
||||
train.timetableData
|
||||
)})`"
|
||||
>
|
||||
<div class="dangers-badges">
|
||||
<div v-if="train.timetableData?.TWR">
|
||||
<div class="train-badge twr">TWR</div>
|
||||
- {{ $t('warnings.TWR') }}
|
||||
</div>
|
||||
<img class="image-warning" src="/images/icon-warning.svg" />
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div v-if="train.timetableData?.hasDangerousCargo">
|
||||
<div class="train-badge tn">TN</div>
|
||||
- {{ $t('warnings.TN') }}
|
||||
</div>
|
||||
<hr style="margin: 0.25em 0" />
|
||||
|
||||
<div v-if="train.timetableData?.hasExtraDeliveries">
|
||||
<div class="train-badge pn">PN</div>
|
||||
- {{ $t('warnings.PN') }}
|
||||
</div>
|
||||
<div class="general-stops" v-if="train.timetableData">
|
||||
<span v-if="train.timetableData.followingStops.length > 2">
|
||||
{{ $t('trains.via-title') }}
|
||||
<span v-html="getTrainStopsHtml(train.timetableData.followingStops)"></span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="general-status">
|
||||
<div class="status-timetable-progress" v-if="train.timetableData">
|
||||
<ProgressBar :progressPercent="confirmedPercentage(train.timetableData.followingStops)" />
|
||||
|
||||
<span class="progress-distance">
|
||||
<span>{{ currentDistance(train.timetableData.followingStops) }} km</span>
|
||||
<span>/</span>
|
||||
<span class="text--primary">{{ train.timetableData.routeDistance }} km </span>
|
||||
<span>|</span>
|
||||
<span v-html="currentDelay(train.timetableData.followingStops)"></span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="status-badges">
|
||||
<div v-if="!train.currentStationHash" class="train-badge offline">
|
||||
<i class="fa-solid fa-ban"></i>
|
||||
{{ $t('trains.scenery-offline') }}
|
||||
</div>
|
||||
|
||||
<div class="dangers-notes">
|
||||
<h4>{{ $t('warnings.header-title') }}</h4>
|
||||
<p>
|
||||
<i>{{ train.timetableData?.warningNotes }}</i>
|
||||
</p>
|
||||
<div v-if="!train.online" class="train-badge offline">
|
||||
<i class="fa-solid fa-user-slash"></i>
|
||||
Offline {{ lastSeenMessage(train.lastSeen) }}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<section class="train-stats" v-if="!extended">
|
||||
<StockList :trainStockList="train.stockList" :tractionOnly="true" />
|
||||
<div class="general-stats" v-if="extended">
|
||||
<div>
|
||||
<img src="/images/icon-length.svg" alt="length icon" />
|
||||
{{ train.length }}m
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span>{{ train.speed }}km/h</span>
|
||||
<img src="/images/icon-mass.svg" alt="mass icon" />
|
||||
{{ (train.mass / 1000).toFixed(1) }}t
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span> {{ train.length }}m</span>
|
||||
<div>
|
||||
<img src="/images/icon-speed.svg" alt="speed icon" />
|
||||
{{ train.speed }} km/h
|
||||
|
||||
<span v-if="stockSpeedLimit != Infinity">
|
||||
•
|
||||
<span> {{ (train.mass / 1000).toFixed(1) }}t</span>
|
||||
<span v-if="train.stockList.length > 1">
|
||||
•
|
||||
{{ $t('trains.cars') }}: {{ train.stockList.length - 1 }}
|
||||
</span>
|
||||
<em
|
||||
class="text--grayed"
|
||||
style="text-decoration: underline dotted"
|
||||
tabindex="0"
|
||||
:data-tooltip="$t('trains.vmax-tooltip')"
|
||||
>
|
||||
{{ stockSpeedLimit }} km/h
|
||||
</em>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text--grayed" style="margin-top: 0.25em">
|
||||
{{ displayTrainPosition(train) }}
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="train-dangers"
|
||||
v-if="extended && train.timetableData && train.timetableData.warningNotes"
|
||||
>
|
||||
<div class="dangers-badges">
|
||||
<div v-if="train.timetableData?.TWR">
|
||||
<div class="train-badge twr">TWR</div>
|
||||
- {{ $t('warnings.TWR') }}
|
||||
</div>
|
||||
|
||||
<div v-if="train.timetableData?.hasDangerousCargo">
|
||||
<div class="train-badge tn">TN</div>
|
||||
- {{ $t('warnings.TN') }}
|
||||
</div>
|
||||
|
||||
<div v-if="train.timetableData?.hasExtraDeliveries">
|
||||
<div class="train-badge pn">PN</div>
|
||||
- {{ $t('warnings.PN') }}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="dangers-notes">
|
||||
<h4>{{ $t('warnings.header-title') }}</h4>
|
||||
<p>
|
||||
<i>{{ train.timetableData?.warningNotes }}</i>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -256,7 +236,6 @@ export default defineComponent({
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '../../styles/responsive.scss';
|
||||
@import '../../styles/badge.scss';
|
||||
|
||||
.image-warning {
|
||||
@@ -265,17 +244,6 @@ export default defineComponent({
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.train-stats {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
.train-dangers {
|
||||
margin-top: 0.5em;
|
||||
}
|
||||
@@ -299,15 +267,9 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
.train-info {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr;
|
||||
grid-template-rows: 1fr;
|
||||
|
||||
&[data-extended='true'] {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
padding: 1em;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25em;
|
||||
|
||||
background-color: #1a1a1a;
|
||||
gap: 0.5em;
|
||||
@@ -337,12 +299,6 @@ export default defineComponent({
|
||||
padding: 0 0.25em;
|
||||
}
|
||||
|
||||
.train-general {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25em;
|
||||
}
|
||||
|
||||
.general-stops {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
@@ -419,11 +375,4 @@ export default defineComponent({
|
||||
display: flex;
|
||||
gap: 0.25em;
|
||||
}
|
||||
|
||||
@include smallScreen() {
|
||||
.train-info {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 1em 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<template>
|
||||
<div class="train-schedule" @click="toggleShowState">
|
||||
<StockList :trainStockList="train.stockList" />
|
||||
|
||||
<div class="train-schedule">
|
||||
<div class="schedule-wrapper" v-if="train.timetableData">
|
||||
<div class="stops">
|
||||
<div
|
||||
@@ -136,7 +134,7 @@ import StopLabel from './StopLabel.vue';
|
||||
import StockList from '../Global/StockList.vue';
|
||||
import { useMainStore } from '../../store/mainStore';
|
||||
import { useApiStore } from '../../store/apiStore';
|
||||
import { StationRoutesInfo, Train } from '../../typings/common';
|
||||
import { Train } from '../../typings/common';
|
||||
import { TrainScheduleStop } from './typings';
|
||||
|
||||
export default defineComponent({
|
||||
@@ -175,6 +173,10 @@ export default defineComponent({
|
||||
const sceneryName = timetablePath[currentPathIndex].stationName;
|
||||
const sceneryInfo = this.apiStore.sceneryData.find((st) => st.name == sceneryName);
|
||||
|
||||
const isSceneryOnline =
|
||||
(this.apiStore.activeData?.activeSceneries?.find((sc) => sc.stationName == sceneryName)
|
||||
?.isOnline ?? 0) == 1;
|
||||
|
||||
const arrivalLineInfo = sceneryInfo?.routesInfo.find(
|
||||
(r) => r.routeName == stop.arrivalLine
|
||||
);
|
||||
@@ -216,8 +218,10 @@ export default defineComponent({
|
||||
isLastConfirmed: this.lastConfirmed === i && !stop.terminatesHere,
|
||||
isSBL: /sbl/gi.test(stop.stopName),
|
||||
position: stop.beginsHere ? 'begin' : stop.terminatesHere ? 'end' : 'en-route',
|
||||
status: stop.confirmed ? 'confirmed' : stop.stopped ? 'stopped' : 'unconfirmed',
|
||||
|
||||
sceneryName,
|
||||
status: stop.confirmed ? 'confirmed' : stop.stopped ? 'stopped' : 'unconfirmed'
|
||||
isSceneryOnline
|
||||
};
|
||||
}) ?? []
|
||||
);
|
||||
@@ -252,12 +256,6 @@ export default defineComponent({
|
||||
|
||||
return activeMinorStopList;
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
toggleShowState() {
|
||||
this.$emit('click');
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -281,10 +279,6 @@ $blinkAnim: 0.5s ease-in-out alternate infinite blink;
|
||||
}
|
||||
}
|
||||
|
||||
.train-schedule {
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
.schedule-wrapper {
|
||||
overflow-y: auto;
|
||||
width: 100%;
|
||||
|
||||
@@ -249,7 +249,6 @@ h3 {
|
||||
}
|
||||
|
||||
@include smallScreen {
|
||||
h1,
|
||||
.no-data {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@@ -13,15 +13,7 @@
|
||||
</div>
|
||||
|
||||
<transition-group name="list-anim" tag="ul">
|
||||
<li
|
||||
class="train-row"
|
||||
v-for="train in trains"
|
||||
:key="train.id"
|
||||
>
|
||||
<router-link class="a-block" :to="train.driverRouteLocation">
|
||||
<TrainInfo :train="train" :extended="false" />
|
||||
</router-link>
|
||||
</li>
|
||||
<TrainTableItem v-for="train in trains" :key="train.id" :train="train" />
|
||||
</transition-group>
|
||||
</div>
|
||||
</transition>
|
||||
@@ -30,13 +22,15 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, inject, PropType, Ref } from 'vue';
|
||||
import { useMainStore } from '../../store/mainStore';
|
||||
import Loading from '../Global/Loading.vue';
|
||||
import TrainInfo from './TrainInfo.vue';
|
||||
import { Status, Train } from '../../typings/common';
|
||||
import { useApiStore } from '../../store/apiStore';
|
||||
import { Status, Train } from '../../typings/common';
|
||||
|
||||
import Loading from '../Global/Loading.vue';
|
||||
import TrainTableItem from './TrainTableItem.vue';
|
||||
import TrainInfo from './TrainInfo.vue';
|
||||
|
||||
export default defineComponent({
|
||||
components: { Loading, TrainInfo },
|
||||
components: { Loading, TrainInfo, TrainTableItem },
|
||||
|
||||
props: {
|
||||
trains: {
|
||||
@@ -99,9 +93,5 @@ export default defineComponent({
|
||||
background: #1a1a1a;
|
||||
}
|
||||
|
||||
li.train-row {
|
||||
background-color: var(--clr-secondary);
|
||||
margin-bottom: 1em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<li class="train-item">
|
||||
<router-link class="a-block" :to="train.driverRouteLocation">
|
||||
<div class="item-wrapper">
|
||||
<TrainInfo :train="train" />
|
||||
|
||||
<div class="train-stats">
|
||||
<StockList :trainStockList="train.stockList" :tractionOnly="true" />
|
||||
|
||||
<div>
|
||||
<span>{{ train.speed }}km/h</span>
|
||||
|
||||
<div>
|
||||
<span> {{ train.length }}m</span>
|
||||
•
|
||||
<span> {{ (train.mass / 1000).toFixed(1) }}t</span>
|
||||
<span v-if="train.stockList.length > 1">
|
||||
•
|
||||
{{ $t('trains.cars') }}: {{ train.stockList.length - 1 }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</router-link>
|
||||
</li>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { PropType } from 'vue';
|
||||
import { Train } from '../../typings/common';
|
||||
import TrainInfo from './TrainInfo.vue';
|
||||
import StockList from '../Global/StockList.vue';
|
||||
|
||||
defineProps({
|
||||
train: {
|
||||
type: Object as PropType<Train>,
|
||||
required: true
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '../../styles/responsive.scss';
|
||||
|
||||
.train-item {
|
||||
background-color: #1a1a1a;
|
||||
margin-bottom: 1em;
|
||||
width: 100%;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
.item-wrapper {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr;
|
||||
grid-template-rows: 1fr;
|
||||
}
|
||||
|
||||
.train-stats {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
@include smallScreen() {
|
||||
.item-wrapper {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 1em 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -151,6 +151,8 @@ export interface TrainScheduleStop {
|
||||
isSBL: boolean;
|
||||
|
||||
sceneryName: string | null;
|
||||
isSceneryOnline: boolean;
|
||||
|
||||
distance: number;
|
||||
|
||||
arrivalLine: string | null;
|
||||
|
||||
+11
-2
@@ -48,7 +48,9 @@
|
||||
"no-result": "No results for current search!",
|
||||
"migration-warning": "Stacjownik services will be unavailable 2/06/2022 between 1-3am (CEST time) due to the migration of API hostings!",
|
||||
"migration-confirm": "Roger that!",
|
||||
"offline": "App is in the offline mode!"
|
||||
"offline": "App is in the offline mode!",
|
||||
"tooltip-driver-offline": "Driver is offline",
|
||||
"tooltip-scenery-offline": "Scenery is offline"
|
||||
},
|
||||
"footer": {
|
||||
"discord": "Stacjownik Discord server"
|
||||
@@ -423,7 +425,11 @@
|
||||
"driver-not-found-desc-2": "You can browse timetable history in the",
|
||||
"driver-not-found-journal": "TIMETABLES JOURNAL",
|
||||
"driver-not-found-others": "Player {driver} is online as:",
|
||||
"driver-not-found-return": "GO BACK TO THE MAIN SITE"
|
||||
"driver-not-found-return": "GO BACK TO THE MAIN SITE",
|
||||
|
||||
"stock-copy": "COPY THE STOCK",
|
||||
"stock-clipboard-success": "Successfully copied the railway stock in a text form to your clipboard!",
|
||||
"stock-clipboard-failure": "Oops! Something happened and the railway stock couldn't be copied to your clipboard! :/"
|
||||
},
|
||||
"train-stats": {
|
||||
"stats-button": "STATISTICS",
|
||||
@@ -478,6 +484,9 @@
|
||||
|
||||
"stock-dangers": "ADDITIONAL NOTES",
|
||||
"stock-preview": "STOCK PREVIEW",
|
||||
"stock-copy": "COPY THE STOCK",
|
||||
"stock-clipboard-success": "Successfully copied the railway stock in a text form to your clipboard:",
|
||||
"stock-clipboard-failure": "Oops! Something happened and the railway stock couldn't be copied to your clipboard! :/",
|
||||
|
||||
"load-data": "Load further data...",
|
||||
|
||||
|
||||
+12
-3
@@ -21,7 +21,7 @@
|
||||
"driver-message": "Maszynista wspierający projekt Stacjownika!"
|
||||
},
|
||||
"warnings": {
|
||||
"TWR": "Pociąg z towarami niebezpiecznie wysokiego ryzyka",
|
||||
"TWR": "Pociąg z towarami niebezpiecznymi wysokiego ryzyka",
|
||||
"SKR": "Pociąg z przekroczoną skrajnią",
|
||||
"PN": "Pociąg z przesyłkami nadzwyczajnymi",
|
||||
"TN": "Pociąg z towarami niebezpiecznymi",
|
||||
@@ -45,7 +45,9 @@
|
||||
"loading": "Pobieranie danych...",
|
||||
"error": "Wystąpił problem z załadowaniem danych!",
|
||||
"no-result": "Brak wyników o podanych kryteriach!",
|
||||
"offline": "Aplikacja w trybie offline!"
|
||||
"offline": "Aplikacja w trybie offline!",
|
||||
"tooltip-driver-offline": "Maszynista offline",
|
||||
"tooltip-scenery-offline": "Sceneria offline"
|
||||
},
|
||||
"footer": {
|
||||
"discord": "Serwer Discord Stacjownika"
|
||||
@@ -409,7 +411,11 @@
|
||||
"driver-not-found-desc-2": "Historię rozkładów jazdy możesz przejrzeć w",
|
||||
"driver-not-found-journal": "DZIENNIKU RJ",
|
||||
"driver-not-found-others": "Gracz {driver} jest online jako:",
|
||||
"driver-not-found-return": "WRÓĆ NA STRONĘ GŁÓWNĄ"
|
||||
"driver-not-found-return": "WRÓĆ NA STRONĘ GŁÓWNĄ",
|
||||
|
||||
"stock-copy": "SKOPIUJ SKŁAD",
|
||||
"stock-clipboard-success": "Pomyślnie skopiowano skład w postaci tekstowej do schowka!",
|
||||
"stock-clipboard-failure": "Ups! Nie udało się skopiować składu do schowka! :/"
|
||||
},
|
||||
"train-stats": {
|
||||
"stats-button": "STATYSTYKI",
|
||||
@@ -462,6 +468,9 @@
|
||||
|
||||
"stock-dangers": "DODATKOWE UWAGI",
|
||||
"stock-preview": "PODGLĄD SKŁADU",
|
||||
"stock-copy": "SKOPIUJ SKŁAD",
|
||||
"stock-clipboard-success": "Pomyślnie skopiowano skład w postaci tekstowej do schowka:",
|
||||
"stock-clipboard-failure": "Ups! Nie udało się skopiować składu do schowka! :/",
|
||||
|
||||
"load-data": "Pobierz dalszą historię...",
|
||||
|
||||
|
||||
+10
-6
@@ -43,7 +43,7 @@ export const useMainStore = defineStore('mainStore', {
|
||||
sceneriesTrains.clear();
|
||||
|
||||
return (apiStore.activeData?.trains ?? [])
|
||||
.filter((train) => train.timetable || train.online)
|
||||
.filter((train) => train.timetable || train.lastSeen >= Date.now() - 60000)
|
||||
.map((train) => {
|
||||
const stock = train.stockString.split(';');
|
||||
const locoType = stock ? stock[0] : train.stockString;
|
||||
@@ -112,13 +112,15 @@ export const useMainStore = defineStore('mainStore', {
|
||||
: undefined
|
||||
} as Train;
|
||||
|
||||
const stationNameKey = train.currentStationName.indexOf('.sc') != -1 ? train.currentStationName.split(' ').slice(0, -1).join(' ') : train.currentStationName;
|
||||
|
||||
// Sceneries trains map
|
||||
if (sceneriesTrains.has(train.currentStationName)) {
|
||||
sceneriesTrains.set(train.currentStationName, [
|
||||
...sceneriesTrains.get(train.currentStationName)!,
|
||||
if (sceneriesTrains.has(stationNameKey)) {
|
||||
sceneriesTrains.set(stationNameKey, [
|
||||
...sceneriesTrains.get(stationNameKey)!,
|
||||
trainObj
|
||||
]);
|
||||
} else sceneriesTrains.set(train.currentStationName, [trainObj]);
|
||||
} else sceneriesTrains.set(stationNameKey, [trainObj]);
|
||||
|
||||
// Checkpoints trains map
|
||||
if (trainObj.timetableData) {
|
||||
@@ -216,13 +218,15 @@ export const useMainStore = defineStore('mainStore', {
|
||||
return acc;
|
||||
}, [] as ActiveScenery[]);
|
||||
|
||||
const referenceTimestamp = Date.now();
|
||||
|
||||
const onlineActiveSceneries = apiStore.activeData?.activeSceneries.reduce((list, scenery) => {
|
||||
if (scenery.isOnline !== 1 && Date.now() - scenery.lastSeen > 1000 * 60 * 2) return list;
|
||||
if (scenery.dispatcherStatus == Status.ActiveDispatcher.UNKNOWN) return list;
|
||||
|
||||
const dispatcherTimestamp =
|
||||
scenery.dispatcherStatus == Status.ActiveDispatcher.NO_LIMIT
|
||||
? Date.now() + 25500000
|
||||
? referenceTimestamp + 25500000
|
||||
: scenery.dispatcherStatus > 5
|
||||
? scenery.dispatcherStatus
|
||||
: null;
|
||||
|
||||
@@ -227,7 +227,7 @@ a.a-button {
|
||||
font-weight: bold;
|
||||
|
||||
&:hover {
|
||||
background-color: #424242;
|
||||
background-color: #505050;
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
|
||||
@@ -17,12 +17,19 @@
|
||||
<span class="hidable">
|
||||
{{ $t('trains.driver-journal-link') }}
|
||||
</span>
|
||||
|
||||
<img src="/images/icon-train.svg" alt="train icon" />
|
||||
</router-link>
|
||||
</div>
|
||||
|
||||
<div class="train-card">
|
||||
<TrainInfo :train="chosenTrain" :extended="true" ref="trainInfo" />
|
||||
<TrainInfo :train="chosenTrain" :extended="true" />
|
||||
|
||||
<button class="btn btn--action" style="margin: 1em 0" @click="copyStockToClipboard()">
|
||||
<i class="fa-regular fa-copy"></i> {{ $t('trains.stock-copy') }}
|
||||
</button>
|
||||
|
||||
<StockList :trainStockList="chosenTrain.stockList" />
|
||||
<TrainSchedule :train="chosenTrain" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -69,11 +76,13 @@
|
||||
import { computed } from 'vue';
|
||||
import TrainInfo from '../components/TrainsView/TrainInfo.vue';
|
||||
import TrainSchedule from '../components/TrainsView/TrainSchedule.vue';
|
||||
import StockList from '../components/Global/StockList.vue';
|
||||
import Loading from '../components/Global/Loading.vue';
|
||||
import { useMainStore } from '../store/mainStore';
|
||||
import { useApiStore } from '../store/apiStore';
|
||||
import { Status } from '../typings/common';
|
||||
import { regions as regionsJSON } from '../data/options.json';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const props = defineProps({
|
||||
trainId: {
|
||||
@@ -88,6 +97,8 @@ const props = defineProps({
|
||||
const mainStore = useMainStore();
|
||||
const apiStore = useApiStore();
|
||||
|
||||
const i18n = useI18n();
|
||||
|
||||
const chosenTrain = computed(() =>
|
||||
mainStore.trainList.find((train) => train.id == props.trainId || train.modalId == props.modalId)
|
||||
);
|
||||
@@ -99,6 +110,24 @@ const otherDriverTrains = computed(() => {
|
||||
(train.timetableData || train.online || train.lastSeen >= Date.now() - 60000)
|
||||
);
|
||||
});
|
||||
|
||||
function copyStockToClipboard() {
|
||||
const stockString = chosenTrain.value?.stockList.join(';');
|
||||
|
||||
if (!stockString) {
|
||||
alert(i18n.t('trains.stock-clipboard-failure'));
|
||||
return;
|
||||
}
|
||||
|
||||
navigator.clipboard
|
||||
.writeText(stockString)
|
||||
.then(() => {
|
||||
prompt(i18n.t('trains.stock-clipboard-success'), stockString);
|
||||
})
|
||||
.catch(() => {
|
||||
alert(i18n.t('trains.stock-clipboard-failure'));
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -131,6 +160,7 @@ $viewBgCol: #1a1a1a;
|
||||
}
|
||||
|
||||
.train-card {
|
||||
padding: 1em;
|
||||
background-color: $viewBgCol;
|
||||
border-radius: 0 0 0.5em 0.5em;
|
||||
}
|
||||
|
||||
@@ -133,4 +133,10 @@ export default defineComponent({
|
||||
position: relative;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
@include smallScreen {
|
||||
.trains_topbar {
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user