@@ -178,13 +178,25 @@ defmodule Mobilizon.GraphQL.Resolvers.Admin do
|
||||
_ -> nil
|
||||
end
|
||||
|
||||
last_group_created =
|
||||
case Actors.list_actors(:Group) do
|
||||
%Page{elements: [group | _]} -> group
|
||||
_ -> nil
|
||||
end
|
||||
|
||||
{:ok,
|
||||
%{
|
||||
number_of_users: Statistics.get_cached_value(:local_users),
|
||||
number_of_events: Statistics.get_cached_value(:local_events),
|
||||
number_of_groups: Statistics.get_cached_value(:local_groups),
|
||||
number_of_comments: Statistics.get_cached_value(:local_comments),
|
||||
number_of_confirmed_participations_to_local_events:
|
||||
Statistics.get_cached_value(:confirmed_participations_to_local_events),
|
||||
number_of_reports: Mobilizon.Reports.count_opened_reports(),
|
||||
last_public_event_published: last_public_event_published
|
||||
number_of_followers: Statistics.get_cached_value(:instance_followers),
|
||||
number_of_followings: Statistics.get_cached_value(:instance_followings),
|
||||
last_public_event_published: last_public_event_published,
|
||||
last_group_created: last_group_created
|
||||
}}
|
||||
end
|
||||
|
||||
|
||||
@@ -70,11 +70,19 @@ defmodule Mobilizon.GraphQL.Schema.AdminType do
|
||||
end
|
||||
|
||||
object :dashboard do
|
||||
field(:last_public_event_published, :event, description: "Last public event publish")
|
||||
field(:last_public_event_published, :event, description: "Last public event published")
|
||||
field(:last_group_created, :group, description: "Last public group created")
|
||||
field(:number_of_users, :integer, description: "The number of local users")
|
||||
field(:number_of_events, :integer, description: "The number of local events")
|
||||
field(:number_of_comments, :integer, description: "The number of local comments")
|
||||
field(:number_of_groups, :integer, description: "The number of local groups")
|
||||
field(:number_of_reports, :integer, description: "The number of current opened reports")
|
||||
field(:number_of_followers, :integer, description: "The number of instance followers")
|
||||
field(:number_of_followings, :integer, description: "The number of instance followings")
|
||||
|
||||
field(:number_of_confirmed_participations_to_local_events, :integer,
|
||||
description: "The number of total confirmed participations to local events"
|
||||
)
|
||||
end
|
||||
|
||||
object :admin_settings do
|
||||
|
||||
Reference in New Issue
Block a user