2019-06-03 03:31:38 +00:00
|
|
|
<template>
|
2020-08-17 13:53:20 +00:00
|
|
|
<div class="home">
|
2021-01-17 20:24:20 +00:00
|
|
|
<div class="content-inner">
|
2020-06-27 02:50:13 +00:00
|
|
|
<FilterBar
|
2021-01-17 20:24:20 +00:00
|
|
|
ref="filter"
|
2020-06-27 02:50:13 +00:00
|
|
|
:fetch-releases="fetchReleases"
|
|
|
|
:is-home="true"
|
|
|
|
:items-total="totalCount"
|
|
|
|
:items-per-page="limit"
|
2020-06-29 01:55:10 +00:00
|
|
|
:content="$refs.content"
|
2020-06-27 02:50:13 +00:00
|
|
|
/>
|
|
|
|
|
2021-10-19 23:46:56 +00:00
|
|
|
<Releases
|
|
|
|
:releases="releases"
|
|
|
|
:done="done"
|
|
|
|
/>
|
2020-05-22 02:32:16 +00:00
|
|
|
|
|
|
|
<Pagination
|
2020-05-25 00:02:28 +00:00
|
|
|
v-if="totalCount > 0"
|
2020-05-22 02:32:16 +00:00
|
|
|
:items-total="totalCount"
|
|
|
|
:items-per-page="limit"
|
|
|
|
class="pagination-bottom"
|
|
|
|
/>
|
|
|
|
</div>
|
2020-08-17 13:53:20 +00:00
|
|
|
|
|
|
|
<Footer />
|
2020-05-22 02:32:16 +00:00
|
|
|
</div>
|
2019-06-03 03:31:38 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-07-20 02:20:33 +00:00
|
|
|
import FilterBar from '../filters/filter-bar.vue';
|
2019-11-16 02:33:36 +00:00
|
|
|
import Releases from '../releases/releases.vue';
|
2020-05-22 02:32:16 +00:00
|
|
|
import Pagination from '../pagination/pagination.vue';
|
2019-09-10 14:48:04 +00:00
|
|
|
|
2021-03-19 02:27:48 +00:00
|
|
|
async function fetchReleases(scroll = true) {
|
2021-10-19 23:46:56 +00:00
|
|
|
this.done = false;
|
|
|
|
|
2020-05-22 02:32:16 +00:00
|
|
|
const { releases, totalCount } = await this.$store.dispatch('fetchReleases', {
|
|
|
|
limit: this.limit,
|
2020-05-26 23:40:10 +00:00
|
|
|
range: this.$route.params.range,
|
2020-05-22 02:32:16 +00:00
|
|
|
pageNumber: Number(this.$route.params.pageNumber) || 1,
|
|
|
|
});
|
|
|
|
|
|
|
|
this.totalCount = totalCount;
|
|
|
|
this.releases = releases;
|
2021-10-19 23:46:56 +00:00
|
|
|
this.done = true;
|
2020-06-29 01:55:10 +00:00
|
|
|
|
2021-03-19 02:27:48 +00:00
|
|
|
if (scroll) {
|
|
|
|
this.$refs.filter?.$el.scrollIntoView();
|
|
|
|
}
|
2019-11-15 00:27:58 +00:00
|
|
|
}
|
|
|
|
|
2019-11-13 02:14:24 +00:00
|
|
|
async function mounted() {
|
2020-05-22 02:32:16 +00:00
|
|
|
this.pageTitle = '';
|
2019-11-13 02:14:24 +00:00
|
|
|
|
2020-05-22 02:32:16 +00:00
|
|
|
await this.fetchReleases();
|
2019-06-03 03:31:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
2020-05-22 02:32:16 +00:00
|
|
|
components: {
|
|
|
|
FilterBar,
|
|
|
|
Releases,
|
|
|
|
Pagination,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
releases: [],
|
|
|
|
networks: [],
|
|
|
|
pageTitle: null,
|
2021-01-17 20:24:20 +00:00
|
|
|
limit: 30,
|
2020-05-22 02:32:16 +00:00
|
|
|
totalCount: 0,
|
|
|
|
from: null,
|
2021-10-19 23:46:56 +00:00
|
|
|
done: false,
|
2020-05-22 02:32:16 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
watch: {
|
2021-01-04 00:30:39 +00:00
|
|
|
$route: fetchReleases,
|
|
|
|
'$store.state.ui.tagFilter': fetchReleases,
|
2020-05-22 02:32:16 +00:00
|
|
|
},
|
|
|
|
mounted,
|
|
|
|
methods: {
|
|
|
|
fetchReleases,
|
|
|
|
},
|
2019-06-03 03:31:38 +00:00
|
|
|
};
|
|
|
|
</script>
|
2020-08-17 13:53:20 +00:00
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.home {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2020-08-21 01:55:51 +00:00
|
|
|
flex-grow: 1;
|
2020-08-17 13:53:20 +00:00
|
|
|
}
|
|
|
|
</style>
|