mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
Dodano informacje o ładowaniu historii dyżurnych
This commit is contained in:
@@ -3,6 +3,14 @@
|
|||||||
<h2>HISTORIA DYŻURÓW</h2>
|
<h2>HISTORIA DYŻURÓW</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
<li v-if="!isLoaded">
|
||||||
|
<h3>Ładowanie historii...</h3>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li v-if="isLoaded && dispatcherTimeline.length == 0">
|
||||||
|
<h3>Brak historii dla tej scenerii!</h3>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li v-for="(timeline, i) in dispatcherTimeline" :key="i">
|
<li v-for="(timeline, i) in dispatcherTimeline" :key="i">
|
||||||
<h3
|
<h3
|
||||||
@click="toggleTimeline(i)"
|
@click="toggleTimeline(i)"
|
||||||
@@ -70,6 +78,8 @@ export default defineComponent({
|
|||||||
dispatcherHistory: [] as DispatcherHistory[],
|
dispatcherHistory: [] as DispatcherHistory[],
|
||||||
dispatcherTimeline: [] as DispatcherTimeline[],
|
dispatcherTimeline: [] as DispatcherTimeline[],
|
||||||
|
|
||||||
|
isLoaded: false,
|
||||||
|
|
||||||
icons: {
|
icons: {
|
||||||
ascArrow: require('@/assets/icon-arrow-asc.svg'),
|
ascArrow: require('@/assets/icon-arrow-asc.svg'),
|
||||||
descArrow: require('@/assets/icon-arrow-desc.svg'),
|
descArrow: require('@/assets/icon-arrow-desc.svg'),
|
||||||
@@ -89,6 +99,9 @@ export default defineComponent({
|
|||||||
try {
|
try {
|
||||||
const apiResult: HistoryResultAPI = (await axios.get(`${API_URL}?name=${this.name}`)).data;
|
const apiResult: HistoryResultAPI = (await axios.get(`${API_URL}?name=${this.name}`)).data;
|
||||||
|
|
||||||
|
this.isLoaded = true;
|
||||||
|
if(!apiResult || !apiResult.result) return;
|
||||||
|
|
||||||
if (!apiResult.errorMessage) {
|
if (!apiResult.errorMessage) {
|
||||||
this.dispatcherHistory = apiResult.result.dispatcherHistory;
|
this.dispatcherHistory = apiResult.result.dispatcherHistory;
|
||||||
|
|
||||||
@@ -109,6 +122,7 @@ export default defineComponent({
|
|||||||
return acc;
|
return acc;
|
||||||
}, [] as DispatcherTimeline[])
|
}, [] as DispatcherTimeline[])
|
||||||
.reverse();
|
.reverse();
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@@ -134,7 +148,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.scenery-history {
|
.scenery-history {
|
||||||
max-height: 600px;
|
height: 600px;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="scenery-wrapper" v-if="stationInfo" ref="card-wrapper">
|
<div class="scenery-wrapper" v-if="stationInfo" ref="card-wrapper">
|
||||||
<!-- <scenery-info-header :station="stationInfo" /> -->
|
|
||||||
<button v-if="!timetableOnly" class="back-btn btn btn--image" title="Powrót do scenerii" @click="navigateTo('/')">
|
<button v-if="!timetableOnly" class="back-btn btn btn--image" title="Powrót do scenerii" @click="navigateTo('/')">
|
||||||
<img :src="icons.back" alt="Back to scenery" />
|
<img :src="icons.back" alt="Back to scenery" />
|
||||||
</button>
|
</button>
|
||||||
@@ -145,6 +144,7 @@ $sceneryBgCol: #333;
|
|||||||
width: 75%;
|
width: 75%;
|
||||||
max-width: 950px;
|
max-width: 950px;
|
||||||
|
|
||||||
|
|
||||||
@include midScreen {
|
@include midScreen {
|
||||||
width: 95%;
|
width: 95%;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user