- {{ historyItem.route.replace('|', ' -> ') }} | {{ historyItem.routeDistance }} km
-
- Autor:
- {{ historyItem.authorName }}
-
+
{{ historyItem.route.replace('|', ' -> ') }}
+
+
+ {{ $t('scenery.timetable-author-title') }}:
+ {{ historyItem.authorName }}
+ {{ $t('scenery.timetable-author-unknown') }}
+
@@ -70,10 +75,13 @@ export default defineComponent({
diff --git a/src/locales/en.json b/src/locales/en.json
index 208bbba..833881f 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -38,7 +38,7 @@
"współczesna": "modern",
"mieszana": "mixed",
"kształtowa": "mechanical",
- "historyczna": "historyczna"
+ "historyczna": "historical"
},
"controls": {
"title": "Control type",
@@ -248,7 +248,17 @@
"lines-title": "Real lines",
"project-title": "Project name",
"one-way-routes": "One way routes",
- "two-way-routes": "Two 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",
diff --git a/src/locales/pl.json b/src/locales/pl.json
index 482a967..557bc28 100644
--- a/src/locales/pl.json
+++ b/src/locales/pl.json
@@ -249,7 +249,17 @@
"lines-title": "Rzeczywiste linie",
"project-title": "Projekt",
"one-way-routes": "Szlaki jednotorowe",
- "two-way-routes": "Szlaki dwutorowe"
+ "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ść",
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/utils/storeUtils.ts b/src/scripts/utils/storeUtils.ts
index faa67c8..832600b 100644
--- a/src/scripts/utils/storeUtils.ts
+++ b/src/scripts/utils/storeUtils.ts
@@ -140,7 +140,7 @@ export function getScheduledTrain(train: Train, trainStopIndex: number, stationN
if (currentStop.departureLine == null) break;
- if (!/_|it|sbl/gi.test(currentStop.departureLine)) {
+ if (!/-|_|it|sbl/gi.test(currentStop.departureLine)) {
departureLine = currentStop.departureLine;
break;
}
@@ -151,7 +151,7 @@ export function getScheduledTrain(train: Train, trainStopIndex: number, stationN
if (currentStop.arrivalLine == null) break;
- if (!/_|it|sbl/gi.test(currentStop.arrivalLine)) {
+ if (!/-|_|it|sbl/gi.test(currentStop.arrivalLine)) {
arrivingLine = currentStop.arrivalLine;
break;
}
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/views/SceneryView.vue b/src/views/SceneryView.vue
index 50ac872..b92922c 100644
--- a/src/views/SceneryView.vue
+++ b/src/views/SceneryView.vue
@@ -28,20 +28,13 @@
@click="setViewMode(viewMode.component)"
:data-checked="currentViewCompontent == viewMode.component"
>
- {{ viewMode.value }}
+ {{ $t(viewMode.id) }}