Fix lint issues
And disable eslint when building in prod mode Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
<nav class="breadcrumb" aria-label="breadcrumbs">
|
||||
<ul>
|
||||
<li>
|
||||
<router-link :to="{ name: RouteName.ADMIN }">{{ $t("Admin") }}</router-link>
|
||||
<router-link :to="{ name: RouteName.ADMIN }">{{
|
||||
$t("Admin")
|
||||
}}</router-link>
|
||||
</li>
|
||||
<li>
|
||||
<router-link
|
||||
@@ -26,9 +28,17 @@
|
||||
</nav>
|
||||
<div class="actor-card">
|
||||
<router-link
|
||||
:to="{ name: RouteName.GROUP, params: { preferredUsername: usernameWithDomain(group) } }"
|
||||
:to="{
|
||||
name: RouteName.GROUP,
|
||||
params: { preferredUsername: usernameWithDomain(group) },
|
||||
}"
|
||||
>
|
||||
<actor-card :actor="group" :full="true" :popover="false" :limit="false" />
|
||||
<actor-card
|
||||
:actor="group"
|
||||
:full="true"
|
||||
:popover="false"
|
||||
:limit="false"
|
||||
/>
|
||||
</router-link>
|
||||
</div>
|
||||
<table v-if="metadata.length > 0" class="table is-fullwidth">
|
||||
@@ -45,15 +55,25 @@
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="buttons">
|
||||
<b-button @click="confirmSuspendProfile" v-if="!group.suspended" type="is-primary">{{
|
||||
$t("Suspend")
|
||||
}}</b-button>
|
||||
<b-button @click="unsuspendProfile" v-if="group.suspended" type="is-primary">{{
|
||||
$t("Unsuspend")
|
||||
}}</b-button>
|
||||
<b-button @click="refreshProfile" v-if="group.domain" type="is-primary" outlined>{{
|
||||
$t("Refresh profile")
|
||||
}}</b-button>
|
||||
<b-button
|
||||
@click="confirmSuspendProfile"
|
||||
v-if="!group.suspended"
|
||||
type="is-primary"
|
||||
>{{ $t("Suspend") }}</b-button
|
||||
>
|
||||
<b-button
|
||||
@click="unsuspendProfile"
|
||||
v-if="group.suspended"
|
||||
type="is-primary"
|
||||
>{{ $t("Unsuspend") }}</b-button
|
||||
>
|
||||
<b-button
|
||||
@click="refreshProfile"
|
||||
v-if="group.domain"
|
||||
type="is-primary"
|
||||
outlined
|
||||
>{{ $t("Refresh profile") }}</b-button
|
||||
>
|
||||
</div>
|
||||
<section>
|
||||
<h2 class="subtitle">
|
||||
@@ -72,15 +92,33 @@
|
||||
:per-page="EVENTS_PER_PAGE"
|
||||
@page-change="onMembersPageChange"
|
||||
>
|
||||
<b-table-column field="actor.preferredUsername" :label="$t('Member')" v-slot="props">
|
||||
<b-table-column
|
||||
field="actor.preferredUsername"
|
||||
:label="$t('Member')"
|
||||
v-slot="props"
|
||||
>
|
||||
<article class="media">
|
||||
<figure class="media-left image is-48x48" v-if="props.row.actor.avatar">
|
||||
<img class="is-rounded" :src="props.row.actor.avatar.url" alt="" />
|
||||
<figure
|
||||
class="media-left image is-48x48"
|
||||
v-if="props.row.actor.avatar"
|
||||
>
|
||||
<img
|
||||
class="is-rounded"
|
||||
:src="props.row.actor.avatar.url"
|
||||
alt=""
|
||||
/>
|
||||
</figure>
|
||||
<b-icon class="media-left" v-else size="is-large" icon="account-circle" />
|
||||
<b-icon
|
||||
class="media-left"
|
||||
v-else
|
||||
size="is-large"
|
||||
icon="account-circle"
|
||||
/>
|
||||
<div class="media-content">
|
||||
<div class="content">
|
||||
<span v-if="props.row.actor.name">{{ props.row.actor.name }}</span
|
||||
<span v-if="props.row.actor.name">{{
|
||||
props.row.actor.name
|
||||
}}</span
|
||||
><br />
|
||||
<span class="is-size-7 has-text-grey"
|
||||
>@{{ usernameWithDomain(props.row.actor) }}</span
|
||||
@@ -90,22 +128,37 @@
|
||||
</article>
|
||||
</b-table-column>
|
||||
<b-table-column field="role" :label="$t('Role')" v-slot="props">
|
||||
<b-tag type="is-primary" v-if="props.row.role === MemberRole.ADMINISTRATOR">
|
||||
<b-tag
|
||||
type="is-primary"
|
||||
v-if="props.row.role === MemberRole.ADMINISTRATOR"
|
||||
>
|
||||
{{ $t("Administrator") }}
|
||||
</b-tag>
|
||||
<b-tag type="is-primary" v-else-if="props.row.role === MemberRole.MODERATOR">
|
||||
<b-tag
|
||||
type="is-primary"
|
||||
v-else-if="props.row.role === MemberRole.MODERATOR"
|
||||
>
|
||||
{{ $t("Moderator") }}
|
||||
</b-tag>
|
||||
<b-tag v-else-if="props.row.role === MemberRole.MEMBER">
|
||||
{{ $t("Member") }}
|
||||
</b-tag>
|
||||
<b-tag type="is-warning" v-else-if="props.row.role === MemberRole.NOT_APPROVED">
|
||||
<b-tag
|
||||
type="is-warning"
|
||||
v-else-if="props.row.role === MemberRole.NOT_APPROVED"
|
||||
>
|
||||
{{ $t("Not approved") }}
|
||||
</b-tag>
|
||||
<b-tag type="is-danger" v-else-if="props.row.role === MemberRole.REJECTED">
|
||||
<b-tag
|
||||
type="is-danger"
|
||||
v-else-if="props.row.role === MemberRole.REJECTED"
|
||||
>
|
||||
{{ $t("Rejected") }}
|
||||
</b-tag>
|
||||
<b-tag type="is-danger" v-else-if="props.row.role === MemberRole.INVITED">
|
||||
<b-tag
|
||||
type="is-danger"
|
||||
v-else-if="props.row.role === MemberRole.INVITED"
|
||||
>
|
||||
{{ $t("Invited") }}
|
||||
</b-tag>
|
||||
</b-table-column>
|
||||
@@ -143,11 +196,17 @@
|
||||
@page-change="onOrganizedEventsPageChange"
|
||||
>
|
||||
<b-table-column field="title" :label="$t('Title')" v-slot="props">
|
||||
<router-link :to="{ name: RouteName.EVENT, params: { uuid: props.row.uuid } }">
|
||||
<router-link
|
||||
:to="{ name: RouteName.EVENT, params: { uuid: props.row.uuid } }"
|
||||
>
|
||||
{{ props.row.title }}
|
||||
</router-link>
|
||||
</b-table-column>
|
||||
<b-table-column field="beginsOn" :label="$t('Begins on')" v-slot="props">
|
||||
<b-table-column
|
||||
field="beginsOn"
|
||||
:label="$t('Begins on')"
|
||||
v-slot="props"
|
||||
>
|
||||
{{ props.row.beginsOn | formatDateTimeString }}
|
||||
</b-table-column>
|
||||
<template slot="empty">
|
||||
@@ -177,11 +236,17 @@
|
||||
@page-change="onPostsPageChange"
|
||||
>
|
||||
<b-table-column field="title" :label="$t('Title')" v-slot="props">
|
||||
<router-link :to="{ name: RouteName.POST, params: { slug: props.row.slug } }">
|
||||
<router-link
|
||||
:to="{ name: RouteName.POST, params: { slug: props.row.slug } }"
|
||||
>
|
||||
{{ props.row.title }}
|
||||
</router-link>
|
||||
</b-table-column>
|
||||
<b-table-column field="publishAt" :label="$t('Publication date')" v-slot="props">
|
||||
<b-table-column
|
||||
field="publishAt"
|
||||
:label="$t('Publication date')"
|
||||
v-slot="props"
|
||||
>
|
||||
{{ props.row.publishAt | formatDateTimeString }}
|
||||
</b-table-column>
|
||||
<template slot="empty">
|
||||
@@ -254,11 +319,15 @@ export default class AdminGroupProfile extends Vue {
|
||||
const res: Record<string, string>[] = [
|
||||
{
|
||||
key: this.$t("Status") as string,
|
||||
value: (this.group.suspended ? this.$t("Suspended") : this.$t("Active")) as string,
|
||||
value: (this.group.suspended
|
||||
? this.$t("Suspended")
|
||||
: this.$t("Active")) as string,
|
||||
},
|
||||
{
|
||||
key: this.$t("Domain") as string,
|
||||
value: (this.group.domain ? this.group.domain : this.$t("Local")) as string,
|
||||
value: (this.group.domain
|
||||
? this.group.domain
|
||||
: this.$t("Local")) as string,
|
||||
},
|
||||
{
|
||||
key: this.$i18n.t("Uploaded media size") as string,
|
||||
@@ -360,14 +429,18 @@ export default class AdminGroupProfile extends Vue {
|
||||
},
|
||||
updateQuery: (previousResult, { fetchMoreResult }) => {
|
||||
if (!fetchMoreResult) return previousResult;
|
||||
const newOrganizedEvents = fetchMoreResult.group.organizedEvents.elements;
|
||||
const newOrganizedEvents =
|
||||
fetchMoreResult.group.organizedEvents.elements;
|
||||
return {
|
||||
group: {
|
||||
...previousResult.group,
|
||||
organizedEvents: {
|
||||
__typename: previousResult.group.organizedEvents.__typename,
|
||||
total: previousResult.group.organizedEvents.total,
|
||||
elements: [...previousResult.group.organizedEvents.elements, ...newOrganizedEvents],
|
||||
elements: [
|
||||
...previousResult.group.organizedEvents.elements,
|
||||
...newOrganizedEvents,
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -392,7 +465,10 @@ export default class AdminGroupProfile extends Vue {
|
||||
members: {
|
||||
__typename: previousResult.group.members.__typename,
|
||||
total: previousResult.group.members.total,
|
||||
elements: [...previousResult.group.members.elements, ...newMembers],
|
||||
elements: [
|
||||
...previousResult.group.members.elements,
|
||||
...newMembers,
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
<nav class="breadcrumb" aria-label="breadcrumbs">
|
||||
<ul>
|
||||
<li>
|
||||
<router-link :to="{ name: RouteName.ADMIN }">{{ $t("Admin") }}</router-link>
|
||||
<router-link :to="{ name: RouteName.ADMIN }">{{
|
||||
$t("Admin")
|
||||
}}</router-link>
|
||||
</li>
|
||||
<li>
|
||||
<router-link
|
||||
@@ -25,7 +27,12 @@
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="actor-card">
|
||||
<actor-card :actor="person" :full="true" :popover="false" :limit="false" />
|
||||
<actor-card
|
||||
:actor="person"
|
||||
:full="true"
|
||||
:popover="false"
|
||||
:limit="false"
|
||||
/>
|
||||
</div>
|
||||
<table v-if="metadata.length > 0" class="table is-fullwidth">
|
||||
<tbody>
|
||||
@@ -71,11 +78,17 @@
|
||||
:per-page="EVENTS_PER_PAGE"
|
||||
@page-change="onOrganizedEventsPageChange"
|
||||
>
|
||||
<b-table-column field="beginsOn" :label="$t('Begins on')" v-slot="props">
|
||||
<b-table-column
|
||||
field="beginsOn"
|
||||
:label="$t('Begins on')"
|
||||
v-slot="props"
|
||||
>
|
||||
{{ props.row.beginsOn | formatDateTimeString }}
|
||||
</b-table-column>
|
||||
<b-table-column field="title" :label="$t('Title')" v-slot="props">
|
||||
<router-link :to="{ name: RouteName.EVENT, params: { uuid: props.row.uuid } }">
|
||||
<router-link
|
||||
:to="{ name: RouteName.EVENT, params: { uuid: props.row.uuid } }"
|
||||
>
|
||||
{{ props.row.title }}
|
||||
</router-link>
|
||||
</b-table-column>
|
||||
@@ -97,7 +110,11 @@
|
||||
}}
|
||||
</h2>
|
||||
<b-table
|
||||
:data="person.participations.elements.map((participation) => participation.event)"
|
||||
:data="
|
||||
person.participations.elements.map(
|
||||
(participation) => participation.event
|
||||
)
|
||||
"
|
||||
:loading="$apollo.queries.person.loading"
|
||||
paginated
|
||||
backend-pagination
|
||||
@@ -105,11 +122,17 @@
|
||||
:per-page="EVENTS_PER_PAGE"
|
||||
@page-change="onParticipationsPageChange"
|
||||
>
|
||||
<b-table-column field="beginsOn" :label="$t('Begins on')" v-slot="props">
|
||||
<b-table-column
|
||||
field="beginsOn"
|
||||
:label="$t('Begins on')"
|
||||
v-slot="props"
|
||||
>
|
||||
{{ props.row.beginsOn | formatDateTimeString }}
|
||||
</b-table-column>
|
||||
<b-table-column field="title" :label="$t('Title')" v-slot="props">
|
||||
<router-link :to="{ name: RouteName.EVENT, params: { uuid: props.row.uuid } }">
|
||||
<router-link
|
||||
:to="{ name: RouteName.EVENT, params: { uuid: props.row.uuid } }"
|
||||
>
|
||||
{{ props.row.title }}
|
||||
</router-link>
|
||||
</b-table-column>
|
||||
@@ -127,7 +150,11 @@
|
||||
<script lang="ts">
|
||||
import { Component, Vue, Prop } from "vue-property-decorator";
|
||||
import { formatBytes } from "@/utils/datetime";
|
||||
import { GET_PERSON, SUSPEND_PROFILE, UNSUSPEND_PROFILE } from "../../graphql/actor";
|
||||
import {
|
||||
GET_PERSON,
|
||||
SUSPEND_PROFILE,
|
||||
UNSUSPEND_PROFILE,
|
||||
} from "../../graphql/actor";
|
||||
import { IPerson } from "../../types/actor";
|
||||
import { usernameWithDomain } from "../../types/actor/actor.model";
|
||||
import RouteName from "../../router/name";
|
||||
@@ -190,7 +217,10 @@ export default class AdminProfile extends Vue {
|
||||
if (!this.person.domain && this.person.user) {
|
||||
res.push({
|
||||
key: this.$t("User") as string,
|
||||
link: { name: RouteName.ADMIN_USER_PROFILE, params: { id: this.person.user.id } },
|
||||
link: {
|
||||
name: RouteName.ADMIN_USER_PROFILE,
|
||||
params: { id: this.person.user.id },
|
||||
},
|
||||
value: this.person.user.email,
|
||||
});
|
||||
}
|
||||
@@ -263,14 +293,18 @@ export default class AdminProfile extends Vue {
|
||||
},
|
||||
updateQuery: (previousResult, { fetchMoreResult }) => {
|
||||
if (!fetchMoreResult) return previousResult;
|
||||
const newOrganizedEvents = fetchMoreResult.person.organizedEvents.elements;
|
||||
const newOrganizedEvents =
|
||||
fetchMoreResult.person.organizedEvents.elements;
|
||||
return {
|
||||
person: {
|
||||
...previousResult.person,
|
||||
organizedEvents: {
|
||||
__typename: previousResult.person.organizedEvents.__typename,
|
||||
total: previousResult.person.organizedEvents.total,
|
||||
elements: [...previousResult.person.organizedEvents.elements, ...newOrganizedEvents],
|
||||
elements: [
|
||||
...previousResult.person.organizedEvents.elements,
|
||||
...newOrganizedEvents,
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -288,14 +322,18 @@ export default class AdminProfile extends Vue {
|
||||
},
|
||||
updateQuery: (previousResult, { fetchMoreResult }) => {
|
||||
if (!fetchMoreResult) return previousResult;
|
||||
const newParticipations = fetchMoreResult.person.participations.elements;
|
||||
const newParticipations =
|
||||
fetchMoreResult.person.participations.elements;
|
||||
return {
|
||||
person: {
|
||||
...previousResult.person,
|
||||
participations: {
|
||||
__typename: previousResult.person.participations.__typename,
|
||||
total: previousResult.person.participations.total,
|
||||
elements: [...previousResult.person.participations.elements, ...newParticipations],
|
||||
elements: [
|
||||
...previousResult.person.participations.elements,
|
||||
...newParticipations,
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
<nav class="breadcrumb" aria-label="breadcrumbs">
|
||||
<ul>
|
||||
<li>
|
||||
<router-link :to="{ name: RouteName.ADMIN }">{{ $t("Admin") }}</router-link>
|
||||
<router-link :to="{ name: RouteName.ADMIN }">{{
|
||||
$t("Admin")
|
||||
}}</router-link>
|
||||
</li>
|
||||
<li>
|
||||
<router-link
|
||||
@@ -29,10 +31,15 @@
|
||||
<tr v-for="{ key, value, link, elements, type } in metadata" :key="key">
|
||||
<td>{{ key }}</td>
|
||||
<td v-if="elements && elements.length > 0">
|
||||
<ul v-for="{ value, link: elementLink, active } in elements" :key="value">
|
||||
<ul
|
||||
v-for="{ value, link: elementLink, active } in elements"
|
||||
:key="value"
|
||||
>
|
||||
<li>
|
||||
<router-link :to="elementLink">
|
||||
<span v-if="active">{{ $t("{profile} (by default)", { profile: value }) }}</span>
|
||||
<span v-if="active">{{
|
||||
$t("{profile} (by default)", { profile: value })
|
||||
}}</span>
|
||||
<span v-else>{{ value }}</span>
|
||||
</router-link>
|
||||
</li>
|
||||
@@ -54,9 +61,12 @@
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="buttons">
|
||||
<b-button @click="deleteAccount" v-if="!user.disabled" type="is-primary">{{
|
||||
$t("Suspend")
|
||||
}}</b-button>
|
||||
<b-button
|
||||
@click="deleteAccount"
|
||||
v-if="!user.disabled"
|
||||
type="is-primary"
|
||||
>{{ $t("Suspend") }}</b-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -113,7 +123,9 @@ export default class AdminUserProfile extends Vue {
|
||||
},
|
||||
{
|
||||
key: this.$i18n.t("Login status"),
|
||||
value: this.user.disabled ? this.$i18n.t("Disabled") : this.$t("Activated"),
|
||||
value: this.user.disabled
|
||||
? this.$i18n.t("Disabled")
|
||||
: this.$t("Activated"),
|
||||
},
|
||||
{
|
||||
key: this.$i18n.t("Profiles"),
|
||||
@@ -123,7 +135,9 @@ export default class AdminUserProfile extends Vue {
|
||||
value: actor.name
|
||||
? `${actor.name} (${actor.preferredUsername})`
|
||||
: actor.preferredUsername,
|
||||
active: this.user.defaultActor ? actor.id === this.user.defaultActor.id : false,
|
||||
active: this.user.defaultActor
|
||||
? actor.id === this.user.defaultActor.id
|
||||
: false,
|
||||
};
|
||||
}),
|
||||
},
|
||||
@@ -138,7 +152,9 @@ export default class AdminUserProfile extends Vue {
|
||||
key: this.$i18n.t("Last sign-in"),
|
||||
value:
|
||||
this.$options.filters && this.user.currentSignInAt
|
||||
? this.$options.filters.formatDateTimeString(this.user.currentSignInAt)
|
||||
? this.$options.filters.formatDateTimeString(
|
||||
this.user.currentSignInAt
|
||||
)
|
||||
: this.$t("Unknown"),
|
||||
},
|
||||
{
|
||||
|
||||
@@ -3,10 +3,14 @@
|
||||
<nav class="breadcrumb" aria-label="breadcrumbs">
|
||||
<ul>
|
||||
<li>
|
||||
<router-link :to="{ name: RouteName.ADMIN }">{{ $t("Admin") }}</router-link>
|
||||
<router-link :to="{ name: RouteName.ADMIN }">{{
|
||||
$t("Admin")
|
||||
}}</router-link>
|
||||
</li>
|
||||
<li class="is-active">
|
||||
<router-link :to="{ name: RouteName.ADMIN_DASHBOARD }">{{ $t("Dashboard") }}</router-link>
|
||||
<router-link :to="{ name: RouteName.ADMIN_DASHBOARD }">{{
|
||||
$t("Dashboard")
|
||||
}}</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
@@ -24,7 +28,8 @@
|
||||
'Published events with <b>{comments}</b> comments and <b>{participations}</b> confirmed participations',
|
||||
{
|
||||
comments: dashboard.numberOfComments,
|
||||
participations: dashboard.numberOfConfirmedParticipationsToLocalEvents,
|
||||
participations:
|
||||
dashboard.numberOfConfirmedParticipationsToLocalEvents,
|
||||
}
|
||||
)
|
||||
"
|
||||
@@ -46,7 +51,9 @@
|
||||
</article>
|
||||
<article class="tile is-child box">
|
||||
<router-link :to="{ name: RouteName.RELAY_FOLLOWERS }">
|
||||
<p class="dashboard-number">{{ dashboard.numberOfFollowers }}</p>
|
||||
<p class="dashboard-number">
|
||||
{{ dashboard.numberOfFollowers }}
|
||||
</p>
|
||||
<p>{{ $t("Instances following you") }}</p>
|
||||
</router-link>
|
||||
</article>
|
||||
@@ -54,20 +61,27 @@
|
||||
<div class="tile is-parent is-vertical">
|
||||
<article class="tile is-child box">
|
||||
<router-link :to="{ name: RouteName.REPORTS }">
|
||||
<p class="dashboard-number">{{ dashboard.numberOfReports }}</p>
|
||||
<p class="dashboard-number">
|
||||
{{ dashboard.numberOfReports }}
|
||||
</p>
|
||||
<p>{{ $t("Opened reports") }}</p>
|
||||
</router-link>
|
||||
</article>
|
||||
<article class="tile is-child box">
|
||||
<router-link :to="{ name: RouteName.RELAY_FOLLOWINGS }">
|
||||
<p class="dashboard-number">{{ dashboard.numberOfFollowings }}</p>
|
||||
<p class="dashboard-number">
|
||||
{{ dashboard.numberOfFollowings }}
|
||||
</p>
|
||||
<p>{{ $t("Instances you follow") }}</p>
|
||||
</router-link>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tile">
|
||||
<div class="tile is-parent is-vertical is-6" v-if="dashboard.lastPublicEventPublished">
|
||||
<div
|
||||
class="tile is-parent is-vertical is-6"
|
||||
v-if="dashboard.lastPublicEventPublished"
|
||||
>
|
||||
<article class="tile is-child box">
|
||||
<router-link
|
||||
:to="{
|
||||
@@ -76,19 +90,33 @@
|
||||
}"
|
||||
>
|
||||
<p>{{ $t("Last published event") }}</p>
|
||||
<p class="subtitle">{{ dashboard.lastPublicEventPublished.title }}</p>
|
||||
<figure class="image is-4by3" v-if="dashboard.lastPublicEventPublished.picture">
|
||||
<img :src="dashboard.lastPublicEventPublished.picture.url" />
|
||||
<p class="subtitle">
|
||||
{{ dashboard.lastPublicEventPublished.title }}
|
||||
</p>
|
||||
<figure
|
||||
class="image is-4by3"
|
||||
v-if="dashboard.lastPublicEventPublished.picture"
|
||||
>
|
||||
<img
|
||||
:src="dashboard.lastPublicEventPublished.picture.url"
|
||||
/>
|
||||
</figure>
|
||||
</router-link>
|
||||
</article>
|
||||
</div>
|
||||
<div class="tile is-parent is-vertical" v-if="dashboard.lastGroupCreated">
|
||||
<div
|
||||
class="tile is-parent is-vertical"
|
||||
v-if="dashboard.lastGroupCreated"
|
||||
>
|
||||
<article class="tile is-child box">
|
||||
<router-link
|
||||
:to="{
|
||||
name: RouteName.GROUP,
|
||||
params: { preferredUsername: usernameWithDomain(dashboard.lastGroupCreated) },
|
||||
params: {
|
||||
preferredUsername: usernameWithDomain(
|
||||
dashboard.lastGroupCreated
|
||||
),
|
||||
},
|
||||
}"
|
||||
>
|
||||
<p>{{ $t("Last group created") }}</p>
|
||||
@@ -98,7 +126,10 @@
|
||||
dashboard.lastGroupCreated.preferredUsername
|
||||
}}
|
||||
</p>
|
||||
<figure class="image is-4by3" v-if="dashboard.lastGroupCreated.avatar">
|
||||
<figure
|
||||
class="image is-4by3"
|
||||
v-if="dashboard.lastGroupCreated.avatar"
|
||||
>
|
||||
<img :src="dashboard.lastGroupCreated.avatar.url" />
|
||||
</figure>
|
||||
</router-link>
|
||||
|
||||
@@ -3,10 +3,14 @@
|
||||
<nav class="breadcrumb" aria-label="breadcrumbs">
|
||||
<ul>
|
||||
<li>
|
||||
<router-link :to="{ name: RouteName.ADMIN }">{{ $t("Admin") }}</router-link>
|
||||
<router-link :to="{ name: RouteName.ADMIN }">{{
|
||||
$t("Admin")
|
||||
}}</router-link>
|
||||
</li>
|
||||
<li>
|
||||
<router-link :to="{ name: RouteName.RELAYS }">{{ $t("Federation") }}</router-link>
|
||||
<router-link :to="{ name: RouteName.RELAYS }">{{
|
||||
$t("Federation")
|
||||
}}</router-link>
|
||||
</li>
|
||||
<li class="is-active" v-if="$route.name == RouteName.RELAY_FOLLOWINGS">
|
||||
<router-link :to="{ name: RouteName.RELAY_FOLLOWINGS }">{{
|
||||
@@ -14,7 +18,9 @@
|
||||
}}</router-link>
|
||||
</li>
|
||||
<li class="is-active" v-if="$route.name == RouteName.RELAY_FOLLOWERS">
|
||||
<router-link :to="{ name: RouteName.RELAY_FOLLOWERS }">{{ $t("Followers") }}</router-link>
|
||||
<router-link :to="{ name: RouteName.RELAY_FOLLOWERS }">{{
|
||||
$t("Followers")
|
||||
}}</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
@@ -3,10 +3,14 @@
|
||||
<nav class="breadcrumb" aria-label="breadcrumbs">
|
||||
<ul>
|
||||
<li>
|
||||
<router-link :to="{ name: RouteName.MODERATION }">{{ $t("Moderation") }}</router-link>
|
||||
<router-link :to="{ name: RouteName.MODERATION }">{{
|
||||
$t("Moderation")
|
||||
}}</router-link>
|
||||
</li>
|
||||
<li class="is-active">
|
||||
<router-link :to="{ name: RouteName.PROFILES }">{{ $t("Groups") }}</router-link>
|
||||
<router-link :to="{ name: RouteName.PROFILES }">{{
|
||||
$t("Groups")
|
||||
}}</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
@@ -24,7 +28,11 @@
|
||||
@page-change="onPageChange"
|
||||
@filters-change="onFiltersChange"
|
||||
>
|
||||
<b-table-column field="preferredUsername" :label="$t('Username')" searchable>
|
||||
<b-table-column
|
||||
field="preferredUsername"
|
||||
:label="$t('Username')"
|
||||
searchable
|
||||
>
|
||||
<template slot="searchable" slot-scope="props">
|
||||
<b-input
|
||||
v-model="props.filters.preferredUsername"
|
||||
@@ -36,7 +44,10 @@
|
||||
<template v-slot:default="props">
|
||||
<router-link
|
||||
class="profile"
|
||||
:to="{ name: RouteName.ADMIN_GROUP_PROFILE, params: { id: props.row.id } }"
|
||||
:to="{
|
||||
name: RouteName.ADMIN_GROUP_PROFILE,
|
||||
params: { id: props.row.id },
|
||||
}"
|
||||
>
|
||||
<article class="media">
|
||||
<figure class="media-left" v-if="props.row.avatar">
|
||||
|
||||
@@ -3,10 +3,14 @@
|
||||
<nav class="breadcrumb" aria-label="breadcrumbs">
|
||||
<ul>
|
||||
<li>
|
||||
<router-link :to="{ name: RouteName.MODERATION }">{{ $t("Moderation") }}</router-link>
|
||||
<router-link :to="{ name: RouteName.MODERATION }">{{
|
||||
$t("Moderation")
|
||||
}}</router-link>
|
||||
</li>
|
||||
<li class="is-active">
|
||||
<router-link :to="{ name: RouteName.PROFILES }">{{ $t("Profiles") }}</router-link>
|
||||
<router-link :to="{ name: RouteName.PROFILES }">{{
|
||||
$t("Profiles")
|
||||
}}</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
@@ -24,7 +28,11 @@
|
||||
@page-change="onPageChange"
|
||||
@filters-change="onFiltersChange"
|
||||
>
|
||||
<b-table-column field="preferredUsername" :label="$t('Username')" searchable>
|
||||
<b-table-column
|
||||
field="preferredUsername"
|
||||
:label="$t('Username')"
|
||||
searchable
|
||||
>
|
||||
<template slot="searchable" slot-scope="props">
|
||||
<b-input
|
||||
v-model="props.filters.preferredUsername"
|
||||
@@ -36,7 +44,10 @@
|
||||
<template v-slot:default="props">
|
||||
<router-link
|
||||
class="profile"
|
||||
:to="{ name: RouteName.ADMIN_PROFILE, params: { id: props.row.id } }"
|
||||
:to="{
|
||||
name: RouteName.ADMIN_PROFILE,
|
||||
params: { id: props.row.id },
|
||||
}"
|
||||
>
|
||||
<article class="media">
|
||||
<figure class="media-left" v-if="props.row.avatar">
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
<nav class="breadcrumb" aria-label="breadcrumbs">
|
||||
<ul>
|
||||
<li>
|
||||
<router-link :to="{ name: RouteName.ADMIN }">{{ $t("Admin") }}</router-link>
|
||||
<router-link :to="{ name: RouteName.ADMIN }">{{
|
||||
$t("Admin")
|
||||
}}</router-link>
|
||||
</li>
|
||||
<li class="is-active">
|
||||
<router-link :to="{ name: RouteName.ADMIN_SETTINGS }">{{
|
||||
@@ -18,7 +20,9 @@
|
||||
<b-input v-model="adminSettings.instanceName" />
|
||||
</b-field>
|
||||
<div class="field">
|
||||
<label class="label has-help">{{ $t("Instance Short Description") }}</label>
|
||||
<label class="label has-help">{{
|
||||
$t("Instance Short Description")
|
||||
}}</label>
|
||||
<small>
|
||||
{{
|
||||
$t(
|
||||
@@ -26,7 +30,11 @@
|
||||
)
|
||||
}}
|
||||
</small>
|
||||
<b-input type="textarea" v-model="adminSettings.instanceDescription" rows="2" />
|
||||
<b-input
|
||||
type="textarea"
|
||||
v-model="adminSettings.instanceDescription"
|
||||
rows="2"
|
||||
/>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label has-help">{{ $t("Instance Slogan") }}</label>
|
||||
@@ -76,7 +84,9 @@
|
||||
</b-taginput>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label has-help">{{ $t("Instance Long Description") }}</label>
|
||||
<label class="label has-help">{{
|
||||
$t("Instance Long Description")
|
||||
}}</label>
|
||||
<small>
|
||||
{{
|
||||
$t(
|
||||
@@ -84,13 +94,19 @@
|
||||
)
|
||||
}}
|
||||
</small>
|
||||
<b-input type="textarea" v-model="adminSettings.instanceLongDescription" rows="4" />
|
||||
<b-input
|
||||
type="textarea"
|
||||
v-model="adminSettings.instanceLongDescription"
|
||||
rows="4"
|
||||
/>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label has-help">{{ $t("Instance Rules") }}</label>
|
||||
<small>
|
||||
{{
|
||||
$t("A place for your code of conduct, rules or guidelines. You can use HTML tags.")
|
||||
$t(
|
||||
"A place for your code of conduct, rules or guidelines. You can use HTML tags."
|
||||
)
|
||||
}}
|
||||
</small>
|
||||
<b-input type="textarea" v-model="adminSettings.instanceRules" />
|
||||
@@ -126,7 +142,9 @@
|
||||
<div class="column">
|
||||
<div
|
||||
class="notification"
|
||||
v-if="adminSettings.instanceTermsType === InstanceTermsType.DEFAULT"
|
||||
v-if="
|
||||
adminSettings.instanceTermsType === InstanceTermsType.DEFAULT
|
||||
"
|
||||
>
|
||||
<b>{{ $t("Default") }}</b>
|
||||
<i18n
|
||||
@@ -153,11 +171,15 @@
|
||||
v-if="adminSettings.instanceTermsType === InstanceTermsType.URL"
|
||||
>
|
||||
<b>{{ $t("URL") }}</b>
|
||||
<p class="content">{{ $t("Set an URL to a page with your own terms.") }}</p>
|
||||
<p class="content">
|
||||
{{ $t("Set an URL to a page with your own terms.") }}
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="notification"
|
||||
v-if="adminSettings.instanceTermsType === InstanceTermsType.CUSTOM"
|
||||
v-if="
|
||||
adminSettings.instanceTermsType === InstanceTermsType.CUSTOM
|
||||
"
|
||||
>
|
||||
<b>{{ $t("Custom") }}</b>
|
||||
<i18n
|
||||
@@ -221,7 +243,10 @@
|
||||
<div class="column">
|
||||
<div
|
||||
class="notification"
|
||||
v-if="adminSettings.instancePrivacyPolicyType === InstancePrivacyType.DEFAULT"
|
||||
v-if="
|
||||
adminSettings.instancePrivacyPolicyType ===
|
||||
InstancePrivacyType.DEFAULT
|
||||
"
|
||||
>
|
||||
<b>{{ $t("Default") }}</b>
|
||||
<i18n
|
||||
@@ -240,7 +265,10 @@
|
||||
</div>
|
||||
<div
|
||||
class="notification"
|
||||
v-if="adminSettings.instancePrivacyPolicyType === InstancePrivacyType.URL"
|
||||
v-if="
|
||||
adminSettings.instancePrivacyPolicyType ===
|
||||
InstancePrivacyType.URL
|
||||
"
|
||||
>
|
||||
<b>{{ $t("URL") }}</b>
|
||||
<p class="content">
|
||||
@@ -249,7 +277,10 @@
|
||||
</div>
|
||||
<div
|
||||
class="notification"
|
||||
v-if="adminSettings.instancePrivacyPolicyType === InstancePrivacyType.CUSTOM"
|
||||
v-if="
|
||||
adminSettings.instancePrivacyPolicyType ===
|
||||
InstancePrivacyType.CUSTOM
|
||||
"
|
||||
>
|
||||
<b>{{ $t("Custom") }}</b>
|
||||
<i18n
|
||||
@@ -272,24 +303,41 @@
|
||||
</b-field>
|
||||
<b-field
|
||||
:label="$t('Instance Privacy Policy URL')"
|
||||
v-if="adminSettings.instancePrivacyPolicyType === InstancePrivacyType.URL"
|
||||
v-if="
|
||||
adminSettings.instancePrivacyPolicyType === InstancePrivacyType.URL
|
||||
"
|
||||
>
|
||||
<b-input type="URL" v-model="adminSettings.instancePrivacyPolicyUrl" />
|
||||
<b-input
|
||||
type="URL"
|
||||
v-model="adminSettings.instancePrivacyPolicyUrl"
|
||||
/>
|
||||
</b-field>
|
||||
<b-field
|
||||
:label="$t('Instance Privacy Policy')"
|
||||
v-if="adminSettings.instancePrivacyPolicyType === InstancePrivacyType.CUSTOM"
|
||||
v-if="
|
||||
adminSettings.instancePrivacyPolicyType ===
|
||||
InstancePrivacyType.CUSTOM
|
||||
"
|
||||
>
|
||||
<b-input type="textarea" v-model="adminSettings.instancePrivacyPolicy" />
|
||||
<b-input
|
||||
type="textarea"
|
||||
v-model="adminSettings.instancePrivacyPolicy"
|
||||
/>
|
||||
</b-field>
|
||||
<b-button native-type="submit" type="is-primary">{{ $t("Save") }}</b-button>
|
||||
<b-button native-type="submit" type="is-primary">{{
|
||||
$t("Save")
|
||||
}}</b-button>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { Component, Vue, Watch } from "vue-property-decorator";
|
||||
import { ADMIN_SETTINGS, SAVE_ADMIN_SETTINGS, LANGUAGES } from "@/graphql/admin";
|
||||
import {
|
||||
ADMIN_SETTINGS,
|
||||
SAVE_ADMIN_SETTINGS,
|
||||
LANGUAGES,
|
||||
} from "@/graphql/admin";
|
||||
import { InstancePrivacyType, InstanceTermsType } from "@/types/enums";
|
||||
import { IAdminSettings, ILanguage } from "../../types/admin.model";
|
||||
import RouteName from "../../router/name";
|
||||
@@ -326,15 +374,19 @@ export default class Settings extends Vue {
|
||||
const variables = { ...this.adminSettings };
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
variables.instanceLanguages = variables.instanceLanguages.map((language) => {
|
||||
return this.codeForLanguage(language);
|
||||
});
|
||||
variables.instanceLanguages = variables.instanceLanguages.map(
|
||||
(language) => {
|
||||
return this.codeForLanguage(language);
|
||||
}
|
||||
);
|
||||
try {
|
||||
await this.$apollo.mutate({
|
||||
mutation: SAVE_ADMIN_SETTINGS,
|
||||
variables,
|
||||
});
|
||||
this.$notifier.success(this.$t("Admin settings successfully saved.") as string);
|
||||
this.$notifier.success(
|
||||
this.$t("Admin settings successfully saved.") as string
|
||||
);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
this.$notifier.error(this.$t("Failed to save admin settings") as string);
|
||||
@@ -345,7 +397,12 @@ export default class Settings extends Vue {
|
||||
this.filteredLanguages = this.languages
|
||||
? this.languages
|
||||
.filter((language: ILanguage) => {
|
||||
return language.name.toString().toLowerCase().indexOf(text.toLowerCase()) >= 0;
|
||||
return (
|
||||
language.name
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.indexOf(text.toLowerCase()) >= 0
|
||||
);
|
||||
})
|
||||
.map(({ name }) => name)
|
||||
: [];
|
||||
|
||||
@@ -3,10 +3,14 @@
|
||||
<nav class="breadcrumb" aria-label="breadcrumbs">
|
||||
<ul>
|
||||
<li>
|
||||
<router-link :to="{ name: RouteName.MODERATION }">{{ $t("Moderation") }}</router-link>
|
||||
<router-link :to="{ name: RouteName.MODERATION }">{{
|
||||
$t("Moderation")
|
||||
}}</router-link>
|
||||
</li>
|
||||
<li class="is-active">
|
||||
<router-link :to="{ name: RouteName.USERS }">{{ $t("Users") }}</router-link>
|
||||
<router-link :to="{ name: RouteName.USERS }">{{
|
||||
$t("Users")
|
||||
}}</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
@@ -40,7 +44,10 @@
|
||||
<template v-slot:default="props">
|
||||
<router-link
|
||||
class="user-profile"
|
||||
:to="{ name: RouteName.ADMIN_USER_PROFILE, params: { id: props.row.id } }"
|
||||
:to="{
|
||||
name: RouteName.ADMIN_USER_PROFILE,
|
||||
params: { id: props.row.id },
|
||||
}"
|
||||
:class="{ disabled: props.row.disabled }"
|
||||
>
|
||||
{{ props.row.email }}
|
||||
@@ -60,7 +67,12 @@
|
||||
{{ $t("Not confirmed") }}
|
||||
</template>
|
||||
</b-table-column>
|
||||
<b-table-column field="locale" :label="$t('Language')" :centered="true" v-slot="props">
|
||||
<b-table-column
|
||||
field="locale"
|
||||
:label="$t('Language')"
|
||||
:centered="true"
|
||||
v-slot="props"
|
||||
>
|
||||
{{ props.row.locale }}
|
||||
</b-table-column>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user