diff --git a/package.json b/package.json index a4243a3..065c87d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stacjownik", - "version": "1.9.8", + "version": "1.9.9", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/src/assets/icon-history.svg b/src/assets/icon-history.svg deleted file mode 100644 index 634fb64..0000000 --- a/src/assets/icon-history.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icon-track-catenary.svg b/src/assets/icon-track-catenary.svg deleted file mode 100644 index 269d00b..0000000 --- a/src/assets/icon-track-catenary.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/assets/icon-track-nocatenary.svg b/src/assets/icon-track-nocatenary.svg deleted file mode 100644 index 86ee926..0000000 --- a/src/assets/icon-track-nocatenary.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/assets/icon-track-sbl.svg b/src/assets/icon-track-sbl.svg deleted file mode 100644 index 0623109..0000000 --- a/src/assets/icon-track-sbl.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/assets/icon-track-twb.svg b/src/assets/icon-track-twb.svg deleted file mode 100644 index 2f7e7e9..0000000 --- a/src/assets/icon-track-twb.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/components/Global/SelectBox.vue b/src/components/Global/SelectBox.vue index 3c44b0e..22e4274 100644 --- a/src/components/Global/SelectBox.vue +++ b/src/components/Global/SelectBox.vue @@ -190,7 +190,7 @@ ul.options { height: auto; - z-index: 10; + z-index: 100; width: 100%; } diff --git a/src/components/JournalView/JournalDispatchers.vue b/src/components/JournalView/JournalDispatchers.vue index 55e34f0..4f55326 100644 --- a/src/components/JournalView/JournalDispatchers.vue +++ b/src/components/JournalView/JournalDispatchers.vue @@ -46,9 +46,9 @@ PL1 - {{ doc.isOnline ? $t('journal.online-since') : 'OFFLINE' }}  + + {{ doc.isOnline ? $t('journal.online-since') : 'OFFLINE' }}  + {{ new Date(doc.timestampFrom).toLocaleTimeString('pl-PL', { timeStyle: 'short' }) }} @@ -196,7 +196,7 @@ export default defineComponent({ computedHistoryList() { return this.historyList.filter( (doc) => doc.isOnline || (doc.currentDuration && doc.currentDuration > 10 * 60000) - ); //.sort((a, b) => (b.isOnline ? 1 : 0) - (a.isOnline ? 1 : 0)); + ); }, }, @@ -231,16 +231,6 @@ export default defineComponent({ this.$router.push(`/scenery?station=${name.trim().replace(/ /g, '_')}`); }, - calculateDuration(timestampMs: number) { - const minsTotal = Math.round(timestampMs / 60000); - const hoursTotal = Math.floor(minsTotal / 60); - const minsInHour = minsTotal % 60; - - return minsTotal > 60 - ? this.$t('journal.hours', { hours: hoursTotal, minutes: minsInHour }) - : this.$t('journal.minutes', { minutes: minsTotal }); - }, - isAnotherDay(prevIndex: number, currIndex: number) { if (currIndex == 0) return true; @@ -333,13 +323,6 @@ export default defineComponent({ return; } - // if (responseData.errorMessage) { - // this.historyDataStatus.status = DataStatus.Error; - // this.historyDataStatus.error = responseData.errorMessage; - - // return; - // } - if (!responseData) return; // Response data exists @@ -439,3 +422,4 @@ export default defineComponent({ } } + diff --git a/src/components/SceneryView/SceneryDispatchersHistory.vue b/src/components/SceneryView/SceneryDispatchersHistory.vue new file mode 100644 index 0000000..eb6b21f --- /dev/null +++ b/src/components/SceneryView/SceneryDispatchersHistory.vue @@ -0,0 +1,112 @@ + + + + + + diff --git a/src/components/SceneryView/SceneryHeader.vue b/src/components/SceneryView/SceneryHeader.vue index cc34997..be5eb8c 100644 --- a/src/components/SceneryView/SceneryHeader.vue +++ b/src/components/SceneryView/SceneryHeader.vue @@ -3,18 +3,12 @@
{{ station.name }} - - {{ station.generalInfo.project }} - {{ station.name }}
-
- Autorzy: {{ station.generalInfo?.authors?.join(', ') }} -
- +
#{{ station.onlineInfo.hash }}
@@ -37,10 +31,6 @@ export default defineComponent({ @import '../../styles/variables.scss'; @import '../../styles/responsive.scss'; -.info-header { - padding-top: 2em; -} - .scenery-name { font-weight: bold; color: $accentCol; @@ -48,7 +38,7 @@ export default defineComponent({ position: relative; font-size: 3.5em; - margin-top: 0.25em; + padding: 0 0.5em; text-transform: uppercase; @@ -59,15 +49,6 @@ export default defineComponent({ .scenery-hash { color: #aaa; - font-size: 0.3em; - - position: absolute; - top: 0; - -} - -.scenery-authors { - color: #999; + font-size: 1.2em; } - diff --git a/src/components/SceneryView/SceneryInfo.vue b/src/components/SceneryView/SceneryInfo.vue index 8e712ec..4465cc4 100644 --- a/src/components/SceneryView/SceneryInfo.vue +++ b/src/components/SceneryView/SceneryInfo.vue @@ -1,15 +1,52 @@ @@ -80,9 +121,26 @@ h3.section-header { } .info-lists { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(300px, 400px)); + display: flex; + flex-wrap: wrap; justify-content: space-around; + + margin-top: 1em; +} + +.info-general { + margin-top: 1em; + font-size: 1.1em; +} + +.general-list { + display: flex; + justify-content: center; + flex-wrap: wrap; + + span { + margin: 0 0.15em; + } } .badge { diff --git a/src/components/SceneryView/SceneryInfo/SceneryInfoIcons.vue b/src/components/SceneryView/SceneryInfo/SceneryInfoIcons.vue index 1d307d0..71411e3 100644 --- a/src/components/SceneryView/SceneryInfo/SceneryInfoIcons.vue +++ b/src/components/SceneryView/SceneryInfo/SceneryInfoIcons.vue @@ -1,6 +1,15 @@ @@ -65,9 +80,10 @@ import { defineComponent } from 'vue'; import stationInfoMixin from '@/mixins/stationInfoMixin'; import Station from '@/scripts/interfaces/Station'; +import styleMixin from '@/mixins/styleMixin'; export default defineComponent({ - mixins: [stationInfoMixin], + mixins: [stationInfoMixin, styleMixin], props: { station: { type: Object as () => Station, @@ -94,6 +110,9 @@ export default defineComponent({ .info-icons { display: flex; justify-content: center; + flex-wrap: wrap; + + margin: 1em; } .icon-info { display: flex; @@ -101,11 +120,13 @@ export default defineComponent({ align-items: center; width: 3em; - font-size: 1.2em; - - margin: 1em 0.5em; + margin: 0.25em; border: 2px solid #4e4e4e; border-radius: 0.5em; + + &.level { + border-radius: 50%; + } } diff --git a/src/components/SceneryView/SceneryInfo/SceneryInfoRoutes.vue b/src/components/SceneryView/SceneryInfo/SceneryInfoRoutes.vue index 71dde25..14660b2 100644 --- a/src/components/SceneryView/SceneryInfo/SceneryInfoRoutes.vue +++ b/src/components/SceneryView/SceneryInfo/SceneryInfoRoutes.vue @@ -1,24 +1,49 @@ @@ -42,52 +67,48 @@ export default defineComponent({ default: {}, }, }, - - data() { - return { - icons: { - trackTWB: require('@/assets/icon-track-twb.svg'), - trackSBL: require('@/assets/icon-track-sbl.svg'), - trackCatenary: require('@/assets/icon-track-catenary.svg'), - trackNoCatenary: require('@/assets/icon-track-nocatenary.svg'), - }, - }; - }, }); diff --git a/src/components/SceneryView/SceneryInfo/SceneryInfoUserList.vue b/src/components/SceneryView/SceneryInfo/SceneryInfoUserList.vue index f724377..0e7336b 100644 --- a/src/components/SceneryView/SceneryInfo/SceneryInfoUserList.vue +++ b/src/components/SceneryView/SceneryInfo/SceneryInfoUserList.vue @@ -79,6 +79,7 @@ $terminated: salmon; $disconnected: slategray; .info-user-list { + width: 100%; ul { display: flex; diff --git a/src/components/SceneryView/SceneryTimetable.vue b/src/components/SceneryView/SceneryTimetable.vue index 03a6ab5..e9cae5d 100644 --- a/src/components/SceneryView/SceneryTimetable.vue +++ b/src/components/SceneryView/SceneryTimetable.vue @@ -1,169 +1,166 @@ + + diff --git a/src/locales/en.json b/src/locales/en.json index c4e9bde..833881f 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -34,12 +34,14 @@ "real": "Scenery with real lines: " }, "signals": { + "title": "Signal type", "współczesna": "modern", "mieszana": "mixed", "kształtowa": "mechanical", - "historyczna": "historyczna" + "historyczna": "historical" }, "controls": { + "title": "Control type", "SPK": "SPK", "SCS": "SCS", "SCS-SPK": "SCS/SPK", @@ -241,7 +243,30 @@ "no-scenery": "Oops! This scenery doesn't exist!", "return-btn": "Return to main site", "history-btn": "View the dispatcher history", - "info-btn": "Return to the scenery view" + "info-btn": "Return to the scenery view", + "authors-title": "Scenery author | Scenery authors", + "lines-title": "Real lines", + "project-title": "Project name", + "one-way-routes": "One way routes", + "two-way-routes": "Two way routes", + + "option-active-timetables": "Active timetables", + "option-timetables-history": "Scenery timetables history", + "option-dispatchers-history": "Scenery dispatchers history", + + "timetable-author-title": "Issued by", + "timetable-author-unknown": "Author unknown", + + "req-level": "all dispatcher levels | dispatcher level {lvl} required | dispatcher level {lvl} required", + "history-list-empty": "No recorded scenery history!" + }, + "availability": { + "title": "Availability", + "default": "in-game", + "nonDefault": "downloadable", + "unavailable": "unavailable", + "nonPublic": "private", + "abandoned": "abandoned" }, "timetables": { "timetable-only": "Switch to timetable-only view", diff --git a/src/locales/pl.json b/src/locales/pl.json index f1e32cc..557bc28 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -35,22 +35,24 @@ "abandoned": "Sceneria wycofana z rozgrywki" }, "signals": { + "title": "Sygnalizacja", "współczesna": "współczesna", "mieszana": "mieszana", "kształtowa": "kształtowa", "historyczna": "historyczna" }, "controls": { + "title": "Sterowanie", "SPK": "SPK", "SCS": "SCS", "SCS-SPK": "SCS/SPK", "SPE": "SPE", "ręczne": "ręczne", - "ręczne+SPK": "ręczne + SPK", - "ręczne+SCS": "ręczne + SCS", + "ręczne+SPK": "ręczne z SPK", + "ręczne+SCS": "ręczne z SCS", "mechaniczne": "mechaniczne", - "mechaniczne+SPK": "mechaniczne + SPK", - "mechaniczne+SCS": "mechaniczne + SCS" + "mechaniczne+SPK": "mechaniczne z SPK", + "mechaniczne+SCS": "mechaniczne z SCS" }, "status": { "online": "DO ", @@ -242,7 +244,30 @@ "no-scenery": "Ups! Ta sceneria nie istnieje!", "return-btn": "Wróć na stronę główną", "history-btn": "Przejdź do widoku historii dyżurnych ruchu", - "info-btn": "Wróc do widoku scenerii" + "info-btn": "Wróc do widoku scenerii", + "authors-title": "Autor scenerii | Autorzy scenerii", + "lines-title": "Rzeczywiste linie", + "project-title": "Projekt", + "one-way-routes": "Szlaki jednotorowe", + "two-way-routes": "Szlaki dwutorowe", + + "option-active-timetables": "Aktywne rozkłady jazdy", + "option-timetables-history": "Historia rozkładów scenerii", + "option-dispatchers-history": "Historia dyżurów scenerii", + + "timetable-author-title": "Wydany przez", + "timetable-author-unknown": "Autor nieznany", + + "req-level": "ogólnodostępna | minimum {lvl} poziom dyżurnego | minimum {lvl} poziom dyżurnego", + "history-list-empty": "Brak historii dla tej scenerii!" + }, + "availability": { + "title": "Dostępność", + "default": "w paczce", + "nonDefault": "poza paczką", + "unavailable": "niedostępna", + "nonPublic": "niepubliczna", + "abandoned": "wycofana" }, "timetables": { "timetable-only": "Wyodrębnij rozkłady jazdy", diff --git a/src/mixins/dateMixin.ts b/src/mixins/dateMixin.ts index 8dfc7ac..9d96b69 100644 --- a/src/mixins/dateMixin.ts +++ b/src/mixins/dateMixin.ts @@ -4,37 +4,47 @@ export default defineComponent({ methods: { localeDate(dateString: string, locale: string) { return new Date(dateString).toLocaleDateString(locale == 'pl' ? 'pl-PL' : 'en-GB', { - weekday: "long", - day: "numeric", - month: "2-digit", - year: "numeric", - hour: "2-digit", - minute: "2-digit" - }) + weekday: 'long', + day: 'numeric', + month: '2-digit', + year: 'numeric', + hour: '2-digit', + minute: '2-digit', + }); }, localeDay(dateString: string, locale: string) { return new Date(dateString).toLocaleDateString(locale == 'pl' ? 'pl-PL' : 'en-GB', { - day: "numeric", - month: "2-digit", - year: "numeric" - }) + day: 'numeric', + month: '2-digit', + year: 'numeric', + }); }, localeTime(dateString: string, locale: string) { return new Date(dateString).toLocaleTimeString(locale == 'pl' ? 'pl-PL' : 'en-GB', { - hour: "2-digit", - minute: "2-digit" - }) + hour: '2-digit', + minute: '2-digit', + }); }, timestampToString(timestamp: number | null) { return timestamp - ? new Date(timestamp).toLocaleTimeString("pl-PL", { - hour: "2-digit", - minute: "2-digit" - }) - : ""; - } - } -}) + ? new Date(timestamp).toLocaleTimeString('pl-PL', { + hour: '2-digit', + minute: '2-digit', + }) + : ''; + }, + + calculateDuration(timestampMs: number) { + const minsTotal = Math.round(timestampMs / 60000); + const hoursTotal = Math.floor(minsTotal / 60); + const minsInHour = minsTotal % 60; + + return minsTotal > 60 + ? this.$t('journal.hours', { hours: hoursTotal, minutes: minsInHour }) + : this.$t('journal.minutes', { minutes: minsTotal }); + }, + }, +}); diff --git a/src/scripts/interfaces/api/DispatchersAPIData.ts b/src/scripts/interfaces/api/DispatchersAPIData.ts new file mode 100644 index 0000000..dba7ece --- /dev/null +++ b/src/scripts/interfaces/api/DispatchersAPIData.ts @@ -0,0 +1,12 @@ +export interface DispatcherHistory { + currentDuration: number; + dispatcherId: number; + dispatcherName: string; + isOnline: boolean; + lastOnlineTimestamp: number; + region: string; + stationHash: string; + stationName: string; + timestampFrom: number; + timestampTo?: number; +} \ No newline at end of file diff --git a/src/scripts/interfaces/api/TimetablesAPIData.ts b/src/scripts/interfaces/api/TimetablesAPIData.ts index 18aecb2..48710a4 100644 --- a/src/scripts/interfaces/api/TimetablesAPIData.ts +++ b/src/scripts/interfaces/api/TimetablesAPIData.ts @@ -1,4 +1,3 @@ - export interface TimetableHistory { timetableId: number; trainNo: number; @@ -28,3 +27,9 @@ export interface TimetableHistory { authorName?: string; authorId?: number; } + +export interface SceneryTimetableHistory { + sceneryTimetables: TimetableHistory[]; + totalCount: number; + sceneryName: string; +} diff --git a/src/scripts/utils/storeUtils.ts b/src/scripts/utils/storeUtils.ts index e65ff3b..832600b 100644 --- a/src/scripts/utils/storeUtils.ts +++ b/src/scripts/utils/storeUtils.ts @@ -117,15 +117,16 @@ export function getScheduledTrain(train: Train, trainStopIndex: number, stationN let prevStationName = '', nextStationName = ''; + for (let i = trainStopIndex - 1; i >= 0; i--) { - if (followingStops[i].stopName.startsWith('')) { + if (/strong|podg/g.test(followingStops[i].stopName)) { prevStationName = followingStops[i].stopNameRAW; break; } } for (let i = trainStopIndex + 1; i < followingStops.length; i++) { - if (followingStops[i].stopName.startsWith('')) { + if (/strong|podg/g.test(followingStops[i].stopName)) { nextStationName = followingStops[i].stopNameRAW; break; } diff --git a/src/store/store.ts b/src/store/store.ts index 1b8c439..865e427 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -344,6 +344,7 @@ export const useStore = defineStore('store', { socket.on('UPDATE', (data: APIData) => { this.apiData = data; + this.dataStatuses.connection = DataStatus.Loaded; this.setOnlineData(); }); @@ -353,7 +354,6 @@ export const useStore = defineStore('store', { }); this.webSocket = socket; - this.dataStatuses.connection = DataStatus.Loaded; }, async connectToAPI() { diff --git a/src/styles/SceneryView/styles.scss b/src/styles/SceneryView/styles.scss new file mode 100644 index 0000000..379a32e --- /dev/null +++ b/src/styles/SceneryView/styles.scss @@ -0,0 +1,11 @@ +.scenery-section { + position: relative; + height: 100%; + overflow-y: scroll; +} + +.list-warning { + padding: 1em 0.5em; + background-color: #444; + font-size: 1.2em; +} diff --git a/src/styles/global.scss b/src/styles/global.scss index 98a3edf..5186acd 100644 --- a/src/styles/global.scss +++ b/src/styles/global.scss @@ -25,7 +25,6 @@ body { padding: 0; font-family: 'Quicksand', sans-serif; overflow-y: scroll; - } *:focus-visible { @@ -59,19 +58,16 @@ body { .content { position: absolute; - left: 50%; - top: 0; + left: 0; z-index: 100; - transform: translate(-50%, -120%); - visibility: hidden; opacity: 0; min-width: 250px; - background-color: gray; + background-color: #202020; text-align: center; border-radius: 0.5em; @@ -79,25 +75,14 @@ body { transition: opacity 0.3s; padding: 0.25em; - &::after { - content: ''; - position: absolute; - top: 100%; - left: 50%; - margin-left: -5px; - border-width: 5px; - border-style: solid; - border-color: gray transparent transparent transparent; - } + // @include smallScreen() { + // right: 0; + // left: 0; - @include smallScreen() { - right: 0; - left: 0; - - &::after { - left: 75%; - } - } + // &::after { + // left: 75%; + // } + // } } &:hover > .content { diff --git a/src/views/SceneryView.vue b/src/views/SceneryView.vue index d663637..b92922c 100644 --- a/src/views/SceneryView.vue +++ b/src/views/SceneryView.vue @@ -9,31 +9,33 @@
- +
+
+ +
- + + +
- +
+
+ +
- - + + + +
@@ -41,34 +43,69 @@