Module: SolidStackWeb

Defined in:
lib/solid_stack_web.rb,
lib/solid_stack_web/engine.rb,
lib/solid_stack_web/version.rb,
app/models/solid_stack_web/job.rb,
app/models/solid_stack_web/audit_event.rb,
app/models/solid_stack_web/cable_stats.rb,
app/models/solid_stack_web/cache_stats.rb,
app/models/solid_stack_web/queue_stats.rb,
app/models/solid_stack_web/alert_webhook.rb,
app/models/solid_stack_web/cable_timeline.rb,
app/models/solid_stack_web/cache_timeline.rb,
app/models/solid_stack_web/cache_size_stats.rb,
app/helpers/solid_stack_web/application_helper.rb,
app/controllers/solid_stack_web/jobs_controller.rb,
app/models/solid_stack_web/failed_job_sparkline.rb,
app/models/solid_stack_web/throughput_sparkline.rb,
app/controllers/solid_stack_web/audit_controller.rb,
app/controllers/solid_stack_web/cable_controller.rb,
app/controllers/solid_stack_web/cache_controller.rb,
app/controllers/solid_stack_web/stats_controller.rb,
app/models/solid_stack_web/queue_depth_sparkline.rb,
app/controllers/solid_stack_web/queues_controller.rb,
app/models/solid_stack_web/error_frequency_report.rb,
app/controllers/solid_stack_web/history_controller.rb,
app/controllers/solid_stack_web/metrics_controller.rb,
app/controllers/solid_stack_web/dashboard_controller.rb,
app/controllers/solid_stack_web/processes_controller.rb,
app/controllers/solid_stack_web/application_controller.rb,
app/controllers/solid_stack_web/failed_jobs_controller.rb,
app/controllers/solid_stack_web/cable/purges_controller.rb,
app/controllers/solid_stack_web/cache/flushes_controller.rb,
app/controllers/solid_stack_web/cache_entries_controller.rb,
app/controllers/solid_stack_web/queues/pauses_controller.rb,
lib/generators/solid_stack_web/install/install_generator.rb,
app/controllers/solid_stack_web/cable_messages_controller.rb,
app/controllers/solid_stack_web/scheduled_jobs_controller.rb,
app/controllers/solid_stack_web/jobs/selections_controller.rb,
app/controllers/solid_stack_web/recurring_tasks_controller.rb,
lib/generators/solid_stack_web/install/migrations_generator.rb,
app/controllers/solid_stack_web/failed_jobs/errors_controller.rb,
app/controllers/solid_stack_web/cable/channel_purges_controller.rb,
app/controllers/solid_stack_web/recurring_tasks/runs_controller.rb,
app/controllers/solid_stack_web/failed_jobs/arguments_controller.rb,
app/controllers/solid_stack_web/failed_jobs/selections_controller.rb

Defined Under Namespace

Modules: ApplicationHelper, FailedJobs, Generators, Jobs Classes: AlertWebhook, ApplicationController, AuditController, AuditEvent, CableController, CableMessagesController, CableStats, CableTimeline, CacheController, CacheEntriesController, CacheSizeStats, CacheStats, CacheTimeline, DashboardController, Engine, ErrorFrequencyReport, FailedJobSparkline, FailedJobsController, HistoryController, Job, JobsController, MetricsController, ProcessesController, QueueDepthSparkline, QueueStats, QueuesController, RecurringTasksController, ScheduledJobsController, StatsController, ThroughputSparkline

Constant Summary collapse

VERSION =
"1.6.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.alert_failure_thresholdObject



34
35
36
# File 'lib/solid_stack_web.rb', line 34

def alert_failure_threshold
  @alert_failure_threshold
end

.alert_queue_thresholdsObject



38
39
40
# File 'lib/solid_stack_web.rb', line 38

def alert_queue_thresholds
  @alert_queue_thresholds || {}
end

.alert_slow_job_count_thresholdObject



42
43
44
# File 'lib/solid_stack_web.rb', line 42

def alert_slow_job_count_threshold
  @alert_slow_job_count_threshold
end

.alert_stale_process_thresholdObject



46
47
48
# File 'lib/solid_stack_web.rb', line 46

def alert_stale_process_threshold
  @alert_stale_process_threshold
end

.alert_webhook_cooldownObject



30
31
32
# File 'lib/solid_stack_web.rb', line 30

def alert_webhook_cooldown
  @alert_webhook_cooldown || 3600
end

.alert_webhook_urlObject



26
27
28
# File 'lib/solid_stack_web.rb', line 26

def alert_webhook_url
  @alert_webhook_url
end

.allow_value_previewObject



62
63
64
# File 'lib/solid_stack_web.rb', line 62

def allow_value_preview
  @allow_value_preview || false
end

.available_localesObject



66
67
68
# File 'lib/solid_stack_web.rb', line 66

def available_locales
  @available_locales || %i[en es]
end

.connects_toObject



18
19
20
# File 'lib/solid_stack_web.rb', line 18

def connects_to
  @connects_to
end

.dashboard_cardsObject



74
75
76
# File 'lib/solid_stack_web.rb', line 74

def dashboard_cards
  @dashboard_cards || []
end

.dashboard_refresh_intervalObject



50
51
52
# File 'lib/solid_stack_web.rb', line 50

def dashboard_refresh_interval
  @dashboard_refresh_interval || 5_000
end

.default_refresh_intervalObject



54
55
56
# File 'lib/solid_stack_web.rb', line 54

def default_refresh_interval
  @default_refresh_interval || 10_000
end


70
71
72
# File 'lib/solid_stack_web.rb', line 70

def nav_links
  @nav_links || []
end

.page_sizeObject



14
15
16
# File 'lib/solid_stack_web.rb', line 14

def page_size
  @page_size || 25
end

.search_results_limitObject



58
59
60
# File 'lib/solid_stack_web.rb', line 58

def search_results_limit
  @search_results_limit || 25
end

.slow_job_thresholdObject



22
23
24
# File 'lib/solid_stack_web.rb', line 22

def slow_job_threshold
  @slow_job_threshold
end

Class Method Details

.authenticate(&block) ⇒ Object



95
96
97
98
# File 'lib/solid_stack_web.rb', line 95

def authenticate(&block)
  @authenticate = block if block_given?
  @authenticate
end

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (SolidStackWeb)

    the object that the method was called on



91
92
93
# File 'lib/solid_stack_web.rb', line 91

def configure
  yield self
end

.current_actor(&block) ⇒ Object



100
101
102
103
# File 'lib/solid_stack_web.rb', line 100

def current_actor(&block)
  @current_actor = block if block_given?
  @current_actor
end

.deprecatorObject



105
106
107
# File 'lib/solid_stack_web.rb', line 105

def deprecator
  @deprecator ||= ActiveSupport::Deprecation.new("1.0", "SolidStackWeb")
end

.mount_pathObject

Returns the path at which the engine is mounted in the host application, derived automatically from the host’s routes. Host apps can use this to build links to the dashboard without hardcoding the mount path.

link_to "Dashboard", SolidStackWeb.mount_path


84
85
86
87
88
89
# File 'lib/solid_stack_web.rb', line 84

def mount_path
  route = Rails.application.routes.routes.find do |r|
    r.app.respond_to?(:app) && r.app.app == SolidStackWeb::Engine
  end
  route&.path&.spec&.to_s&.sub(%r{\(.*\)\z}, "") || "/"
end