Added footer and basic stats page.

This commit is contained in:
DebaucheryLibrarian
2020-08-15 19:04:33 +02:00
parent d7974f057f
commit b3435c97c3
14 changed files with 194 additions and 8 deletions

View File

@@ -12,6 +12,7 @@ import '../css/style.scss';
import Container from '../components/container/container.vue';
import Icon from '../components/icon/icon.vue';
import Footer from '../components/footer/footer.vue';
function formatDate(date, format = 'MMMM D, YYYY', precision = 'day') {
if (precision === 'year') {
@@ -39,6 +40,7 @@ function init() {
Vue.mixin({
components: {
Icon,
Footer,
},
watch: {
pageTitle(title) {

View File

@@ -12,6 +12,7 @@ import Movies from '../components/releases/movies.vue';
import Tag from '../components/tags/tag.vue';
import Tags from '../components/tags/tags.vue';
import Search from '../components/search/search.vue';
import Stats from '../components/stats/stats.vue';
import NotFound from '../components/errors/404.vue';
Vue.use(VueRouter);
@@ -172,6 +173,11 @@ const routes = [
component: Search,
name: 'search',
},
{
path: '/stats',
component: Stats,
name: 'stats',
},
{
path: '*',
component: NotFound,

View File

@@ -154,6 +154,32 @@ function initUiActions(_store, _router) {
};
}
async function fetchStats() {
const {
scenes,
movies,
actors,
networks,
channels,
} = await graphql(`
query Stats {
scenes: releasesConnection { totalCount }
movies: moviesConnection { totalCount }
actors: actorsConnection { totalCount }
networks: entitiesConnection(filter: { type: { equalTo: "network" } }) { totalCount }
channels: entitiesConnection(filter: { type: { equalTo: "channel" } }) { totalCount }
}
`);
return {
totalScenes: scenes.totalCount,
totalMovies: movies.totalCount,
totalActors: actors.totalCount,
totalNetworks: networks.totalCount,
totalChannels: channels.totalCount,
};
}
return {
search,
setFilter,
@@ -161,6 +187,7 @@ function initUiActions(_store, _router) {
setBatch,
setSfw,
setTheme,
fetchStats,
};
}