filtrowanie statusów; poprawki w statystykach

This commit is contained in:
2023-10-31 22:53:18 +01:00
parent e4ed24de80
commit 380c97655c
14 changed files with 183 additions and 215 deletions
@@ -243,10 +243,6 @@ export default defineComponent({
}
@include smallScreen {
.daily-stats {
text-align: justify;
}
h3 {
text-align: center;
}
@@ -51,7 +51,11 @@
/>
<button class="search-exit" v-if="propName != 'search-date'">
<img src="/images/icon-exit.svg" alt="exit-icon" @click="onInputClear(propName)" />
<img
src="/images/icon-exit.svg"
alt="exit-icon"
@click="onInputClear(propName)"
/>
</button>
</div>
</div>
@@ -180,7 +184,7 @@ export default defineComponent({
},
watch: {
async driverStatsName() {
async 'store.driverStatsName'() {
await this.fetchDriverStats();
// if (value) this.store.currentStatsTab = 'driver';
@@ -86,8 +86,6 @@ watch(
);
onMounted(() => {
console.log(StorageManager.getBooleanValue('dailyStatsOpen'));
if (StorageManager.getBooleanValue('dailyStatsOpen')) {
areStatsOpen.value = true;
store.currentStatsTab = 'daily';
@@ -3,7 +3,7 @@
<h3 class="user-header section-header">
<img src="/images/icon-user.svg" alt="Users icon" />
&nbsp;{{ $t('scenery.users') }} &nbsp;
<span class="text--primary">{{ onlineScenery?.currentUsers || 0 }}</span
<span class="text--primary">{{ onlineScenery?.stationTrains?.length || 0 }}</span
>&nbsp;/&nbsp;<span class="text--primary">{{ onlineScenery?.maxUsers || 0 }}</span>
</h3>
@@ -22,7 +22,7 @@
<div
class="badge user badge-none"
v-if="!onlineScenery?.scheduledTrains || onlineScenery.scheduledTrains.length == 0"
v-if="!onlineScenery?.stationTrains?.length"
>
{{ $t('scenery.no-users') }}
</div>
+27 -23
View File
@@ -6,13 +6,10 @@
<span>{{ $t('scenery.timetables') }}</span>
<span>
<span class="text--primary">{{ onlineScenery?.scheduledTrains?.length || '0' }}</span>
<span class="text--primary">{{ onlineScenery?.scheduledTrainCount.all || 0 }}</span>
<span> / </span>
<span class="text--grayed">
{{
onlineScenery?.scheduledTrains?.filter((train) => train.stopInfo.confirmed).length ||
'0'
}}
{{ onlineScenery?.scheduledTrainCount.confirmed || '0' }}
</span>
</span>
@@ -48,27 +45,34 @@
</div>
<div class="timetable-list">
<div
style="padding-bottom: 5em"
v-if="store.dataStatuses.trains == 0 && computedScheduledTrains.length == 0"
>
<Loading />
</div>
<span
class="timetable-item empty"
v-else-if="computedScheduledTrains.length == 0 && !onlineScenery"
>
{{ $t('scenery.offline') }}
</span>
<span class="timetable-item empty" v-else-if="computedScheduledTrains.length == 0">
{{ $t('scenery.no-timetables') }}
</span>
<transition-group name="list-anim">
<div
style="padding-bottom: 5em"
v-if="store.dataStatuses.trains == 0 && computedScheduledTrains.length == 0"
key="list-loading"
>
<Loading />
</div>
<span
class="timetable-item empty"
v-else-if="computedScheduledTrains.length == 0 && !onlineScenery"
key="list-offline"
>
{{ $t('scenery.offline') }}
</span>
<div
class="timetable-item empty"
v-else-if="computedScheduledTrains.length == 0"
key="list-no-timetables"
>
{{ $t('scenery.no-timetables') }}
</div>
<div
class="timetable-item"
v-else
v-for="scheduledTrain in computedScheduledTrains"
:key="scheduledTrain.trainId"
tabindex="0"
+26 -27
View File
@@ -230,11 +230,9 @@
</td>
<td class="station_users" :class="{ inactive: !station.onlineInfo }">
<span>
<span class="highlight">{{ station.onlineInfo?.currentUsers || 0 }}</span>
/
<span class="highlight">{{ station.onlineInfo?.maxUsers || 0 }}</span>
</span>
<span>{{ station.onlineInfo?.currentUsers || 0 }}</span>
/
<span>{{ station.onlineInfo?.maxUsers || 0 }}</span>
</td>
<td class="station_spawns" :class="{ inactive: !station.onlineInfo }">
@@ -246,9 +244,7 @@
style="width: 30px"
:class="{ inactive: !station.onlineInfo }"
>
<span class="highlight">
{{ station.onlineInfo?.scheduledTrains?.length || 0 }}
</span>
{{ station.onlineInfo?.scheduledTrainCount.all }}
</td>
<td
@@ -256,15 +252,7 @@
style="width: 30px"
:class="{ inactive: !station.onlineInfo }"
>
<span style="color: #ccc">
{{
new Set([
...(station.onlineInfo?.scheduledTrains
?.filter((train) => !train.stopInfo.confirmed)
.map((train) => train.checkpointName) || [])
]).size || 0
}}
</span>
{{ station.onlineInfo?.scheduledTrainCount.unconfirmed }}
</td>
<td
@@ -272,12 +260,7 @@
style="width: 30px"
:class="{ inactive: !station.onlineInfo }"
>
<span style="color: #66ff6c">
{{
station.onlineInfo?.scheduledTrains?.filter((train) => train.stopInfo.confirmed)
.length || 0
}}
</span>
{{ station.onlineInfo?.scheduledTrainCount.confirmed }}
</td>
</tr>
</tbody>
@@ -391,10 +374,6 @@ $rowCol: #424242;
}
}
.highlight {
color: gold;
}
section.station_table {
overflow: auto;
overflow-y: hidden;
@@ -576,6 +555,26 @@ td.station {
}
}
.station_users {
span {
color: gold;
}
}
.station_schedules {
&.all {
color: gold;
}
&.unconfirmed {
color: #ccc;
}
&.confirmed {
color: lime;
}
}
.separator {
border-left: 3px solid #b3b3b3;
}