summaryrefslogtreecommitdiffstats
path: root/app/views/admin/dashboard/index.html.haml
blob: 8430dd3c4f1327600ff65882115f48d314e76ccb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
- content_for :page_title do
  = t('admin.dashboard.title')

- content_for :heading_actions do
  = l(@time_period.first)
  = ' - '
  = l(@time_period.last)

- unless @system_checks.empty?
  .flash-message-stack
    - @system_checks.each do |message|
      .flash-message{ class: message.critical ? 'alert' : 'warning' }
        = t("admin.system_checks.#{message.key}.message_html", value: message.value ? content_tag(:strong, message.value) : nil)
        - if message.action
          = link_to t("admin.system_checks.#{message.key}.action"), message.action

.dashboard
  .dashboard__item
    = react_admin_component :counter,
                            end_at: @time_period.last,
                            href: admin_accounts_path(origin: 'local'),
                            label: t('admin.dashboard.new_users'),
                            measure: 'new_users',
                            start_at: @time_period.first

  .dashboard__item
    = react_admin_component :counter,
                            end_at: @time_period.last,
                            href: admin_accounts_path(origin: 'local'),
                            label: t('admin.dashboard.active_users'),
                            measure: 'active_users',
                            start_at: @time_period.first

  .dashboard__item
    = react_admin_component :counter,
                            end_at: @time_period.last,
                            label: t('admin.dashboard.interactions'),
                            measure: 'interactions',
                            start_at: @time_period.first

  .dashboard__item
    = react_admin_component :counter,
                            end_at: @time_period.last,
                            href: admin_reports_path,
                            label: t('admin.dashboard.opened_reports'),
                            measure: 'opened_reports',
                            start_at: @time_period.first

  .dashboard__item
    = react_admin_component :counter,
                            end_at: @time_period.last,
                            href: admin_reports_path(resolved: '1'),
                            label: t('admin.dashboard.resolved_reports'),
                            measure: 'resolved_reports',
                            start_at: @time_period.first

  .dashboard__item
    = link_to admin_reports_path, class: 'dashboard__quick-access' do
      %span= t('admin.dashboard.pending_reports_html', count: @pending_reports_count)
      = material_symbol 'chevron_right'

    = link_to admin_accounts_path(status: 'pending'), class: 'dashboard__quick-access' do
      %span= t('admin.dashboard.pending_users_html', count: @pending_users_count)
      = material_symbol 'chevron_right'

    = link_to admin_trends_tags_path(status: 'pending_review'), class: 'dashboard__quick-access' do
      %span= t('admin.dashboard.pending_tags_html', count: @pending_tags_count)
      = material_symbol 'chevron_right'

    = link_to admin_disputes_appeals_path(status: 'pending'), class: 'dashboard__quick-access' do
      %span= t('admin.dashboard.pending_appeals_html', count: @pending_appeals_count)
      = material_symbol 'chevron_right'
  .dashboard__item
    = react_admin_component :dimension,
                            dimension: 'sources',
                            end_at: @time_period.last,
                            label: t('admin.dashboard.sources'),
                            limit: 8,
                            start_at: @time_period.first

  .dashboard__item
    = react_admin_component :dimension,
                            dimension: 'languages',
                            end_at: @time_period.last,
                            label: t('admin.dashboard.top_languages'),
                            limit: 8,
                            start_at: @time_period.first

  .dashboard__item
    = react_admin_component :dimension,
                            dimension: 'servers',
                            end_at: @time_period.last,
                            label: t('admin.dashboard.top_servers'),
                            limit: 8,
                            start_at: @time_period.first

  .dashboard__item.dashboard__item--span-double-column
    = react_admin_component :retention,
                            end_at: @time_period.last,
                            frequency: 'month',
                            start_at: @time_period.last - 6.months

  .dashboard__item.dashboard__item--span-double-row
    = react_admin_component :trends,
                            limit: 7

  .dashboard__item
    = react_admin_component :dimension,
                            dimension: 'software_versions',
                            end_at: @time_period.last,
                            label: t('admin.dashboard.software'),
                            limit: 4,
                            start_at: @time_period.first

  .dashboard__item
    = react_admin_component :dimension,
                            dimension: 'space_usage',
                            end_at: @time_period.last,
                            label: t('admin.dashboard.space'),
                            limit: 3,
                            start_at: @time_period.first