Compare commits

..

3 Commits

Author SHA1 Message Date
Spythere 3be964ec99 Merge pull request #152 from Spythere/development-old
Migration info for the old version of the app
2026-01-01 21:17:17 +01:00
Spythere caf6137ca3 chore: removed new vps settings for old branch 2026-01-01 21:14:55 +01:00
Spythere 0f2e5e084b chore(app): added info about migration to the new domain for the old version of the app 2026-01-01 21:10:28 +01:00
31 changed files with 301 additions and 644 deletions
@@ -1,17 +0,0 @@
on:
release:
types: [published]
jobs:
github-releases-to-discord:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Github Releases To Discord
uses: SethCohen/github-releases-to-discord@v1.13.1
with:
webhook_url: ${{ secrets.WEBHOOK_URL }}
color: "15844367"
footer_title: "Changelog - Stacjownik"
footer_timestamp: true
-23
View File
@@ -1,23 +0,0 @@
name: Build & Deploy to VPS
on:
push:
branches:
- main
env:
PROJECT_NAME: stacjownik-td2
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the app
run: yarn && yarn build
- name: Setup SSH key for connection with the server
run: |
mkdir -p ~/.ssh
echo "${{ secrets.VPS_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
- name: Send new files
run: rsync -avP -e "ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa -p 2022" ./dist/ ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }}:/var/www/$PROJECT_NAME --delete
+2 -2
View File
@@ -15,8 +15,8 @@ app.get('/api/getSceneries', (_, res) => {
res.sendFile(path.join(cwd(), 'endpoints', 'getSceneries.json')); res.sendFile(path.join(cwd(), 'endpoints', 'getSceneries.json'));
}); });
app.get('/api/getVehiclesData', (_, res) => { app.get('/api/getVehicles', (_, res) => {
res.sendFile(path.join(cwd(), 'endpoints', 'getVehiclesData.json')); res.sendFile(path.join(cwd(), 'endpoints', 'getVehicles.json'));
}); });
app.get('/api/getDonators', (_, res) => { app.get('/api/getDonators', (_, res) => {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "stacjownik", "name": "stacjownik",
"version": "1.31.0", "version": "1.30.7",
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
+3 -239
View File
@@ -1,213 +1,11 @@
<template> <template>
<div class="app_container"> <div class="app_container">
<UpdateCard <AppNewDomainInfo />
:is-update-card-open="isUpdateCardOpen"
@toggle-card="() => (isUpdateCardOpen = false)"
/>
<AppWelcomeCard :is-card-open="isWelcomeCardOpen" @toggle-card="closeWelcomeCard" />
<MigrateInfoCard
:is-open="store.isMigrateInfoCardOpen"
@toggle-card="closeMigrateInfoCard"
></MigrateInfoCard>
<Tooltip />
<AppHeader />
<main class="app_main">
<router-view v-slot="{ Component }">
<keep-alive>
<component :is="Component" :key="$route.name" />
</keep-alive>
</router-view>
</main>
<AppFooter
:version="VERSION"
:is-on-production-host="isOnProductionHost"
:is-update-card-open="isUpdateCardOpen"
@open-update-card="() => (isUpdateCardOpen = true)"
/>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts" setup>
import { defineComponent } from 'vue'; import AppNewDomainInfo from './components/App/AppNewDomainInfo.vue';
import axios from 'axios';
import { version } from '../package.json';
import { Status } from './typings/common';
import { useMainStore } from './store/mainStore';
import { useApiStore } from './store/apiStore';
import { useTooltipStore } from './store/tooltipStore';
import Clock from './components/App/Clock.vue';
import StatusIndicator from './components/App/StatusIndicator.vue';
import AppHeader from './components/App/AppHeader.vue';
import Tooltip from './components/Tooltip/Tooltip.vue';
import UpdateCard from './components/App/UpdateCard.vue';
import StorageManager from './managers/storageManager';
import AppFooter from './components/App/AppFooter.vue';
import AppWelcomeCard from './components/App/AppWelcomeCard.vue';
import MigrateInfoCard from './components/App/MigrateInfoCard.vue';
const STORAGE_VERSION_KEY = 'app_version';
const WELCOME_CARD_SEEN_KEY = 'welcome_card_seen';
const MIGRATE_INFO_CARD_SEEN_KEY = 'migrate_info_card_seen';
export default defineComponent({
components: {
Clock,
StatusIndicator,
AppHeader,
AppFooter,
UpdateCard,
AppWelcomeCard,
MigrateInfoCard,
Tooltip
},
data: () => ({
VERSION: version,
store: useMainStore(),
apiStore: useApiStore(),
tooltipStore: useTooltipStore(),
isUpdateCardOpen: false,
isWelcomeCardOpen: false,
isOnProductionHost: /(stacjownik-td2)(\.web\.app|\.spythere\.eu)/.test(location.hostname)
}),
created() {
this.init();
},
async mounted() {
window.addEventListener('mousemove', (e: MouseEvent) => this.tooltipStore.handle(e));
window.addEventListener('mousedown', () => this.tooltipStore.hide());
},
methods: {
init() {
if (!this.isOnProductionHost) document.title = 'Stacjownik Dev';
this.loadLang();
this.setupOfflineHandling();
this.checkAppVersion();
this.handleQueries();
this.handleMigrateInfo();
this.apiStore.setupAPIData();
},
handleQueries() {
const query = new URLSearchParams(window.location.search);
if (query.get('welcomeCard') == '1') {
this.isWelcomeCardOpen = true;
}
if (query.get('migrateCard') == '1') {
this.store.isMigrateInfoCardOpen = true;
}
},
async checkAppVersion() {
const isWelcomeCardSeen = StorageManager.getBooleanValue(WELCOME_CARD_SEEN_KEY);
const storageVersion = StorageManager.getStringValue(STORAGE_VERSION_KEY);
if (isWelcomeCardSeen == false && storageVersion == '') {
setTimeout(() => {
this.isWelcomeCardOpen = true;
}, 1500);
}
try {
const releaseData = await (
await axios.get('https://api.github.com/repos/Spythere/stacjownik/releases/latest')
).data;
if (!releaseData) return;
this.store.appUpdate = {
version,
changelog: releaseData.body,
releaseURL: releaseData.html_url
};
this.isUpdateCardOpen =
(storageVersion != '' && storageVersion != version && this.isOnProductionHost) ||
import.meta.env.VITE_UPDATE_TEST === 'test';
} catch (error) {
console.error(`Wystąpił błąd podczas pobierania danych z API GitHuba: ${error}`);
}
StorageManager.setStringValue(STORAGE_VERSION_KEY, version);
},
setupOfflineHandling() {
this.store.isOffline = !window.navigator.onLine;
if (this.store.isOffline) this.handleOfflineMode();
window.addEventListener('offline', this.handleOfflineMode);
window.addEventListener('online', this.handleOnlineMode);
},
handleOfflineMode() {
this.store.isOffline = true;
this.apiStore.activeData = undefined;
this.apiStore.dataStatuses.connection = Status.Data.Offline;
},
handleOnlineMode() {
this.store.isOffline = false;
this.apiStore.dataStatuses.connection = Status.Data.Loading;
this.apiStore.connectToAPI();
},
handleMigrateInfo() {
if (location.hostname != 'stacjownik-td2.web.app') return;
if (StorageManager.getBooleanValue(MIGRATE_INFO_CARD_SEEN_KEY) === true) return;
this.store.isMigrateInfoCardOpen = true;
},
loadLang() {
const storageLang = StorageManager.getStringValue('lang');
if (storageLang) {
this.store.changeLocale(storageLang);
return;
}
if (!window.navigator.language) return;
const naviLanguage = window.navigator.language.toString();
if (!naviLanguage.startsWith('pl')) {
this.store.changeLocale('en');
return;
}
},
closeWelcomeCard() {
this.isWelcomeCardOpen = false;
StorageManager.setBooleanValue(WELCOME_CARD_SEEN_KEY, true);
},
closeMigrateInfoCard() {
this.store.isMigrateInfoCardOpen = false;
StorageManager.setBooleanValue(MIGRATE_INFO_CARD_SEEN_KEY, true);
}
}
});
</script> </script>
<style lang="scss"> <style lang="scss">
@@ -234,38 +32,4 @@ export default defineComponent({
.app_main { .app_main {
padding: 0 0.5em; padding: 0 0.5em;
} }
.warning {
background-color: firebrick;
text-align: center;
padding: 0.5em 0.4em;
max-width: 1100px;
margin: 0 auto;
border-radius: 0 0 1em 1em;
}
// FOOTER
.app_footer {
max-width: 100%;
padding: 0.5em;
button {
display: inline-block;
padding: 0.1em;
}
img {
width: 1.1em;
vertical-align: text-bottom;
}
z-index: 10;
background: #111;
color: white;
text-align: center;
vertical-align: middle;
}
</style> </style>
+37
View File
@@ -0,0 +1,37 @@
<template>
<div class="app-domain-info">
<div>
<img src="/images/icon-loading.svg" alt="loading" height="200" />
<h1><span class="text--primary">Aplikacja</span> została przeniesiona na nową domenę!</h1>
<h1><span class="text--primary">This app</span> has been moved to a new domain!</h1>
<div style="margin-top: 1em">
<a :href="newLink">Nowy link dla obecnego adresu / New link to the current address</a>
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import { computed } from 'vue';
const newLink = computed(() => {
return 'https://stacjownik-td2.spythere.eu' + location.pathname + location.search;
});
</script>
<style lang="scss" scoped>
.app-domain-info {
display: flex;
align-items: center;
justify-content: center;
text-align: center;
min-height: 100vh;
color: white;
}
a {
font-size: 1.35em;
text-decoration: underline;
}
</style>
+7 -20
View File
@@ -1,6 +1,6 @@
<template> <template>
<Card :is-open="isUpdateCardOpen" @toggle-card="toggleCard(false)"> <Card :is-open="isUpdateCardOpen" @toggle-card="toggleCard(false)">
<div class="content" tabindex="0" ref="content"> <div class="content">
<h1 style="margin-bottom: 0.5em">🚀 {{ $t('update.title') }}</h1> <h1 style="margin-bottom: 0.5em">🚀 {{ $t('update.title') }}</h1>
<div class="features-body" v-if="htmlChangelog != ''" v-html="htmlChangelog"></div> <div class="features-body" v-if="htmlChangelog != ''" v-html="htmlChangelog"></div>
@@ -13,14 +13,7 @@
<p class="bottom-info"> <p class="bottom-info">
{{ $t('update.info-1') }} {{ $t('update.info-1') }}
<br /> <br />
<span v-html="$t('update.info-2')"></span>
<i18n-t keypath="update.info-2">
<template v-slot:link>
<a href="https://github.com/Spythere/stacjownik" target="_blank">{{
$t('update.info-2-link-text')
}}</a>
</template>
</i18n-t>
</p> </p>
</div> </div>
</Card> </Card>
@@ -58,7 +51,7 @@ export default defineComponent({
watch: { watch: {
isUpdateCardOpen(val: boolean) { isUpdateCardOpen(val: boolean) {
this.$nextTick(() => { this.$nextTick(() => {
if (val) (this.$refs['content'] as HTMLElement).focus(); if (val) (this.$refs['confirm-btn'] as HTMLElement).focus();
}); });
} }
}, },
@@ -86,18 +79,13 @@ export default defineComponent({
} }
::v-deep(h2) { ::v-deep(h2) {
margin-top: 1em; padding: 0.25em 0;
padding: 0.5em 0;
border-bottom: 1px solid #aaa; border-bottom: 1px solid #aaa;
} }
::v-deep(h3) {
padding: 0.5em 0;
}
::v-deep(ul) { ::v-deep(ul) {
list-style: disc; list-style: initial;
padding: 0 1.5em; padding: 1em;
line-height: 1.5em; line-height: 1.5em;
} }
@@ -117,7 +105,7 @@ export default defineComponent({
} }
button { button {
margin: 0.5em auto; margin: 0 auto;
padding: 0.5em 0.75em; padding: 0.5em 0.75em;
font-size: 1.1em; font-size: 1.1em;
} }
@@ -129,6 +117,5 @@ p.bottom-info {
a { a {
text-decoration: underline; text-decoration: underline;
color: white;
} }
</style> </style>
@@ -205,7 +205,7 @@ const availableCategories = computed(() => {
for (const stockName of stockList) { for (const stockName of stockList) {
const [vehicleName, ...cargoList] = stockName.split(':'); const [vehicleName, ...cargoList] = stockName.split(':');
const vehicleData = apiStore.vehiclesData?.vehicles.find((v) => v.name == vehicleName); const vehicleData = apiStore.vehiclesData?.find((v) => v.name == vehicleName);
if (!vehicleData) continue; if (!vehicleData) continue;
+23
View File
@@ -0,0 +1,23 @@
<template>
<button class="action-btn btn--filled">
<div class="button_content">
<slot></slot>
</div>
</button>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({});
</script>
<style lang="scss">
@use '../../styles/responsive';
.button_content {
display: flex;
justify-content: center;
align-items: center;
}
</style>
-1
View File
@@ -10,7 +10,6 @@ export namespace Journal {
| 'search-train' | 'search-train'
| 'search-date-from' | 'search-date-from'
| 'search-dispatcher' | 'search-dispatcher'
| 'search-includesScenery'
| 'search-issuedFrom' | 'search-issuedFrom'
| 'search-terminatingAt' | 'search-terminatingAt'
| 'search-via' | 'search-via'
@@ -151,7 +151,6 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
@use '../../styles/responsive'; @use '../../styles/responsive';
@use '../../styles/scenery-history-table'; @use '../../styles/scenery-history-table';
@use '../../styles/badge';
.scenery-dispatchers-history { .scenery-dispatchers-history {
height: 100%; height: 100%;
+13 -1
View File
@@ -57,8 +57,20 @@ export default defineComponent({
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss">
@use '../../styles/responsive'; @use '../../styles/responsive';
@use '../../styles/badge';
h3.section-header {
margin: 0.5em 0;
padding: 0.3em;
display: flex;
justify-content: center;
align-items: center;
font-size: 1.2em;
}
.info-lists { .info-lists {
display: flex; display: flex;
@@ -1,6 +1,6 @@
<template> <template>
<section class="info-spawn-list"> <section class="info-spawn-list">
<h3 class="spawn-header"> <h3 class="spawn-header section-header">
<img src="/images/icon-spawn.svg" alt="Open spawns icon" /> <img src="/images/icon-spawn.svg" alt="Open spawns icon" />
&nbsp;{{ $t('scenery.spawns') }} &nbsp; &nbsp;{{ $t('scenery.spawns') }} &nbsp;
<span class="text--primary">{{ onlineScenery?.spawns.length || '0' }}</span> <span class="text--primary">{{ onlineScenery?.spawns.length || '0' }}</span>
@@ -53,23 +53,10 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@use '../../../styles/badge';
ul { ul {
position: relative; position: relative;
} }
h3.spawn-header {
margin: 0.5em 0;
padding: 0.3em;
display: flex;
justify-content: center;
align-items: center;
font-size: 1.2em;
}
.spawns-anim { .spawns-anim {
&-move, &-move,
&-enter-active, &-enter-active,
@@ -1,6 +1,6 @@
<template> <template>
<section class="info-user-list"> <section class="info-user-list">
<h3 class="user-header"> <h3 class="user-header section-header">
<img src="/images/icon-user.svg" alt="Users icon" /> <img src="/images/icon-user.svg" alt="Users icon" />
&nbsp;{{ $t('scenery.users') }} &nbsp; &nbsp;{{ $t('scenery.users') }} &nbsp;
<span class="text--primary">{{ onlineScenery?.stationTrains?.length || 0 }}</span <span class="text--primary">{{ onlineScenery?.stationTrains?.length || 0 }}</span
@@ -111,8 +111,6 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@use '../../../styles/badge';
$no-timetable: #aaa; $no-timetable: #aaa;
$departed: springgreen; $departed: springgreen;
$stopped: #ffa600; $stopped: #ffa600;
@@ -120,17 +118,6 @@ $online: gold;
$terminated: salmon; $terminated: salmon;
$disconnected: slategray; $disconnected: slategray;
h3.user-header {
margin: 0.5em 0;
padding: 0.3em;
display: flex;
justify-content: center;
align-items: center;
font-size: 1.2em;
}
.info-user-list { .info-user-list {
width: 100%; width: 100%;
} }
@@ -35,7 +35,6 @@
id="scenery-search" id="scenery-search"
list="sceneries" list="sceneries"
:placeholder="$t('filters.sceneries-placeholder')" :placeholder="$t('filters.sceneries-placeholder')"
@change="handleSceneriesInput"
@focus="preventKeyDown = true" @focus="preventKeyDown = true"
@blur="preventKeyDown = false" @blur="preventKeyDown = false"
/> />
@@ -45,40 +44,42 @@
</button> </button>
</section> </section>
<section class="card_input-search"> <section class="card_input-search authors">
<datalist id="authors" name="authors">
<option v-for="(author, i) in authorsOptions" :key="i" :value="author"></option>
</datalist>
<input <input
v-model="filters['lines']" type="text"
id="line-numbers-search" id="author"
:placeholder="$t('filters.line-numbers-placeholder')" list="authors"
name="authors"
v-model="filters['authors']"
:placeholder="$t('filters.authors-placeholder')"
@focus="preventKeyDown = true" @focus="preventKeyDown = true"
@blur="preventKeyDown = false" @blur="preventKeyDown = false"
/> />
<button class="btn--action btn--image" @click="resetLineNumbersInput">
<img src="/images/icon-exit.svg" alt="reset line numbers search" />
</button>
</section>
<section class="card_input-search">
<select id="author" name="authors" v-model="filters['authors']">
<option value="">{{ $t('filters.authors-placeholder') }}</option>
<option v-for="(author, i) in authorsOptions" :key="i" :value="author">
{{ author }}
</option>
</select>
<button class="btn--action btn--image" @click="resetAuthorsInput"> <button class="btn--action btn--image" @click="resetAuthorsInput">
<img src="/images/icon-exit.svg" alt="reset authors search" /> <img src="/images/icon-exit.svg" alt="reset authors search" />
</button> </button>
</section> </section>
<section class="card_input-search"> <section class="card_input-search">
<select id="projects" name="projects" v-model="filters['projects']"> <datalist id="projects" name="projects">
<option value="">{{ $t('filters.projects-placeholder') }}</option> <option v-for="(project, i) in projectsOptions" :key="i" :value="project"></option>
<option v-for="(project, i) in projectsOptions" :key="i" :value="project"> </datalist>
{{ project }}
</option> <input
</select> type="text"
id="projects"
list="projects"
name="projects"
v-model="filters['projects']"
:placeholder="$t('filters.projects-placeholder')"
@focus="preventKeyDown = true"
@blur="preventKeyDown = false"
/>
<button class="btn--action btn--image" @click="resetProjectsInput"> <button class="btn--action btn--image" @click="resetProjectsInput">
<img src="/images/icon-exit.svg" alt="reset projects search" /> <img src="/images/icon-exit.svg" alt="reset projects search" />
@@ -91,7 +92,7 @@
v-for="(sectionFilters, sectionKey) in filtersSections" v-for="(sectionFilters, sectionKey) in filtersSections"
:key="sectionKey" :key="sectionKey"
> >
<h3 class="section-header"> <h3 class="text--primary">
<span class="active-indicator" v-if="!areSectionFiltersDefault(sectionKey)"></span> <span class="active-indicator" v-if="!areSectionFiltersDefault(sectionKey)"></span>
{{ $t(`filters.sections.${sectionKey}`) }} {{ $t(`filters.sections.${sectionKey}`) }}
<button @click="resetSectionFilters(sectionKey)">RESET</button> <button @click="resetSectionFilters(sectionKey)">RESET</button>
@@ -121,7 +122,7 @@
</section> </section>
<section class="card_timestamp"> <section class="card_timestamp">
<h3 class="hours-section-header">{{ $t('filters.minimum-hours-title') }}</h3> <h3 class="section-header">{{ $t('filters.minimum-hours-title') }}</h3>
<span class="clock"> <span class="clock">
<button class="btn--action" @click="subHour">-</button> <button class="btn--action" @click="subHour">-</button>
@@ -216,6 +217,8 @@ export default defineComponent({
sliderStates, sliderStates,
minimumHours: 0, minimumHours: 0,
authorSearchFilter: '',
projectSearchFilter: '',
currentRegion: { id: '', value: '' }, currentRegion: { id: '', value: '' },
@@ -273,8 +276,6 @@ export default defineComponent({
authorsOptions() { authorsOptions() {
return this.store.stationList return this.store.stationList
.reduce((acc, station) => { .reduce((acc, station) => {
if (station.generalInfo?.hidden === true) return acc;
station.generalInfo?.authors?.forEach((author) => { station.generalInfo?.authors?.forEach((author) => {
if (author.trim() != '' && !acc.includes(author.toLocaleLowerCase())) if (author.trim() != '' && !acc.includes(author.toLocaleLowerCase()))
acc.push(author.toLocaleLowerCase()); acc.push(author.toLocaleLowerCase());
@@ -288,10 +289,8 @@ export default defineComponent({
projectsOptions() { projectsOptions() {
return this.store.stationList return this.store.stationList
.reduce((acc, station) => { .reduce((acc, station) => {
if (!station.generalInfo || !station.generalInfo.project || station.generalInfo.hidden) if (!station.generalInfo || !station.generalInfo.project || station.generalInfo.hidden) return acc;
return acc; if (!acc.includes(station.generalInfo.project.trim())) acc.push(station.generalInfo.project.trim());
if (!acc.includes(station.generalInfo.project.trim()))
acc.push(station.generalInfo.project.trim());
return acc; return acc;
}, [] as string[]) }, [] as string[])
@@ -321,15 +320,11 @@ export default defineComponent({
}, },
resetAuthorsInput() { resetAuthorsInput() {
this.filters['authors'] = ''; this.filters['authors'] = this.authorSearchFilter;
}, },
resetProjectsInput() { resetProjectsInput() {
this.filters['projects'] = ''; this.filters['projects'] = this.projectSearchFilter;
},
resetLineNumbersInput() {
this.filters['lines'] = '';
}, },
handleSceneriesInput() { handleSceneriesInput() {
@@ -374,6 +369,7 @@ export default defineComponent({
// Reset local model values // Reset local model values
this.minimumHours = 0; this.minimumHours = 0;
this.authorSearchFilter = '';
// Reset global filters // Reset global filters
Object.keys(this.filters).forEach((filterKey) => { Object.keys(this.filters).forEach((filterKey) => {
@@ -417,14 +413,6 @@ export default defineComponent({
@use '../../styles/animations'; @use '../../styles/animations';
h3.section-header { h3.section-header {
display: flex;
align-items: center;
margin-bottom: 0.25em;
gap: 0.5em;
color: var(--clr-primary);
}
h3.hours-section-header {
text-align: center; text-align: center;
margin: 0.5em 0; margin: 0.5em 0;
} }
@@ -506,12 +494,15 @@ h3.hours-section-header {
height: 100%; height: 100%;
} }
input, input {
select {
width: 100%; width: 100%;
padding: 0.5em; padding: 0.5em;
border: 1px solid #aaa; border: 1px solid #aaa;
} }
&.authors {
margin-top: 1em;
}
} }
.section-filters { .section-filters {
@@ -582,6 +573,12 @@ h3.hours-section-header {
} }
.option-section h3 { .option-section h3 {
display: flex;
align-items: center;
margin-bottom: 0.25em;
gap: 0.5em;
button { button {
padding: 0.15em; padding: 0.15em;
color: coral; color: coral;
+68 -67
View File
@@ -14,7 +14,7 @@
class="header-text" class="header-text"
:class="headerName" :class="headerName"
> >
<div class="header_wrapper"> <span class="header_wrapper">
<div v-html="$t(`sceneries.headers.${headerName}`)"></div> <div v-html="$t(`sceneries.headers.${headerName}`)"></div>
<img <img
@@ -23,7 +23,7 @@
:src="`/images/icon-arrow-${activeSorter.dir == 1 ? 'asc' : 'desc'}.svg`" :src="`/images/icon-arrow-${activeSorter.dir == 1 ? 'asc' : 'desc'}.svg`"
alt="sort icon" alt="sort icon"
/> />
</div> </span>
</th> </th>
<th <th
@@ -52,14 +52,14 @@
</thead> </thead>
<tbody> <tbody>
<tr <router-link
v-for="station in filteredStationList" v-for="station in filteredStationList"
class="a-row" class="a-row"
tabindex="0" role="row"
:key="station.name" :key="station.name"
@click.right.prevent="openForumSite($event, station.generalInfo?.url)" @click.right.prevent="openForumSite($event, station.generalInfo?.url)"
@click="getSceneryRoute(station)" @keydown.space.prevent="openForumSite($event, station.generalInfo?.url)"
@keydown.enter="getSceneryRoute(station)" :to="getSceneryRoute(station)"
> >
<td class="station-name" :class="station.generalInfo?.availability"> <td class="station-name" :class="station.generalInfo?.availability">
<b v-if="station.generalInfo?.project" style="color: salmon">{{ <b v-if="station.generalInfo?.project" style="color: salmon">{{
@@ -314,7 +314,7 @@
> >
{{ station.onlineInfo?.scheduledTrainCount.confirmed ?? '-' }} {{ station.onlineInfo?.scheduledTrainCount.confirmed ?? '-' }}
</td> </td>
</tr> </router-link>
</tbody> </tbody>
</table> </table>
@@ -384,13 +384,15 @@ export default defineComponent({
methods: { methods: {
getSceneryRoute(station: Station) { getSceneryRoute(station: Station) {
this.$router.push({ // TODO: Hide tooltips when navigating away
return {
name: 'SceneryView', name: 'SceneryView',
query: { query: {
station: station.name, station: station.name,
region: this.$route.query.region || undefined region: this.$route.query.region || undefined
} }
}); };
}, },
openDonationCard(e: Event) { openDonationCard(e: Event) {
@@ -457,78 +459,78 @@ table {
width: 100%; width: 100%;
min-width: 1250px; min-width: 1250px;
white-space: wrap; white-space: wrap;
}
thead { thead {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 50;
}
thead tr {
background-color: var(--clr-bg3);
}
thead th {
background-color: var(--clr-bg3);
white-space: pre-wrap;
padding: 0.5em 0.25em;
cursor: pointer;
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
&.station {
width: 12em;
} }
&.min-lvl { thead tr {
width: 4em; background-color: var(--clr-bg3);
} }
&.status { thead th {
width: 10em; &.station {
} width: 12em;
}
&.dispatcher { &.min-lvl {
width: 12em; width: 4em;
} }
&.dispatcher-lvl { &.status {
width: 6em; width: 10em;
} }
&.routes-double, &.dispatcher {
&.routes-single { width: 12em;
width: 7em; }
}
&.general { &.dispatcher-lvl {
width: 11em; width: 6em;
} }
&.header-image { &.routes-double,
width: 3.5em; &.routes-single {
width: 7em;
}
&.user { &.general {
width: 5em; width: 11em;
}
&.header-image {
width: 3.5em;
&.user {
width: 5em;
}
}
padding: 0.5em 0.25em;
background-color: var(--clr-bg3);
white-space: pre-wrap;
cursor: pointer;
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
span {
display: flex;
align-items: center;
justify-content: center;
img {
width: 1.5em;
vertical-align: middle;
}
} }
} }
} }
thead th .header_wrapper { tr,
display: flex; .a-row {
align-items: center;
justify-content: center;
img {
width: 1.5em;
vertical-align: middle;
}
}
tbody tr {
background-color: $rowCol; background-color: $rowCol;
vertical-align: middle; vertical-align: middle;
@@ -548,7 +550,6 @@ tbody tr {
cursor: pointer; cursor: pointer;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
height: 2.5em;
&.inactive { &.inactive {
opacity: 0.2; opacity: 0.2;
+7 -27
View File
@@ -145,33 +145,13 @@ function filterSliderValues(filters: Record<string, any>, generalInfo: StationGe
} }
function filterInputValues(filters: Record<string, any>, generalInfo: StationGeneralInfo) { function filterInputValues(filters: Record<string, any>, generalInfo: StationGeneralInfo) {
if ( return (
filters['authors'].length > 3 && (filters['authors'].length > 3 &&
generalInfo.authors && !generalInfo.authors
!generalInfo.authors.some( ?.map((a) => a.toLocaleLowerCase())
(a) => a.toLocaleLowerCase() == filters['authors'].toLocaleLowerCase() .includes(filters['authors'].toLocaleLowerCase())) ||
) (filters['projects'].length > 0 && generalInfo.project != filters['projects'])
) );
return true;
if (filters['projects'].length > 0 && generalInfo.project != filters['projects']) return true;
if (filters['lines'].length > 0) {
const linesNumbers = (filters['lines'] as string)
.split(',')
.map((l) => Number(l))
.filter((l) => !isNaN(l) && l != 0);
if (
!generalInfo.lines
?.split(',')
.map((l) => Number(l))
.some((l) => linesNumbers.includes(l))
)
return true;
}
return false;
} }
export const sortStations = (a: Station, b: Station, sorter: ActiveSorter) => { export const sortStations = (a: Station, b: Station, sorter: ActiveSorter) => {
@@ -18,9 +18,9 @@
<span v-if="vehicleCargo">({{ vehicleCargo.id }})</span> <span v-if="vehicleCargo">({{ vehicleCargo.id }})</span>
</div> </div>
<div class="vehicle-props" v-if="vehicleGroup"> <div class="vehicle-props" v-if="vehicleData">
{{ vehicleGroup.speed }}km/h &bull; {{ vehicleGroup.length }}m &bull; {{ vehicleData.group.speed }}km/h &bull; {{ vehicleData.group.length }}m &bull;
{{ (vehicleGroup.weight / 1000).toFixed(1) }}t {{ (vehicleData.group.weight / 1000).toFixed(1) }}t
<span v-if="vehicleCargo">(+{{ (vehicleCargo.weight / 1000).toFixed(1) }}t)</span> <span v-if="vehicleCargo">(+{{ (vehicleCargo.weight / 1000).toFixed(1) }}t)</span>
</div> </div>
</div> </div>
@@ -73,18 +73,12 @@ export default defineComponent({
return this.tooltipStore.content.split(':')[0]; return this.tooltipStore.content.split(':')[0];
}, },
vehicleGroup() { vehicleData() {
if (!this.apiStore.vehiclesData) return null; return this.apiStore.vehiclesData?.find((v) => v.name == this.vehicleName);
const vehicle = this.apiStore.vehiclesData.vehicles.find((v) => v.name == this.vehicleName);
if (!vehicle) return null;
return this.apiStore.vehiclesData.vehicleGroups.find((g) => g.id == vehicle?.vehicleGroupsId);
}, },
vehicleCargo() { vehicleCargo() {
const x = this.vehicleGroup?.cargoTypes?.find( const x = this.vehicleData?.group.cargoTypes?.find(
(c) => c.id == this.tooltipStore.content.split(':')[1] (c) => c.id == this.tooltipStore.content.split(':')[1]
); );
+3 -6
View File
@@ -69,8 +69,7 @@
"confirm": "ROGER THAT!", "confirm": "ROGER THAT!",
"no-data": "No data about the latest app update has been found", "no-data": "No data about the latest app update has been found",
"info-1": "This changelog will be available to see once again after clicking the version number in the footer", "info-1": "This changelog will be available to see once again after clicking the version number in the footer",
"info-2": "The full app changelog available on {link}", "info-2": "The full app changelog available on <a href='https://github.com/Spythere/stacjownik' target='_blank'>the project's GitHub</a>"
"info-2-link-text": "the project's GitHub page"
}, },
"app": { "app": {
"sceneries": "SCENERIES", "sceneries": "SCENERIES",
@@ -200,7 +199,6 @@
"search-dispatcher": "Dispatcher name", "search-dispatcher": "Dispatcher name",
"search-station": "Scenery name / #", "search-station": "Scenery name / #",
"search-author": "Timetable author name", "search-author": "Timetable author name",
"search-includesScenery": "Includes scenery name",
"search-issuedFrom": "Issuing scenery name", "search-issuedFrom": "Issuing scenery name",
"search-via": "Via scenery name", "search-via": "Via scenery name",
"search-terminatingAt": "Terminating scenery name", "search-terminatingAt": "Terminating scenery name",
@@ -318,9 +316,8 @@
"minTwoWayInt": "MIN. INTERNAL OTHER DOUBLE TRACK ROUTES" "minTwoWayInt": "MIN. INTERNAL OTHER DOUBLE TRACK ROUTES"
}, },
"sceneries-placeholder": "Search for scenery", "sceneries-placeholder": "Search for scenery",
"line-numbers-placeholder": "Line numbers (separated by commas)", "authors-placeholder": "Scenery author (other filters apply)",
"authors-placeholder": "Scenery author", "projects-placeholder": "Scenery project (other filters apply)",
"projects-placeholder": "Scenery project",
"search-button-title": "SEARCH", "search-button-title": "SEARCH",
"minimum-hours-title": "SHOW ONLY SCENERIES UNTIL:", "minimum-hours-title": "SHOW ONLY SCENERIES UNTIL:",
"now": "NOW", "now": "NOW",
+3 -6
View File
@@ -68,8 +68,7 @@
"confirm": "PRZYJĄŁEM!", "confirm": "PRZYJĄŁEM!",
"no-data": "Nie znaleziono informacji o ostatnich zmianach w aplikacji", "no-data": "Nie znaleziono informacji o ostatnich zmianach w aplikacji",
"info-1": "Ten changelog będzie zawsze dostępny po kliknięciu numeru wersji w stopce strony", "info-1": "Ten changelog będzie zawsze dostępny po kliknięciu numeru wersji w stopce strony",
"info-2": "Pełny changelog dostępny na {link}", "info-2": "Pełny changelog dostępny na <a href='https://github.com/Spythere/stacjownik' target='_blank'>GitHubie projektu</a>"
"info-2-link-text": "GitHubie projektu"
}, },
"app": { "app": {
"sceneries": "SCENERIE", "sceneries": "SCENERIE",
@@ -196,7 +195,6 @@
"search-dispatcher": "Nick dyżurnego", "search-dispatcher": "Nick dyżurnego",
"search-station": "Nazwa scenerii / #", "search-station": "Nazwa scenerii / #",
"search-author": "Nick autora rozkładu jazdy", "search-author": "Nick autora rozkładu jazdy",
"search-includesScenery": "Zawiera scenerię",
"search-issuedFrom": "Sceneria początkowa", "search-issuedFrom": "Sceneria początkowa",
"search-via": "Przez scenerię", "search-via": "Przez scenerię",
"search-terminatingAt": "Sceneria końcowa", "search-terminatingAt": "Sceneria końcowa",
@@ -315,9 +313,8 @@
"minTwoWayInt": "SZLAKI DWUTOROWE NIEZELEKTR. WEWNĘTRZNE (MINIMUM)" "minTwoWayInt": "SZLAKI DWUTOROWE NIEZELEKTR. WEWNĘTRZNE (MINIMUM)"
}, },
"sceneries-placeholder": "Wyszukaj scenerię", "sceneries-placeholder": "Wyszukaj scenerię",
"line-numbers-placeholder": "Numery linii (oddzielone przecinkami)", "authors-placeholder": "Autor scenerii (uwzględnia inne filtry)",
"authors-placeholder": "Autor scenerii", "projects-placeholder": "Projekt scenerii (uwzględnia inne filtry)",
"projects-placeholder": "Projekt scenerii",
"search-button-title": "SZUKAJ", "search-button-title": "SZUKAJ",
"minimum-hours-title": "POKAŻ TYLKO SCENERIE DOSTĘPNE MINIMUM DO:", "minimum-hours-title": "POKAŻ TYLKO SCENERIE DOSTĘPNE MINIMUM DO:",
"now": "TERAZ", "now": "TERAZ",
+1 -2
View File
@@ -69,8 +69,7 @@ export const initFilters = {
minTwoWayInt: 0, minTwoWayInt: 0,
minTwoWayCatenaryInt: 0, minTwoWayCatenaryInt: 0,
authors: '', authors: '',
projects: '', projects: ''
lines: ''
}; };
export const sliderStates = [ export const sliderStates = [
+9 -26
View File
@@ -122,27 +122,19 @@ export default defineComponent({
// Check the whole consist speed limit // Check the whole consist speed limit
const vehicleMaxSpeed = stockList.reduce((acc, stockName, i) => { const vehicleMaxSpeed = stockList.reduce((acc, stockName, i) => {
if (!this.apiStore.vehiclesData) return acc;
const [vehicleName, vehicleCargo] = stockName.split(':'); const [vehicleName, vehicleCargo] = stockName.split(':');
const vehicle = this.apiStore.vehiclesData.vehicles.find((v) => v.name == vehicleName); const vehicleData = this.apiStore.vehiclesData?.find((v) => v.name == vehicleName);
if (!vehicle) return acc; if (!vehicleData) return acc;
const vehicleGroup = this.apiStore.vehiclesData.vehicleGroups.find( let vehicleSpeed = vehicleData.group.speed;
(g) => g.id == vehicle.vehicleGroupsId
);
if (!vehicleGroup) return acc; if (vehicleData.type == 'wagon-freight') {
let vehicleSpeed = vehicleGroup.speed;
if (vehicle.type == 'wagon-freight') {
isPassenger = false; isPassenger = false;
if (vehicleCargo !== undefined && vehicleGroup.speedLoaded) { if (vehicleCargo !== undefined && vehicleData.group.speedLoaded) {
vehicleSpeed = vehicleGroup.speedLoaded; vehicleSpeed = vehicleData.group.speedLoaded;
} }
} }
@@ -151,23 +143,14 @@ export default defineComponent({
// Check the head vehicle speed limit // Check the head vehicle speed limit
const headLocoName = stockList[0]; const headLocoName = stockList[0];
const headLocoVehicleData = this.apiStore.vehiclesData?.find((v) => v.name == headLocoName);
const headLocoVehicle = this.apiStore.vehiclesData!.vehicles.find(
(v) => v.name == headLocoName
);
const headLocoVehicleGroup = this.apiStore.vehiclesData!.vehicleGroups.find(
(g) => g.id == headLocoVehicle?.vehicleGroupsId
);
if (!headLocoVehicleGroup) return vehicleMaxSpeed;
// Omit speed check for head vehicle if there's no data for it // Omit speed check for head vehicle if there's no data for it
if (!headLocoName || !headLocoVehicle || !headLocoVehicleGroup.massSpeeds) if (!headLocoName || !headLocoVehicleData || !headLocoVehicleData.group.massSpeeds)
return vehicleMaxSpeed; return vehicleMaxSpeed;
const massSpeeds = const massSpeeds =
headLocoVehicleGroup.massSpeeds[ headLocoVehicleData.group.massSpeeds[
stockList.length == 1 ? 'none' : isPassenger ? 'passenger' : 'cargo' stockList.length == 1 ? 'none' : isPassenger ? 'passenger' : 'cargo'
]; ];
+2 -2
View File
@@ -13,7 +13,7 @@ export const useApiStore = defineStore('apiStore', {
}, },
activeData: undefined as API.ActiveData.Response | undefined, activeData: undefined as API.ActiveData.Response | undefined,
vehiclesData: undefined as API.VehiclesData.Response | undefined, vehiclesData: undefined as API.Vehicles.Response | undefined,
donatorsData: [] as API.Donators.Response, donatorsData: [] as API.Donators.Response,
sceneryData: [] as StationJSONData[], sceneryData: [] as StationJSONData[],
@@ -111,7 +111,7 @@ export const useApiStore = defineStore('apiStore', {
async fetchVehiclesInfo() { async fetchVehiclesInfo() {
try { try {
const response = await this.client!.get<API.VehiclesData.Response>('api/getVehiclesData'); const response = await this.client!.get<API.Vehicles.Response>('api/getVehicles');
this.vehiclesData = response.data; this.vehiclesData = response.data;
this.dataStatuses.vehicles = response.data ? Status.Data.Loaded : Status.Data.Warning; this.dataStatuses.vehicles = response.data ? Status.Data.Loaded : Status.Data.Warning;
+3 -3
View File
@@ -38,8 +38,7 @@ export const useMainStore = defineStore('mainStore', {
modalLastClickedTarget: null, modalLastClickedTarget: null,
currentLocale: 'pl', currentLocale: 'pl',
isMigrateInfoCardOpen: false, isMigrateInfoCardOpen: false
pinnedStationNames: []
}) as MainStoreState, }) as MainStoreState,
actions: { actions: {
@@ -432,6 +431,7 @@ export const useMainStore = defineStore('mainStore', {
return { return {
name: scenery.name, name: scenery.name,
generalInfo: { generalInfo: {
...scenery, ...scenery,
authors: scenery.authors?.split(',').map((a) => a.trim()), authors: scenery.authors?.split(',').map((a) => a.trim()),
@@ -446,7 +446,7 @@ export const useMainStore = defineStore('mainStore', {
}, },
allStationInfo(): Station[] { allStationInfo(): Station[] {
const onlineUnsavedStations: Station[] = this.activeSceneryList const onlineUnsavedStations = this.activeSceneryList
.filter( .filter(
(scenery) => (scenery) =>
this.stationList.findIndex((st) => st.name == scenery.name) == -1 && this.stationList.findIndex((st) => st.name == scenery.name) == -1 &&
+1 -21
View File
@@ -89,8 +89,7 @@ select {
font-size: 1em; font-size: 1em;
} }
input, input {
select {
background: none; background: none;
color: white; color: white;
font-size: 1em; font-size: 1em;
@@ -359,22 +358,3 @@ a.a-button {
background-color: #aaa; background-color: #aaa;
margin: 0.5em 0; margin: 0.5em 0;
} }
.g-checkbox {
position: relative;
display: inline-block;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
display: flex;
justify-content: center;
align-items: center;
input {
position: absolute;
width: 1px;
height: 1px;
}
}
+4
View File
@@ -62,3 +62,7 @@
transform: translateY(-50%); transform: translateY(-50%);
padding-right: 0.5em; padding-right: 0.5em;
} }
select.search-input {
}
+3 -46
View File
@@ -1,4 +1,4 @@
import { Status, Vehicle, VehicleGroup } from './common'; import { Status, VehicleData } from './common';
export enum APIDataStatus { export enum APIDataStatus {
OK = 'OK', OK = 'OK',
@@ -329,51 +329,8 @@ export namespace API {
export type Response = string[]; export type Response = string[];
} }
export namespace VehiclesData { export namespace Vehicles {
export interface VehicleObject { export type Response = VehicleData[];
id: number;
name: string;
type: string;
cabinName: string | null;
restrictions: Record<string, any> | null;
vehicleGroupsId: number;
}
export interface VehicleGroupObject {
id: number;
name: string;
speed: number;
speedLoaded?: number;
speedLoco?: number;
length: number;
weight: number;
cargoTypes: VehicleCargo[] | null;
locoProps: {
coldStart: boolean;
doubleManned: boolean;
} | null;
massSpeeds: VehicleGroupMassSpeeds | null;
}
export interface VehicleGroupMassSpeeds {
passenger: Record<string, number> | null;
cargo: Record<string, number> | null;
none: number | null;
}
export interface VehicleCargo {
id: string;
weight: number;
}
export interface Data {
vehicles: VehicleObject[];
vehicleGroups: VehicleGroupObject[];
}
export type Response = Data;
} }
} }
+42 -4
View File
@@ -1,6 +1,5 @@
import { RouteLocationRaw } from 'vue-router'; import { RouteLocationRaw } from 'vue-router';
import { StationJSONData } from '../store/typings'; import { StationJSONData } from '../store/typings';
import { API } from './api';
export type Availability = 'default' | 'unavailable' | 'nonPublic' | 'abandoned' | 'nonDefault'; export type Availability = 'default' | 'unavailable' | 'nonPublic' | 'abandoned' | 'nonDefault';
export type ScenerySpawnType = 'passenger' | 'freight' | 'loco' | 'all'; export type ScenerySpawnType = 'passenger' | 'freight' | 'loco' | 'all';
@@ -96,7 +95,9 @@ export interface TrainTimetableData {
export interface Station { export interface Station {
name: string; name: string;
generalInfo?: StationGeneralInfo; generalInfo?: StationGeneralInfo;
onlineInfo?: ActiveScenery; onlineInfo?: ActiveScenery;
} }
@@ -106,7 +107,7 @@ export interface StationGeneralInfo {
abbr: string; abbr: string;
hash?: string; hash?: string;
reqLevel: number; reqLevel: number;
lines?: string; lines: string;
project: string; project: string;
projectUrl?: string; projectUrl?: string;
signalType: string; signalType: string;
@@ -215,8 +216,45 @@ export interface CheckpointTrain {
} }
// Vehicles Data // Vehicles Data
export type Vehicle = API.VehiclesData.VehicleObject;
export type VehicleGroup = API.VehiclesData.VehicleGroupObject; export interface VehicleData {
id: number;
name: string;
type: string;
cabinName: string | null;
restrictions: Record<string, any> | null;
vehicleGroupsId: number;
group: VehiclesGroup;
}
export interface VehiclesGroup {
id: number;
name: string;
speed: number;
speedLoaded?: number;
speedLoco?: number;
length: number;
weight: number;
cargoTypes: VehicleCargo[] | null;
locoProps: {
coldStart: boolean;
doubleManned: boolean;
} | null;
massSpeeds: VehicleGroupMassSpeeds | null;
}
export interface VehicleGroupMassSpeeds {
passenger: Record<string, number> | null;
cargo: Record<string, number> | null;
none: number | null;
}
export interface VehicleCargo {
id: string;
weight: number;
}
export interface TooltipUserTrain { export interface TooltipUserTrain {
driverName: string; driverName: string;
+2 -18
View File
@@ -280,25 +280,9 @@ export default defineComponent({
const dateFromString = this.searchersValues['search-date-from'].trim() || undefined; const dateFromString = this.searchersValues['search-date-from'].trim() || undefined;
const dateToString = this.searchersValues['search-date-to'].trim() || undefined; const dateToString = this.searchersValues['search-date-to'].trim() || undefined;
let dateFromISO: string | undefined = undefined;
let dateToISO: string | undefined = undefined;
if (dateFromString) {
let dateFrom = new Date(dateFromString);
dateFrom.setMinutes(dateFrom.getMinutes() + dateFrom.getTimezoneOffset());
dateFromISO = dateFrom.toISOString();
}
if (dateToString) {
let dateTo = new Date(dateToString);
dateTo.setMinutes(dateTo.getMinutes() + dateTo.getTimezoneOffset());
dateToISO = dateTo.toISOString();
}
queryParams['dispatcherName'] = dispatcherName; queryParams['dispatcherName'] = dispatcherName;
queryParams['dateFrom'] = dateFromString;
queryParams['dateFrom'] = dateFromISO; queryParams['dateTo'] = dateToString ? `${dateToString}T23:00:00` : undefined;
queryParams['dateTo'] = dateToISO;
queryParams['countLimit'] = 30; queryParams['countLimit'] = 30;
+8 -17
View File
@@ -132,7 +132,6 @@ interface TimetablesQueryParams {
issuedFrom?: string; issuedFrom?: string;
terminatingAt?: string; terminatingAt?: string;
via?: string; via?: string;
includesScenery?: string;
countFrom?: number; countFrom?: number;
countLimit?: number; countLimit?: number;
@@ -214,7 +213,6 @@ export default defineComponent({
'search-train': '', 'search-train': '',
'search-driver': '', 'search-driver': '',
'search-dispatcher': '', 'search-dispatcher': '',
'search-includesScenery': '',
'search-issuedFrom': '', 'search-issuedFrom': '',
'search-via': '', 'search-via': '',
'search-terminatingAt': '', 'search-terminatingAt': '',
@@ -357,25 +355,19 @@ export default defineComponent({
const driverName = this.searchersValues['search-driver'].trim() || undefined; const driverName = this.searchersValues['search-driver'].trim() || undefined;
const trainNo = this.searchersValues['search-train'].trim() || undefined; const trainNo = this.searchersValues['search-train'].trim() || undefined;
const authorName = this.searchersValues['search-dispatcher'].trim() || undefined; const authorName = this.searchersValues['search-dispatcher'].trim() || undefined;
const dateFromString = this.searchersValues['search-date-from'].trim() || undefined; const dateFrom = this.searchersValues['search-date-from'].trim() || undefined;
const includesScenery = this.searchersValues['search-includesScenery'].trim() || undefined;
const issuedFrom = this.searchersValues['search-issuedFrom'].trim() || undefined; const issuedFrom = this.searchersValues['search-issuedFrom'].trim() || undefined;
const via = this.searchersValues['search-via'].trim() || undefined; const via = this.searchersValues['search-via'].trim() || undefined;
const terminatingAt = this.searchersValues['search-terminatingAt'].trim() || undefined; const terminatingAt = this.searchersValues['search-terminatingAt'].trim() || undefined;
const categoryCode = this.searchersValues['select-categoryCode'].trim() || undefined; const categoryCode = this.searchersValues['select-categoryCode'].trim() || undefined;
let dateFromISO: string | undefined = undefined; let dateTo: string | undefined = undefined;
let dateToISO: string | undefined = undefined;
if (dateFromString) { if (dateFrom) {
let dateFrom = new Date(dateFromString); const d = new Date(dateFrom);
dateFrom.setMinutes(dateFrom.getMinutes() + dateFrom.getTimezoneOffset()); d.setDate(d.getDate() + 1);
let dateTo = new Date(dateFrom); dateTo = d.toISOString().split('T')[0];
dateTo.setDate(dateTo.getDate() + 1);
dateFromISO = dateFrom.toISOString();
dateToISO = dateTo.toISOString();
} }
const queryParams: TimetablesQueryParams = {}; const queryParams: TimetablesQueryParams = {};
@@ -438,9 +430,8 @@ export default defineComponent({
queryParams['countLimit'] = undefined; queryParams['countLimit'] = undefined;
queryParams['authorName'] = authorName; queryParams['authorName'] = authorName;
queryParams['dateFrom'] = dateFromISO; queryParams['dateFrom'] = dateFrom;
queryParams['dateTo'] = dateToISO; queryParams['dateTo'] = dateTo;
queryParams['includesScenery'] = includesScenery;
queryParams['issuedFrom'] = issuedFrom; queryParams['issuedFrom'] = issuedFrom;
queryParams['terminatingAt'] = terminatingAt; queryParams['terminatingAt'] = terminatingAt;
queryParams['via'] = via; queryParams['via'] = via;
+2 -2
View File
@@ -4,7 +4,7 @@ import { VitePWA } from 'vite-plugin-pwa';
import path from 'path'; import path from 'path';
export default defineConfig({ export default defineConfig({
server: { port: 5123, open: false }, server: { port: 5123, open: true },
preview: { port: 4001, open: false }, preview: { port: 4001, open: false },
publicDir: 'public', publicDir: 'public',
css: { css: {
@@ -28,7 +28,7 @@ export default defineConfig({
runtimeCaching: [ runtimeCaching: [
{ {
urlPattern: urlPattern:
/^https:\/\/stacjownik.spythere.eu\/api\/(getVehiclesData|getDonators|getSceneries)/i, /^https:\/\/stacjownik.spythere.eu\/api\/(getVehicles|getDonators|getSceneries)/i,
handler: 'NetworkFirst', handler: 'NetworkFirst',
options: { options: {
cacheName: 'stacjownik-api-cache', cacheName: 'stacjownik-api-cache',