sortowanie po liczbie szlaków i ocenie dyżurnego

This commit is contained in:
2024-03-03 21:44:39 +01:00
parent 9f5d882119
commit 40bbdbe4fa
4 changed files with 37 additions and 18 deletions
+18 -18
View File
@@ -240,8 +240,12 @@
<span class="text--primary">{{ station.onlineInfo?.maxUsers || 0 }}</span>
</td>
<td class="station_spawns" :class="{ inactive: !station.onlineInfo }">
<span>{{ station.onlineInfo?.spawns.length || 0 }}</span>
<td class="station-likes">
<span>{{ station.onlineInfo?.dispatcherRate ?? 0 }}</span>
</td>
<td class="station-spawns" :class="{ inactive: !station.onlineInfo }">
<span>{{ station.onlineInfo?.spawns.length ?? 0 }}</span>
</td>
<td
@@ -406,13 +410,9 @@ table {
border-collapse: collapse;
table-layout: fixed;
width: 100%;
min-width: 1200px;
min-width: 1250px;
white-space: wrap;
@include smallScreen() {
min-width: auto;
}
thead tr {
background-color: $bgCol;
}
@@ -426,7 +426,7 @@ table {
}
&.min-lvl {
width: 100px;
width: 120px;
}
&.status {
@@ -443,19 +443,19 @@ table {
&.routes-double,
&.routes-single {
width: 75px;
width: 80px;
}
&.general {
width: 160px;
}
&.user {
width: 150px;
}
&.header-image {
width: 50px;
width: 60px;
&.user {
width: 75px;
}
}
padding: 0.5em 0.25em;
@@ -564,11 +564,11 @@ tr {
.station-info {
.icon-info {
vertical-align: middle;
line-height: 32px;
line-height: 2.5em;
width: 32px;
height: 32px;
font-size: 12px;
width: 2.5em;
height: 2.5em;
font-size: 0.8em;
margin: 0 3px;
outline: 2px solid #2b2b2b;
+1
View File
@@ -11,6 +11,7 @@ export const headIds = [
export const headIconsIds = [
'user',
'like',
'spawn',
'timetableAll',
'timetableUnconfirmed',
+16
View File
@@ -54,12 +54,28 @@ export const sortStations = (
diff = (a.onlineInfo?.dispatcherExp || 0) - (b.onlineInfo?.dispatcherExp || 0);
break;
case 'routes-single':
diff =
(a.generalInfo?.routes.single.length ?? -1) - (b.generalInfo?.routes.single.length ?? -1);
break;
case 'routes-double':
diff =
(a.generalInfo?.routes.double.length ?? -1) - (b.generalInfo?.routes.double.length ?? -1);
break;
case 'user':
diff =
(b.onlineInfo ? b.onlineInfo.currentUsers : -1) -
(a.onlineInfo ? a.onlineInfo.currentUsers : -1);
break;
case 'like':
diff =
(b.onlineInfo ? b.onlineInfo.dispatcherRate : -Infinity) -
(a.onlineInfo ? a.onlineInfo.dispatcherRate : -Infinity);
break;
case 'spawn':
diff =
(a.onlineInfo ? a.onlineInfo.spawns.length : -1) -
+2
View File
@@ -230,6 +230,8 @@ export const useMainStore = defineStore('store', {
return apiStore.sceneryData.map((scenery) => {
const routes = scenery.routesInfo.reduce(
(acc, route) => {
if (route.hidden) return acc;
const tracksKey = route.routeTracks == 2 ? 'double' : 'single';
const isElectric = route.isElectric;
const routesKey: keyof StationRoutes = `${tracksKey}${