diff --git a/src/components/Global/StationStatusBadge.vue b/src/components/Global/StationStatusBadge.vue index 7e455a4..73e869b 100644 --- a/src/components/Global/StationStatusBadge.vue +++ b/src/components/Global/StationStatusBadge.vue @@ -88,8 +88,9 @@ $unknown: #b93c3c; .status-badge { border-radius: 1em; font-weight: 500; + text-wrap: nowrap; - padding: 0.2em 0.55em; + padding: 0.2rem 0.55rem; background-color: $online; @@ -106,13 +107,13 @@ $unknown: #b93c3c; &.no-limit { background-color: $no-limit; - font-size: 0.85em; + font-size: 0.9em; } &.not-signed, &.unavailable { background-color: $unav; - font-size: 0.85em; + font-size: 0.9em; } &.afk { @@ -125,7 +126,7 @@ $unknown: #b93c3c; background-color: $no-space; border: 1px solid white; color: white; - font-size: 0.85em; + font-size: 0.9em; } &.unknown, diff --git a/src/components/JournalView/JournalDispatchers/JournalDispatchersList.vue b/src/components/JournalView/JournalDispatchers/JournalDispatchersList.vue index 63839ed..9685dad 100644 --- a/src/components/JournalView/JournalDispatchers/JournalDispatchersList.vue +++ b/src/components/JournalView/JournalDispatchers/JournalDispatchersList.vue @@ -15,90 +15,118 @@ {{ $t('app.no-result') }} -
- - - - - - - - - - +
+
+
+ + + + {{ historyItem.stationName }} + -
- - - - - - - - - - - - -
{{ $t('journal.history-name') }}{{ $t('journal.history-hash') }}{{ $t('journal.history-dispatcher') }}{{ $t('journal.history-level') }}{{ $t('journal.history-rate') }}{{ $t('journal.history-region') }}{{ $t('journal.history-date') }}
- - {{ historyItem.stationName }} - - #{{ historyItem.stationHash }} + #{{ historyItem.stationHash }} + + • + + {{ historyItem.dispatcherLevel >= 2 ? historyItem.dispatcherLevel : 'L' }} + + + - - {{ historyItem.dispatcherName }} - - - - {{ historyItem.dispatcherName }} - + {{ historyItem.dispatcherName }} - + + + + {{ historyItem.dispatcherName }} + + + +
+ + {{ $d(historyItem.timestampFrom) }} + {{ timestampToString(historyItem.timestampFrom) }} + - - {{ historyItem.dispatcherLevel >= 2 ? historyItem.dispatcherLevel : 'L' }} + {{ $d(historyItem.timestampTo) }} -
- {{ historyItem.dispatcherRate }} - - {{ - regions.find((r) => r.id == historyItem.region)?.value || '???' - }} - - - {{ $d(historyItem.timestampFrom) }} + {{ timestampToString(historyItem.timestampTo) }} ({{ + calculateDuration(historyItem.currentDuration) + }}) + + + + {{ $t('journal.online-since') }} + + {{ + new Date().getDate() != new Date(historyItem.timestampFrom).getDate() + ? $d(historyItem.timestampFrom) + : '' + }} {{ timestampToString(historyItem.timestampFrom) }} - - {{ timestampToString(historyItem.timestampTo) }} ({{ - calculateDuration(historyItem.currentDuration) - }}) - - - - {{ - $t('journal.online-since') - }} - {{ timestampToString(historyItem.timestampFrom) }} - - ({{ calculateDuration(historyItem.currentDuration) }}) - -
+ + ({{ calculateDuration(historyItem.currentDuration) }}) + +
+ + + +
+ + {{ $t('scenery.dispatcher-rate') }} + {{ historyItem.dispatcherRate }} + + +
+ + + REGION: {{ regions.find((r) => r.id == historyItem.region)?.name }} + +
+ + +
+
+
+ {{ + timestampToString(parseInt(statusItem.split('@')[0])) + }} + +
+
+
+ { - if (this.isAnotherDay(i - 1, i)) - acc.push(new Date(historyItem.timestampFrom).toLocaleDateString('pl-PL')); - acc.push(historyItem); - - return acc; - }, - [] as (API.DispatcherHistory.Data | string)[] - ); - } - }, - methods: { - navigateToScenery(name: string, isOnline: boolean) { - if (!isOnline) return; + toggleExtraInfo(id: number) { + const existingId = this.openItemIndexes.indexOf(id); - this.$router.push(`/scenery?station=${name.trim().replace(/ /g, '_')}`); - }, - - isAnotherDay(prevIndex: number, currIndex: number) { - if (currIndex == 0) return true; - - return ( - new Date(this.dispatcherHistory[prevIndex].timestampFrom).getDate() != - new Date(this.dispatcherHistory[currIndex].timestampFrom).getDate() - ); + if (existingId != -1) this.openItemIndexes.splice(existingId, 1); + else this.openItemIndexes.push(id); } } }); @@ -205,53 +213,71 @@ export default defineComponent({ @import '../../../styles/variables.scss'; @import '../../../styles/JournalSection.scss'; -table.dispatchers-table { - --_bg-table: #111; - --_bg-head: #101010; - --_bg-row: #2f2f2f; - - width: 100%; - border-collapse: collapse; - position: relative; - text-align: center; - - margin-bottom: 1em; - - thead { - position: sticky; - top: 0; - background-color: var(--_bg-head); - } - - th { - padding: 0.5em; - } - - tr { - background-color: var(--_bg-row); - border-bottom: 2px solid black; - - &:last-child { - border: none; - } - } - - td { - padding: 0.75em; - - .level-badge { - margin: 0 auto; - } - } +.history-list { + display: flex; + flex-direction: column; + gap: 0.5em; + text-align: left; } -.text { - &--online { - color: springgreen; - } +.region-badge { + padding: 0 0.25em; +} - &--offline { - color: #ddd; +.level-badge { + text-align: center; + display: inline-block; + line-height: 1.6em; +} + +.dispatcher-online { + color: springgreen; +} + +.history-item { + background-color: #1a1a1a; + padding: 1em; +} + +.item-top { + display: flex; + justify-content: space-between; + align-items: center; + flex-wrap: wrap; + line-height: 1.75em; + gap: 0.5em; +} + +.item-top-right { + display: flex; + flex-wrap: wrap; + align-items: center; + text-align: center; + gap: 1em; +} + +.item-bottom { + margin-top: 1em; +} + +.history-statuses { + display: flex; + overflow: auto; + gap: 0.5em; +} + +.history-statuses > div { + background-color: #313131; + padding: 0.2rem 0 0.2rem 0.5em; + margin: 0.5em 0; + border-radius: 1em; +} + +@include smallScreen { + .item-top { + flex-direction: column; + justify-content: center; + text-align: center; } } diff --git a/src/components/JournalView/JournalTimetables/TimetableGeneral.vue b/src/components/JournalView/JournalTimetables/TimetableGeneral.vue index a8c6d45..3def7ef 100644 --- a/src/components/JournalView/JournalTimetables/TimetableGeneral.vue +++ b/src/components/JournalView/JournalTimetables/TimetableGeneral.vue @@ -26,7 +26,8 @@ {{ timetable.driverName }} diff --git a/src/typings/api.ts b/src/typings/api.ts index 954ff7a..dd32033 100644 --- a/src/typings/api.ts +++ b/src/typings/api.ts @@ -24,7 +24,7 @@ export namespace API { export type Response = Data[]; export interface Data { - id: string; + id: number; currentDuration: number; dispatcherId: number; dispatcherName: string;