diff --git a/package.json b/package.json index faa0726..4da46ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stacjownik", - "version": "1.11.2", + "version": "1.12.0", "private": true, "scripts": { "dev": "vite", diff --git a/src/App.scss b/src/App.scss index 4fb119d..1033d9d 100644 --- a/src/App.scss +++ b/src/App.scss @@ -46,7 +46,7 @@ font-size: 1rem; @include smallScreen() { - font-size: calc(0.5rem + 1.1vw); + font-size: calc(0.55rem + 1.1vw); } @include screenLandscape() { diff --git a/src/components/JournalView/JournalDispatchersList.vue b/src/components/JournalView/JournalDispatchersList.vue index 68880ac..2b63c99 100644 --- a/src/components/JournalView/JournalDispatchersList.vue +++ b/src/components/JournalView/JournalDispatchersList.vue @@ -17,10 +17,10 @@ @keydown.enter="navigateToScenery(item.stationName, item.isOnline)" tabindex="0" > - + {{ item.dispatcherLevel >= 2 ? item.dispatcherLevel : 'L' }} @@ -31,7 +31,7 @@ PL1 - + {{ item.isOnline ? $t('journal.online-since') : 'OFFLINE' }}  {{ new Date(item.timestampFrom).toLocaleTimeString('pl-PL', { timeStyle: 'short' }) }} @@ -99,18 +99,9 @@ export default defineComponent({ diff --git a/src/components/JournalView/JournalStats.vue b/src/components/JournalView/JournalStats.vue index ba33170..23c7b37 100644 --- a/src/components/JournalView/JournalStats.vue +++ b/src/components/JournalView/JournalStats.vue @@ -11,7 +11,7 @@ {{ $t(tab.titlePath) }} - +
@@ -35,7 +35,8 @@ type TStatTab = 'daily' | 'driver'; const store = useStore(); const dailyStatsComp: Ref | null> = ref(null); -const areStatsOpen = ref(true); +const lastDailyStatsOpen = ref(false); +const areStatsOpen = ref(false); const lastClickedTab = ref('daily'); let data = reactive({ @@ -54,9 +55,9 @@ let data = reactive({ // Methods function onTabButtonClick(tab: TStatTab) { - if (lastClickedTab.value == tab || !areStatsOpen.value) { - areStatsOpen.value = !areStatsOpen.value; - } + if (lastClickedTab.value == tab || !areStatsOpen.value) areStatsOpen.value = !areStatsOpen.value; + + if (tab == 'daily') lastDailyStatsOpen.value = areStatsOpen.value; store.currentStatsTab = tab; lastClickedTab.value = tab; @@ -77,6 +78,7 @@ watch( lastClickedTab.value = statsData ? 'driver' : 'daily'; if (statsData) areStatsOpen.value = true; + if (!statsData) areStatsOpen.value = lastDailyStatsOpen.value; } ); diff --git a/src/components/JournalView/JournalTimetablesList.vue b/src/components/JournalView/JournalTimetablesList.vue index 36ad0bd..078543c 100644 --- a/src/components/JournalView/JournalTimetablesList.vue +++ b/src/components/JournalView/JournalTimetablesList.vue @@ -6,25 +6,34 @@ :key="timetable.id" >
-
+
- {{ timetable.trainCategoryCode }}  - {{ timetable.trainNo }} - | {{ timetable.driverName }} | #{{ timetable.id }} - - | - - {{ timetable.driverLevel < 2 ? 'L' : `${timetable.driverLevel} lvl` }} - + + + {{ timetable.trainCategoryCode }} + +  {{ timetable.trainNo }} + • + + {{ timetable.driverLevel < 2 ? 'L' : `${timetable.driverLevel}` }} + + + {{ timetable.driverName }} - + + {{ localeDay(timetable.beginDate, $i18n.locale) }} {{ timetable.authorName }}
+ +

@@ -189,6 +200,7 @@ export default defineComponent({ }, showTimetable(timetable: TimetableHistory) { + if (!timetable) return; if (timetable.terminated) return; this.selectModalTrain(timetable.driverName + timetable.trainNo.toString()); @@ -209,7 +221,6 @@ export default defineComponent({ @import '../../styles/badge.scss'; @import '../../styles/JournalSection.scss'; - hr { margin: 0.25em 0; } @@ -236,10 +247,14 @@ hr { } } - &-top { + &-general { display: flex; - flex-wrap: wrap; justify-content: space-between; + align-items: center; + flex-wrap: wrap; + + gap: 0.5em; + margin-bottom: 0.5em; } &-route { @@ -251,6 +266,12 @@ hr { } } +.general-train { + display: flex; + align-items: center; + gap: 0.25em; +} + ul.stock-list { display: flex; align-items: flex-end; @@ -291,14 +312,9 @@ ul.stock-list { } @include smallScreen { - .info-top { + .info-general { flex-direction: column; - - span { - margin: 0.1em auto; - } } - .info-extended { text-align: center; } diff --git a/src/components/SceneryView/SceneryDispatchersHistory.vue b/src/components/SceneryView/SceneryDispatchersHistory.vue index bf0e068..ca07009 100644 --- a/src/components/SceneryView/SceneryDispatchersHistory.vue +++ b/src/components/SceneryView/SceneryDispatchersHistory.vue @@ -5,25 +5,31 @@
{{ $t('scenery.history-list-empty') }}
    -
  • -
    - - #{{ historyItem.stationHash }}  - {{ historyItem.dispatcherName }} - -
    +
  • + + #{{ item.stationHash }}  + + {{ item.dispatcherLevel >= 2 ? item.dispatcherLevel : 'L' }} + -
    - {{ $d(historyItem.timestampFrom) }} + {{ item.dispatcherName }} + - {{ timestampToString(historyItem.timestampFrom) }} - - {{ timestampToString(historyItem.timestampTo) }} ({{ calculateDuration(historyItem.currentDuration) }}) +
    + {{ $d(item.timestampFrom) }} + + {{ timestampToString(item.timestampFrom) }} + - {{ timestampToString(item.timestampTo) }} ({{ calculateDuration(item.currentDuration) }})
    {{ $t('journal.online-since') }} - {{ timestampToString(historyItem.timestampFrom) }} - ({{ calculateDuration(historyItem.currentDuration) }}) + {{ timestampToString(item.timestampFrom) }} + ({{ calculateDuration(item.currentDuration) }})
@@ -39,10 +45,11 @@ import { DispatcherHistory } from '../../scripts/interfaces/api/DispatchersAPIDa import Station from '../../scripts/interfaces/Station'; import { URLs } from '../../scripts/utils/apiURLs'; import Loading from '../Global/Loading.vue'; +import styleMixin from '../../mixins/styleMixin'; export default defineComponent({ name: 'SceneryDispatchersHistory', - mixins: [dateMixin], + mixins: [dateMixin, styleMixin], props: { station: { type: Object as PropType, @@ -55,7 +62,7 @@ export default defineComponent({ dataStatus: DataStatus.Loading, }; }, - mounted() { + activated() { this.fetchAPIData(); }, methods: { @@ -96,6 +103,13 @@ export default defineComponent({ line-height: 1.5em; } +.item-general { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 0.25em; +} + .dispatcher-online { color: springgreen; } diff --git a/src/components/SceneryView/SceneryHeader.vue b/src/components/SceneryView/SceneryHeader.vue index 40126df..ab40750 100644 --- a/src/components/SceneryView/SceneryHeader.vue +++ b/src/components/SceneryView/SceneryHeader.vue @@ -1,6 +1,6 @@