show.html.haml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. - content_for :page_title do
  2. = @instance.domain
  3. - if current_user.can?(:view_dashboard)
  4. - content_for :heading_actions do
  5. = l(@time_period.first)
  6. = ' - '
  7. = l(@time_period.last)
  8. - if @instance.persisted?
  9. %p
  10. = fa_icon 'info fw'
  11. = t('admin.instances.totals_time_period_hint_html')
  12. .dashboard
  13. .dashboard__item
  14. = react_admin_component :counter, measure: 'instance_accounts', start_at: @time_period.first, end_at: @time_period.last, params: { domain: @instance.domain }, label: t('admin.instances.dashboard.instance_accounts_measure'), href: admin_accounts_path(origin: 'remote', by_domain: @instance.domain)
  15. .dashboard__item
  16. = react_admin_component :counter, measure: 'instance_statuses', start_at: @time_period.first, end_at: @time_period.last, params: { domain: @instance.domain }, label: t('admin.instances.dashboard.instance_statuses_measure')
  17. .dashboard__item
  18. = react_admin_component :counter, measure: 'instance_media_attachments', start_at: @time_period.first, end_at: @time_period.last, params: { domain: @instance.domain }, label: t('admin.instances.dashboard.instance_media_attachments_measure')
  19. .dashboard__item
  20. = react_admin_component :counter, measure: 'instance_follows', start_at: @time_period.first, end_at: @time_period.last, params: { domain: @instance.domain }, label: t('admin.instances.dashboard.instance_follows_measure')
  21. .dashboard__item
  22. = react_admin_component :counter, measure: 'instance_followers', start_at: @time_period.first, end_at: @time_period.last, params: { domain: @instance.domain }, label: t('admin.instances.dashboard.instance_followers_measure')
  23. .dashboard__item
  24. = react_admin_component :counter, measure: 'instance_reports', start_at: @time_period.first, end_at: @time_period.last, params: { domain: @instance.domain }, label: t('admin.instances.dashboard.instance_reports_measure'), href: admin_reports_path(by_target_domain: @instance.domain)
  25. .dashboard__item
  26. = react_admin_component :dimension, dimension: 'instance_accounts', start_at: @time_period.first, end_at: @time_period.last, params: { domain: @instance.domain }, limit: 8, label: t('admin.instances.dashboard.instance_accounts_dimension')
  27. .dashboard__item
  28. = react_admin_component :dimension, dimension: 'instance_languages', start_at: @time_period.first, end_at: @time_period.last, params: { domain: @instance.domain }, limit: 8, label: t('admin.instances.dashboard.instance_languages_dimension')
  29. - else
  30. %p
  31. = t('admin.instances.unknown_instance')
  32. %hr.spacer/
  33. %h3= t('admin.instances.content_policies.title')
  34. - if limited_federation_mode?
  35. %p= t('admin.instances.content_policies.limited_federation_mode_description_html')
  36. - if @instance.domain_allow
  37. = link_to t('admin.domain_allows.undo'), admin_domain_allow_path(@instance.domain_allow), class: 'button button--destructive', data: { confirm: t('admin.accounts.are_you_sure'), method: :delete }
  38. - else
  39. = link_to t('admin.domain_allows.add_new'), admin_domain_allows_path(domain_allow: { domain: @instance.domain }), class: 'button', method: :post
  40. - else
  41. %p= t('admin.instances.content_policies.description_html')
  42. - if @instance.domain_block
  43. .table-wrapper
  44. %table.table.horizontal-table
  45. %tbody
  46. %tr
  47. %th= t('admin.instances.content_policies.comment')
  48. %td= @instance.domain_block.private_comment
  49. %tr
  50. %th= t('admin.instances.content_policies.reason')
  51. %td= @instance.domain_block.public_comment
  52. %tr
  53. %th= t('admin.instances.content_policies.policy')
  54. %td= @instance.domain_block.policies.map { |policy| t(policy, scope: 'admin.instances.content_policies.policies') }.join(' · ')
  55. = link_to t('admin.domain_blocks.edit'), edit_admin_domain_block_path(@instance.domain_block), class: 'button'
  56. = link_to t('admin.domain_blocks.undo'), admin_domain_block_path(@instance.domain_block), class: 'button', data: { confirm: t('admin.accounts.are_you_sure'), method: :delete }
  57. - else
  58. = link_to t('admin.domain_blocks.add_new'), new_admin_domain_block_path(_domain: @instance.domain), class: 'button'
  59. - if @instance.persisted?
  60. %hr.spacer/
  61. %h3= t('admin.instances.availability.title')
  62. %p
  63. = t('admin.instances.availability.description_html', count: DeliveryFailureTracker::FAILURE_DAYS_THRESHOLD)
  64. .availability-indicator
  65. %ul.availability-indicator__graphic
  66. - @instance.availability_over_days(14).each do |(date, failing)|
  67. %li.availability-indicator__graphic__item{ class: failing ? 'negative' : 'neutral', title: l(date) }
  68. .availability-indicator__hint
  69. - if @instance.unavailable?
  70. %span.negative-hint
  71. = t('admin.instances.availability.failure_threshold_reached', date: l(@instance.unavailable_domain.created_at.to_date))
  72. = link_to t('admin.instances.delivery.restart'), restart_delivery_admin_instance_path(@instance), data: { confirm: t('admin.accounts.are_you_sure'), method: :post }
  73. - elsif @instance.exhausted_deliveries_days.empty?
  74. %span.positive-hint
  75. = t('admin.instances.availability.no_failures_recorded')
  76. = link_to t('admin.instances.delivery.stop'), stop_delivery_admin_instance_path(@instance), data: { confirm: t('admin.accounts.are_you_sure'), method: :post }
  77. - else
  78. %span.negative-hint
  79. = t('admin.instances.availability.failures_recorded', count: @instance.delivery_failure_tracker.days)
  80. %span= link_to t('admin.instances.delivery.clear'), clear_delivery_errors_admin_instance_path(@instance), data: { confirm: t('admin.accounts.are_you_sure'), method: :post } unless @instance.exhausted_deliveries_days.empty?
  81. %span= link_to t('admin.instances.delivery.stop'), stop_delivery_admin_instance_path(@instance), data: { confirm: t('admin.accounts.are_you_sure'), method: :post }
  82. - if @instance.purgeable?
  83. %p= t('admin.instances.purge_description_html')
  84. = link_to t('admin.instances.purge'), admin_instance_path(@instance), data: { confirm: t('admin.instances.confirm_purge'), method: :delete }, class: 'button button--destructive'