chore(profile): added router links for history list

This commit is contained in:
2026-02-17 17:06:14 +01:00
parent abd1c8b684
commit 1a7801259f
2 changed files with 94 additions and 80 deletions
@@ -14,9 +14,16 @@
</div> </div>
<div class="history-list-box"> <div class="history-list-box">
<ul> <router-link
<li v-for="entry in combinedJournal"> v-for="entry in combinedJournal"
<div style="display: flex; align-items: center; gap: 0.25em"> :to="
'trainNo' in entry.value
? `/journal/timetables?search-train=%23${entry.value.id}`
: `/journal/dispatchers?search-dispatcher=${entry.value.dispatcherName}`
"
>
<!-- Date -->
<div class="entry-top-date">
<img <img
v-if="entry.type == 'Dispatcher'" v-if="entry.type == 'Dispatcher'"
src="/images/icon-user.svg" src="/images/icon-user.svg"
@@ -80,14 +87,11 @@
<b class="timestamp-indicator" :data-online="entry.value.isOnline"> <b class="timestamp-indicator" :data-online="entry.value.isOnline">
<span v-if="entry.value.isOnline">{{ t('profile.list.online-since') }}: </span> <span v-if="entry.value.isOnline">{{ t('profile.list.online-since') }}: </span>
<span>{{ <span>{{
humanizeDuration( humanizeDuration((entry.value.timestampTo || Date.now()) - entry.value.timestampFrom)
(entry.value.timestampTo || Date.now()) - entry.value.timestampFrom
)
}}</span> }}</span>
</b> </b>
</div> </div>
</li> </router-link>
</ul>
</div> </div>
</section> </section>
</template> </template>
@@ -224,7 +228,10 @@ function toggleFilter(filterType: JournalEntryType) {
} }
.history-list-box { .history-list-box {
& > ul > li { padding: 0.25em;
}
.history-list-box > a {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 0.25em; gap: 0.25em;
@@ -234,7 +241,12 @@ function toggleFilter(filterType: JournalEntryType) {
margin-bottom: 0.5em; margin-bottom: 0.5em;
text-align: initial; text-align: initial;
} }
.entry-top-date {
display: flex;
align-items: center;
gap: 0.25em;
} }
.timestamp-indicator { .timestamp-indicator {
@@ -6,7 +6,6 @@
v-if="playerTD2Info" v-if="playerTD2Info"
:src="`https://td2.info.pl/index.php?action=dlattach;attach=${playerTD2Info.avatar};type=avatar`" :src="`https://td2.info.pl/index.php?action=dlattach;attach=${playerTD2Info.avatar};type=avatar`"
alt="player image" alt="player image"
height="120"
@error="(e) => ((e.target as any).src = '/images/default-avatar.jpg')" @error="(e) => ((e.target as any).src = '/images/default-avatar.jpg')"
/> />
@@ -71,6 +70,10 @@
<img src="/images/icon-train.svg" width="25" alt="train icon" /> <img src="/images/icon-train.svg" width="25" alt="train icon" />
<span v-if="d.timetable" class="text--primary">{{ d.timetable.category }}</span> <span v-if="d.timetable" class="text--primary">{{ d.timetable.category }}</span>
<span>{{ d.trainNo }}</span> <span>{{ d.trainNo }}</span>
&bull;
<span>{{ d.currentStationName }}</span>
&bull;
<span class="text--grayed">{{ d.stockString.split(';')[0] }}</span>
</router-link> </router-link>
</div> </div>
</div> </div>
@@ -320,7 +323,6 @@ const activeTrains = computed(() => {
gap: 0.25em; gap: 0.25em;
font-weight: bold; font-weight: bold;
background-color: #3b3b3b;
padding: 0.25em 0.5em; padding: 0.25em 0.5em;
border-radius: 0.5em; border-radius: 0.5em;
} }