2019-09-09 09:31:08 +02:00
|
|
|
<template>
|
2020-06-25 11:36:35 +02:00
|
|
|
<div>
|
|
|
|
<nav class="breadcrumb" aria-label="breadcrumbs">
|
|
|
|
<ul>
|
|
|
|
<li>
|
2020-11-30 10:24:11 +01:00
|
|
|
<router-link :to="{ name: RouteName.ADMIN }">{{
|
|
|
|
$t("Admin")
|
|
|
|
}}</router-link>
|
2020-06-25 11:36:35 +02:00
|
|
|
</li>
|
|
|
|
<li class="is-active">
|
2020-11-30 10:24:11 +01:00
|
|
|
<router-link :to="{ name: RouteName.ADMIN_DASHBOARD }">{{
|
|
|
|
$t("Dashboard")
|
|
|
|
}}</router-link>
|
2020-06-25 11:36:35 +02:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
<section>
|
|
|
|
<h1 class="title">{{ $t("Administration") }}</h1>
|
|
|
|
<div class="tile is-ancestor" v-if="dashboard">
|
|
|
|
<div class="tile is-vertical">
|
|
|
|
<div class="tile">
|
|
|
|
<div class="tile is-parent is-vertical is-6">
|
|
|
|
<article class="tile is-child box">
|
|
|
|
<p class="dashboard-number">{{ dashboard.numberOfEvents }}</p>
|
2020-10-15 11:04:05 +02:00
|
|
|
<p
|
|
|
|
v-html="
|
|
|
|
$t(
|
|
|
|
'Published events with <b>{comments}</b> comments and <b>{participations}</b> confirmed participations',
|
|
|
|
{
|
|
|
|
comments: dashboard.numberOfComments,
|
2020-11-30 10:24:11 +01:00
|
|
|
participations:
|
|
|
|
dashboard.numberOfConfirmedParticipationsToLocalEvents,
|
2020-10-15 11:04:05 +02:00
|
|
|
}
|
|
|
|
)
|
|
|
|
"
|
|
|
|
/>
|
2020-06-25 11:36:35 +02:00
|
|
|
</article>
|
|
|
|
<article class="tile is-child box">
|
2020-10-15 11:04:05 +02:00
|
|
|
<router-link :to="{ name: RouteName.ADMIN_GROUPS }">
|
|
|
|
<p class="dashboard-number">{{ dashboard.numberOfGroups }}</p>
|
|
|
|
<p>{{ $t("Groups") }}</p>
|
|
|
|
</router-link>
|
2020-06-25 11:36:35 +02:00
|
|
|
</article>
|
|
|
|
</div>
|
|
|
|
<div class="tile is-parent is-vertical">
|
|
|
|
<article class="tile is-child box">
|
|
|
|
<router-link :to="{ name: RouteName.USERS }">
|
|
|
|
<p class="dashboard-number">{{ dashboard.numberOfUsers }}</p>
|
|
|
|
<p>{{ $t("Users") }}</p>
|
|
|
|
</router-link>
|
|
|
|
</article>
|
2020-10-15 11:04:05 +02:00
|
|
|
<article class="tile is-child box">
|
|
|
|
<router-link :to="{ name: RouteName.RELAY_FOLLOWERS }">
|
2020-11-30 10:24:11 +01:00
|
|
|
<p class="dashboard-number">
|
|
|
|
{{ dashboard.numberOfFollowers }}
|
|
|
|
</p>
|
2020-10-15 11:04:05 +02:00
|
|
|
<p>{{ $t("Instances following you") }}</p>
|
|
|
|
</router-link>
|
|
|
|
</article>
|
|
|
|
</div>
|
|
|
|
<div class="tile is-parent is-vertical">
|
2020-06-25 11:36:35 +02:00
|
|
|
<article class="tile is-child box">
|
|
|
|
<router-link :to="{ name: RouteName.REPORTS }">
|
2020-11-30 10:24:11 +01:00
|
|
|
<p class="dashboard-number">
|
|
|
|
{{ dashboard.numberOfReports }}
|
|
|
|
</p>
|
2020-06-25 11:36:35 +02:00
|
|
|
<p>{{ $t("Opened reports") }}</p>
|
|
|
|
</router-link>
|
|
|
|
</article>
|
2020-10-15 11:04:05 +02:00
|
|
|
<article class="tile is-child box">
|
|
|
|
<router-link :to="{ name: RouteName.RELAY_FOLLOWINGS }">
|
2020-11-30 10:24:11 +01:00
|
|
|
<p class="dashboard-number">
|
|
|
|
{{ dashboard.numberOfFollowings }}
|
|
|
|
</p>
|
2020-10-15 11:04:05 +02:00
|
|
|
<p>{{ $t("Instances you follow") }}</p>
|
|
|
|
</router-link>
|
|
|
|
</article>
|
2020-06-25 11:36:35 +02:00
|
|
|
</div>
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
2020-10-15 11:04:05 +02:00
|
|
|
<div class="tile">
|
2020-11-30 10:24:11 +01:00
|
|
|
<div
|
|
|
|
class="tile is-parent is-vertical is-6"
|
|
|
|
v-if="dashboard.lastPublicEventPublished"
|
|
|
|
>
|
2020-10-15 11:04:05 +02:00
|
|
|
<article class="tile is-child box">
|
|
|
|
<router-link
|
|
|
|
:to="{
|
|
|
|
name: RouteName.EVENT,
|
|
|
|
params: { uuid: dashboard.lastPublicEventPublished.uuid },
|
|
|
|
}"
|
|
|
|
>
|
|
|
|
<p>{{ $t("Last published event") }}</p>
|
2020-11-30 10:24:11 +01:00
|
|
|
<p class="subtitle">
|
|
|
|
{{ dashboard.lastPublicEventPublished.title }}
|
|
|
|
</p>
|
|
|
|
<figure
|
|
|
|
class="image is-4by3"
|
|
|
|
v-if="dashboard.lastPublicEventPublished.picture"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
:src="dashboard.lastPublicEventPublished.picture.url"
|
|
|
|
/>
|
2020-10-15 11:04:05 +02:00
|
|
|
</figure>
|
|
|
|
</router-link>
|
|
|
|
</article>
|
|
|
|
</div>
|
2020-11-30 10:24:11 +01:00
|
|
|
<div
|
|
|
|
class="tile is-parent is-vertical"
|
|
|
|
v-if="dashboard.lastGroupCreated"
|
|
|
|
>
|
2020-06-25 11:36:35 +02:00
|
|
|
<article class="tile is-child box">
|
2020-10-15 11:04:05 +02:00
|
|
|
<router-link
|
|
|
|
:to="{
|
|
|
|
name: RouteName.GROUP,
|
2020-11-30 10:24:11 +01:00
|
|
|
params: {
|
|
|
|
preferredUsername: usernameWithDomain(
|
|
|
|
dashboard.lastGroupCreated
|
|
|
|
),
|
|
|
|
},
|
2020-10-15 11:04:05 +02:00
|
|
|
}"
|
|
|
|
>
|
|
|
|
<p>{{ $t("Last group created") }}</p>
|
|
|
|
<p class="subtitle">
|
|
|
|
{{
|
|
|
|
dashboard.lastGroupCreated.name ||
|
|
|
|
dashboard.lastGroupCreated.preferredUsername
|
|
|
|
}}
|
|
|
|
</p>
|
2020-11-30 10:24:11 +01:00
|
|
|
<figure
|
|
|
|
class="image is-4by3"
|
|
|
|
v-if="dashboard.lastGroupCreated.avatar"
|
|
|
|
>
|
2020-10-15 11:04:05 +02:00
|
|
|
<img :src="dashboard.lastGroupCreated.avatar.url" />
|
|
|
|
</figure>
|
|
|
|
</router-link>
|
2020-06-25 11:36:35 +02:00
|
|
|
</article>
|
2020-10-15 11:04:05 +02:00
|
|
|
</div>
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
2019-09-09 09:31:08 +02:00
|
|
|
</div>
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
2020-06-25 11:36:35 +02:00
|
|
|
</section>
|
|
|
|
</div>
|
2019-09-09 09:31:08 +02:00
|
|
|
</template>
|
|
|
|
<script lang="ts">
|
2020-02-18 08:57:00 +01:00
|
|
|
import { Component, Vue } from "vue-property-decorator";
|
|
|
|
import { DASHBOARD } from "@/graphql/admin";
|
|
|
|
import { IDashboard } from "@/types/admin.model";
|
2020-10-15 11:04:05 +02:00
|
|
|
import { usernameWithDomain } from "@/types/actor";
|
2020-02-18 08:57:00 +01:00
|
|
|
import RouteName from "../../router/name";
|
2019-09-09 09:31:08 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
apollo: {
|
|
|
|
dashboard: {
|
|
|
|
query: DASHBOARD,
|
2020-08-27 11:53:24 +02:00
|
|
|
fetchPolicy: "cache-and-network",
|
2019-09-09 09:31:08 +02:00
|
|
|
},
|
|
|
|
},
|
2019-12-03 11:29:51 +01:00
|
|
|
metaInfo() {
|
|
|
|
return {
|
2020-02-18 08:57:00 +01:00
|
|
|
title: this.$t("Administration") as string,
|
|
|
|
titleTemplate: "%s | Mobilizon",
|
2019-12-03 11:29:51 +01:00
|
|
|
};
|
|
|
|
},
|
2019-09-09 09:31:08 +02:00
|
|
|
})
|
|
|
|
export default class Dashboard extends Vue {
|
|
|
|
dashboard!: IDashboard;
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2019-10-03 12:32:20 +02:00
|
|
|
RouteName = RouteName;
|
2020-10-15 11:04:05 +02:00
|
|
|
|
|
|
|
usernameWithDomain = usernameWithDomain;
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-03-12 14:29:21 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2020-02-18 08:57:00 +01:00
|
|
|
.dashboard-number {
|
|
|
|
color: #3c376e;
|
|
|
|
font-size: 40px;
|
|
|
|
font-weight: 700;
|
|
|
|
line-height: 1.125;
|
|
|
|
}
|
2020-06-11 19:13:21 +02:00
|
|
|
|
2020-06-17 15:54:24 +02:00
|
|
|
.tile a,
|
|
|
|
article.tile a {
|
|
|
|
color: #4a4a4a;
|
|
|
|
text-decoration: none;
|
2020-06-11 19:13:21 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
</style>
|