diff --git a/package.json b/package.json
index 2c42e93..6380c3f 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "stacjownik",
- "version": "1.29.2",
+ "version": "1.30.0",
"private": true,
"type": "module",
"scripts": {
diff --git a/src/components/DriverView/DriverNotFound.vue b/src/components/DriverView/DriverNotFound.vue
new file mode 100644
index 0000000..57ffe8a
--- /dev/null
+++ b/src/components/DriverView/DriverNotFound.vue
@@ -0,0 +1,81 @@
+
+
+
⦻ {{ $t('trains.driver-not-found-header') }}
+
+
+ {{ $t('trains.driver-not-found-desc-1') }}
+ {{ $t('trains.driver-not-found-desc-2') }}
+ {{ $t('trains.driver-not-found-journal') }} !
+
+
+
+
+
+ {{ otherDriverTrains[0].driverName }}
+
+
+
+
+
+
+
+ {{ train.trainNo }}
+ | {{ regions.find((r) => r.id == train.region)?.name ?? 'PL1' }}
+
+
+
+
+
+ << {{ $t('trains.driver-not-found-return') }}
+
+
+
+
+
+
+
diff --git a/src/components/DriverView/DriverTopActions.vue b/src/components/DriverView/DriverTopActions.vue
new file mode 100644
index 0000000..8814505
--- /dev/null
+++ b/src/components/DriverView/DriverTopActions.vue
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/DriverView/DriverTrainCard.vue b/src/components/DriverView/DriverTrainCard.vue
new file mode 100644
index 0000000..4bc75e0
--- /dev/null
+++ b/src/components/DriverView/DriverTrainCard.vue
@@ -0,0 +1,328 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ i18n.t('trains.number-propositions-header') }}
+
+
+
+
+
+
+
+ {{ chosenCategory }} -
+ {{ i18n.t(`categories.${chosenCategory.slice(0, 2)}`) }}
+ ({{ i18n.t(`categories.${chosenCategory.slice(2)}`) }})
+
+
+
+ {{ i18n.t('trains.number-propositions-third-number') }}
+ {{ chosenCategoryRules[0] }} •
+
+
+ {{
+ i18n.t('trains.number-propositions-last-nums', {
+ count: chosenCategoryRules[1].length
+ })
+ }}
+ {{ chosenCategoryRules[1] }} -
+ {{ chosenCategoryRules[2] }}
+
+
+
+ {{ i18n.t('trains.number-propositions-title') }}
+ {{ numberPropositions.join(', ') }}
+
+
+
+
{{ i18n.t('trains.number-propositions-empty') }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/JournalView/JournalOptions.vue b/src/components/JournalView/JournalOptions.vue
index 87df1cd..3a77abb 100644
--- a/src/components/JournalView/JournalOptions.vue
+++ b/src/components/JournalView/JournalOptions.vue
@@ -33,31 +33,56 @@
-
+
+
+
-
-
+
+
+
+
-
@@ -117,10 +142,12 @@ import { useMainStore } from '../../store/mainStore';
import { Journal } from './typings';
import { Status } from '../../typings/common';
import { useApiStore } from '../../store/apiStore';
+import { allCategories } from '../../data/trainNumberRules.json';
+import trainCategoryMixin from '../../mixins/trainCategoryMixin';
export default defineComponent({
emits: ['onSearchConfirm', 'onOptionsReset', 'onRefreshData'],
- mixins: [keyMixin],
+ mixins: [keyMixin, trainCategoryMixin],
props: {
sorterOptionIds: {
@@ -152,6 +179,7 @@ export default defineComponent({
data() {
return {
showOptions: false,
+ allCategories,
driverSuggestions: [] as string[],
dispatcherSuggestions: [] as string[],
diff --git a/src/components/JournalView/typings.ts b/src/components/JournalView/typings.ts
index 2534d40..9802ac0 100644
--- a/src/components/JournalView/typings.ts
+++ b/src/components/JournalView/typings.ts
@@ -12,7 +12,8 @@ export namespace Journal {
| 'search-dispatcher'
| 'search-issuedFrom'
| 'search-terminatingAt'
- | 'search-via';
+ | 'search-via'
+ | 'select-categoryCode';
export type TimetableSearchType = {
[key in TimetableSearchKey]: string;
diff --git a/src/components/TrainsView/TrainInfo.vue b/src/components/TrainsView/TrainInfo.vue
index e503229..6decd91 100644
--- a/src/components/TrainsView/TrainInfo.vue
+++ b/src/components/TrainsView/TrainInfo.vue
@@ -219,15 +219,22 @@ export default defineComponent({
stockSpeedLimit() {
let isPassenger = true;
- const vehicleMaxSpeed = this.train.stockList.reduce((acc, stockName) => {
- const vehicleData = this.apiStore.vehiclesData?.find(
- (v) => v.name == stockName.split(':')[0]
- );
+ const vehicleMaxSpeed = this.train.stockList.reduce((acc, stockName, i) => {
+ const [vehicleName, vehicleCargo] = stockName.split(':');
+
+ const vehicleData = this.apiStore.vehiclesData?.find((v) => v.name == vehicleName);
if (!vehicleData) return acc;
- if (vehicleData.type == 'wagon-freight') isPassenger = false;
- const vehicleSpeed = vehicleData.group.speed;
+ let vehicleSpeed = vehicleData.group.speed;
+
+ if (vehicleData.type == 'wagon-freight') {
+ isPassenger = false;
+
+ if (vehicleCargo !== undefined && vehicleData.group.speedLoaded) {
+ vehicleSpeed = vehicleData.group.speedLoaded;
+ }
+ }
return Math.min(vehicleSpeed, acc);
}, Infinity);
diff --git a/src/data/speedLimits.ts b/src/data/speedLimits.ts
index 2546c4b..961499f 100644
--- a/src/data/speedLimits.ts
+++ b/src/data/speedLimits.ts
@@ -4,6 +4,9 @@ export const speedLimits: Record
= {
'650000': 125
},
cargo: {
+ '750000': 100,
+ '1000000': 90,
+ '1500000': 80,
'2000000': 70
},
none: 110
@@ -13,6 +16,9 @@ export const speedLimits: Record = {
'650000': 125
},
cargo: {
+ '750000': 100,
+ '1000000': 90,
+ '1500000': 80,
'2000000': 70
},
none: 110
@@ -22,6 +28,9 @@ export const speedLimits: Record = {
'650000': 125
},
cargo: {
+ '750000': 100,
+ '1000000': 90,
+ '1500000': 80,
'2000000': 70
},
none: 110
@@ -65,6 +74,7 @@ export const speedLimits: Record = {
},
cargo: {
'1200000': 100,
+ '2000000': 80,
'3100000': 70
},
none: 125
diff --git a/src/data/trainNumberRules.json b/src/data/trainNumberRules.json
new file mode 100644
index 0000000..3c692dc
--- /dev/null
+++ b/src/data/trainNumberRules.json
@@ -0,0 +1,95 @@
+{
+ "allCategories": [
+ "ROE", "ROJ", "ROS", "ROM",
+ "RPE", "RPJ", "RPS", "RPM",
+ "RME", "RMJ", "RMS", "RMM",
+ "RAE", "RAJ", "RAS", "RAM",
+ "MPE", "MPJ", "MPS", "MPM",
+ "MME", "MMJ", "MMS", "MMM",
+ "MOE", "MOJ", "MOS", "MOM",
+ "MHE", "MHJ", "MHS",
+ "EIE", "EIS",
+ "ENE", "ENS",
+ "ECE", "ECS",
+ "PWE", "PWM", "PWJ", "PWS",
+ "PXE", "PXM", "PXJ", "PXS",
+ "TCE", "TCS",
+ "TDE", "TDS",
+ "TGE", "TGS",
+ "TKE", "TKS",
+ "TME", "TMS",
+ "TNE", "TNS",
+ "TRE", "TRS",
+ "TSE", "TSS",
+ "THE", "THS",
+ "LPE",
+ "LTE", "LTS",
+ "LSS",
+ "LZE", "LZS",
+ "ZNE", "ZNS",
+ "ZUE", "ZUS"
+ ],
+ "regionNumbers": {
+ "Warszawa (1)": 1,
+ "Lublin (2)": 2,
+ "Kraków (3)": 3,
+ "Sosnowiec (4)": 4,
+ "Gdańsk (5)": 5,
+ "Wrocław (6)": 6,
+ "Poznań (7)": 7,
+ "Szczecin (8)": 8,
+ "Rezerwa (9)": 9
+ },
+ "sameRegions": {
+ "Losowy": [
+ 10, 11, 19, 91, 93, 97, 99, 20, 22, 29, 30, 33, 39, 40, 44, 49, 94, 50, 55, 59, 90, 95, 96,
+ 66, 60, 69, 77, 70, 79, 88, 80, 89, 92, 98
+ ],
+ "Warszawa (1)": [10, 11, 19, 91, 93, 97, 99],
+ "Lublin (2)": [20, 22, 29],
+ "Kraków (3)": [30, 33, 39],
+ "Sosnowiec (4)": [40, 44, 49, 94],
+ "Gdańsk (5)": [50, 55, 59, 90, 95, 96],
+ "Wrocław (6)": [66, 60, 69],
+ "Poznań (7)": [77, 70, 79],
+ "Szczecin (8)": [88, 80],
+ "Rezerwa (9)": [89, 92, 98]
+ },
+ "categoriesRules": {
+ "EI": [null, "00", "99"],
+ "EC": [null, "000", "049"],
+ "EN": [null, "000", "049"],
+
+ "RO": [null, "200", "999"],
+ "RP": [null, "050", "169"],
+ "RM": [null, "200", "999"],
+ "RA": [null, "200", "999"],
+
+ "MO": [null, "200", "999"],
+ "MP": [null, "050", "169"],
+ "MM": [null, "001", "049"],
+ "MH": [null, "170", "199"],
+
+ "PW": ["6", "000", "899"],
+ "PX": ["6", "000", "899"],
+
+ "TM": ["4", "000", "899"],
+ "TN": ["3", "000", "899"],
+ "TK": ["3", "000", "899"],
+ "TD": ["2", "000", "899"],
+ "TG": ["1", "000", "899"],
+ "TR": ["1", "000", "899"],
+ "TC": ["0", "000", "899"],
+ "TS": ["5", "000", "899"],
+ "TH": ["5", "000", "899"],
+
+ "LT": ["5", "000", "899"],
+ "LP": ["6", "000", "899"],
+ "LS": ["9", "000", "899"],
+ "LZ": ["9", "000", "899"],
+
+ "ZN": ["9", "000", "899"],
+ "ZU": ["9", "000", "899"]
+ }
+ }
+
\ No newline at end of file
diff --git a/src/locales/en.json b/src/locales/en.json
index 279a4fa..4f6cdba 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -170,6 +170,7 @@
"search-dispatchers-date": "Service date (from / to)",
"search-date-from": "Date (UTC+2 / CEST)",
"search-date-to": "Date (UTC+2 / CEST)",
+ "select-categoryCode": "Train category",
"sort-mass": "mass",
"sort-speed": "speed",
"sort-length": "length",
@@ -395,8 +396,15 @@
"driver-not-found-others": "Player {driver} is online as:",
"driver-not-found-return": "GO BACK TO THE MAIN SITE",
"stock-copy": "COPY THE STOCK",
+ "number-propositions": "PROPOSE NUMBER",
"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! :/"
+ "stock-clipboard-failure": "Oops! Something happened and the railway stock couldn't be copied to your clipboard! :/",
+
+ "number-propositions-header": "Generate number examples for selected category:",
+ "number-propositions-third-number": "Third digit:",
+ "number-propositions-last-nums": "{count} last digits from the range of:",
+ "number-propositions-title": "Propositions:",
+ "number-propositions-empty": "No propositions available for the chosen category! :/"
},
"train-stats": {
"stats-button": "STATISTICS",
diff --git a/src/locales/pl.json b/src/locales/pl.json
index de80fb0..76b5a44 100644
--- a/src/locales/pl.json
+++ b/src/locales/pl.json
@@ -167,6 +167,7 @@
"search-dispatchers-date": "Data służby (od / do)",
"search-date-from": "Data (UTC+2 / CEST)",
"search-date-to": "Data (UTC+2 / CEST)",
+ "select-categoryCode": "Kategoria pociągu",
"sort-routeDistance": "kilometraż",
"sort-allStopsCount": "stacje",
"sort-beginDate": "data",
@@ -382,8 +383,16 @@
"driver-not-found-others": "Gracz {driver} jest online jako:",
"driver-not-found-return": "WRÓĆ NA STRONĘ GŁÓWNĄ",
"stock-copy": "SKOPIUJ SKŁAD",
+ "number-propositions": "ZAPROPONUJ NUMER",
"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! :/"
+ "stock-clipboard-failure": "Ups! Nie udało się skopiować składu do schowka! :/",
+
+ "number-propositions-header": "Wygeneruj propozycje numerów dla kategorii pociągu:",
+ "number-propositions-third-number": "Trzecia cyfra:",
+ "number-propositions-last-nums": "{count} ostatnie cyfry z przedziału:",
+ "number-propositions-title": "Propozycje:",
+ "number-propositions-empty": "Brak propozycji dla wybranej kategorii! :/"
+
},
"train-stats": {
"stats-button": "STATYSTYKI",
diff --git a/src/styles/_dropdown.scss b/src/styles/_dropdown.scss
index 0c9f40e..9e75477 100644
--- a/src/styles/_dropdown.scss
+++ b/src/styles/_dropdown.scss
@@ -29,17 +29,19 @@
top: calc(100% + 0.5em);
background-color: var(--clr-bg3);
- // box-shadow: 0 5px 10px 2px #0f0f0f;
box-shadow: 0 0 5px 1px var(--clr-primary);
width: 100%;
max-width: 550px;
+ max-height: 750px;
+ overflow: auto;
+
padding: 1em;
z-index: 100;
}
-@include responsive.smallScreen{
+@include responsive.smallScreen {
.dropdown_wrapper {
font-size: 1.1em;
max-width: 100%;
diff --git a/src/styles/_global.scss b/src/styles/_global.scss
index d4dadc7..58c9a47 100644
--- a/src/styles/_global.scss
+++ b/src/styles/_global.scss
@@ -8,6 +8,7 @@
--clr-bg: #4d4d4d;
--clr-bg2: #1b1b1b;
--clr-bg3: #1d1d1d;
+ --clr-view-bg: #1a1a1a;
--clr-accent: #1085b3;
--clr-accent2: #ff3d5d;
@@ -22,6 +23,7 @@
--clr-donator: #f7a4ff;
+
--no-scroll-padding: 17px;
--max-container-width: 1700px;
diff --git a/src/styles/_journal-section.scss b/src/styles/_journal-section.scss
index cfd998e..cffb516 100644
--- a/src/styles/_journal-section.scss
+++ b/src/styles/_journal-section.scss
@@ -12,7 +12,7 @@
.list_wrapper {
overflow-y: auto;
height: calc(100vh - 12.5em);
- min-height: 650px;
+ min-height: 700px;
margin-top: 0.5em;
position: relative;
diff --git a/src/typings/common.ts b/src/typings/common.ts
index 5af60af..a3784c2 100644
--- a/src/typings/common.ts
+++ b/src/typings/common.ts
@@ -229,6 +229,8 @@ export interface VehiclesGroup {
id: number;
name: string;
speed: number;
+ speedLoaded?: number;
+ speedLoco?: number;
length: number;
weight: number;
cargoTypes: VehicleCargo[] | null;
diff --git a/src/views/DriverView.vue b/src/views/DriverView.vue
index 94daf32..5739d8f 100644
--- a/src/views/DriverView.vue
+++ b/src/views/DriverView.vue
@@ -2,103 +2,27 @@
-
-
-
-
-
-
- {{ $t('trains.stock-copy') }}
-
-
-
-
-
+
+
-
-
⦻ {{ $t('trains.driver-not-found-header') }}
-
-
- {{ $t('trains.driver-not-found-desc-1') }}
- {{ $t('trains.driver-not-found-desc-2') }}
- {{ $t('trains.driver-not-found-journal') }} !
-
-
-
-
-
- {{ otherDriverTrains[0].driverName }}
-
-
-
-
-
-
-
- {{ train.trainNo }}
- | {{ regionsJSON.find((r) => r.id == train.region)?.name ?? 'PL1' }}
-
-
-
-
-
- << {{ $t('trains.driver-not-found-return') }}
-
-
+
diff --git a/src/views/JournalTimetables.vue b/src/views/JournalTimetables.vue
index 0f3e0da..f3a82fc 100644
--- a/src/views/JournalTimetables.vue
+++ b/src/views/JournalTimetables.vue
@@ -122,6 +122,7 @@ interface TimetablesQueryParams {
driverName?: string;
trainNo?: string;
timetableId?: string;
+ categoryCode?: string;
authorName?: string;
@@ -215,6 +216,7 @@ export default defineComponent({
'search-issuedFrom': '',
'search-via': '',
'search-terminatingAt': '',
+ 'select-categoryCode': '',
'search-date-from': ''
} as Journal.TimetableSearchType);
@@ -230,6 +232,7 @@ export default defineComponent({
return {
sorterActive,
searchersValues,
+
filterList,
initFilters,
@@ -356,6 +359,7 @@ export default defineComponent({
const issuedFrom = this.searchersValues['search-issuedFrom'].trim() || undefined;
const via = this.searchersValues['search-via'].trim() || undefined;
const terminatingAt = this.searchersValues['search-terminatingAt'].trim() || undefined;
+ const categoryCode = this.searchersValues['select-categoryCode'].trim() || undefined;
let dateTo: string | undefined = undefined;
@@ -365,8 +369,6 @@ export default defineComponent({
dateTo = d.toISOString().split('T')[0];
}
- // const timestampFrom = dateString ? Date.parse(new Date(dateString).toISOString()) : undefined;
- // const timestampTo = timestampFrom ? timestampFrom + 86400000 : undefined;
const queryParams: TimetablesQueryParams = {};
@@ -433,6 +435,7 @@ export default defineComponent({
queryParams['issuedFrom'] = issuedFrom;
queryParams['terminatingAt'] = terminatingAt;
queryParams['via'] = via;
+ queryParams['categoryCode'] = categoryCode;
queryParams['issuedFrom'] = issuedFrom;
queryParams['sortBy'] =