rails_nexus 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/rails_nexus/backup_controller.rb +74 -53
  3. data/app/models/rails_nexus/backup_config.rb +90 -0
  4. data/app/services/rails_nexus/backup_runner.rb +62 -0
  5. data/app/services/rails_nexus/backup_service.rb +215 -214
  6. data/app/views/layouts/rails_nexus/application.html.erb +8 -0
  7. data/app/views/rails_nexus/backup/_form.html.erb +185 -0
  8. data/app/views/rails_nexus/backup/config_history.html.erb +67 -0
  9. data/app/views/rails_nexus/backup/edit.html.erb +15 -0
  10. data/app/views/rails_nexus/backup/history.html.erb +60 -0
  11. data/app/views/rails_nexus/backup/index.html.erb +91 -147
  12. data/app/views/rails_nexus/backup/new.html.erb +15 -0
  13. data/config/routes.rb +9 -6
  14. data/lib/generators/rails_nexus/install_generator.rb +1 -13
  15. data/lib/generators/rails_nexus/templates/migration.rb +119 -11
  16. data/lib/generators/rails_nexus/templates/rails_nexus.rb +1 -1
  17. data/lib/rails_nexus/version.rb +1 -1
  18. data/lib/tasks/rails_nexus.rake +71 -0
  19. metadata +8 -16
  20. data/app/models/rails_nexus/database_stat.rb +0 -128
  21. data/app/models/rails_nexus/event.rb +0 -101
  22. data/app/models/rails_nexus/metric.rb +0 -107
  23. data/app/models/rails_nexus/nginx_metric.rb +0 -112
  24. data/app/models/rails_nexus/server_metric.rb +0 -168
  25. data/app/views/rails_nexus/backup/files.html.erb +0 -53
  26. data/app/views/rails_nexus/backup/settings.html.erb +0 -158
  27. data/config/initializers/rails_nexus.rb +0 -18
  28. data/db/migrate/20240330122311_create_rails_nexus_logged_exceptions.rb +0 -22
  29. data/lib/generators/rails_nexus/templates/migration_advanced_features.rb +0 -30
  30. data/lib/generators/rails_nexus/templates/migration_cron_jobs.rb +0 -22
  31. data/lib/generators/rails_nexus/templates/migration_new_schema.rb +0 -120
  32. data/lib/generators/rails_nexus/templates/migration_platform_detection.rb +0 -11
  33. data/lib/generators/rails_nexus/templates/migration_webhook_deliveries.rb +0 -21
  34. data/lib/generators/rails_nexus/templates/migration_workflow.rb +0 -29
@@ -1,22 +0,0 @@
1
- class CreateRailsNexusCronJobs < ActiveRecord::Migration[8.0]
2
- def change
3
- create_table :rails_nexus_cron_jobs do |t|
4
- t.string :name, null: false
5
- t.string :status, null: false, default: "pending"
6
- t.text :output
7
- t.text :error_message
8
- t.float :duration
9
- t.string :hostname
10
- t.json :metadata
11
- t.datetime :started_at
12
- t.datetime :finished_at
13
-
14
- t.timestamps
15
- end
16
-
17
- add_index :rails_nexus_cron_jobs, :name
18
- add_index :rails_nexus_cron_jobs, :status
19
- add_index :rails_nexus_cron_jobs, :created_at
20
- add_index :rails_nexus_cron_jobs, :started_at
21
- end
22
- end
@@ -1,120 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class CreateRailsNexusMetricsTables < ActiveRecord::Migration[8.0]
4
- def change
5
- # ─── rails_nexus_metrics ─────────────────────────────────────────
6
- create_table :rails_nexus_metrics do |t|
7
- t.string :metric_type, null: false
8
- t.float :value, null: false
9
- t.string :unit
10
- t.json :metadata
11
- t.datetime :recorded_at, null: false
12
- end
13
-
14
- add_index :rails_nexus_metrics, [:metric_type, :recorded_at]
15
- add_index :rails_nexus_metrics, :recorded_at
16
-
17
- # ─── rails_nexus_database_stats ──────────────────────────────────
18
- create_table :rails_nexus_database_stats do |t|
19
- t.integer :pool_size
20
- t.integer :busy
21
- t.integer :idle
22
- t.integer :dead
23
- t.integer :waiting
24
- t.float :utilization
25
- t.string :table_name
26
- t.bigint :table_rows
27
- t.string :table_size
28
- t.string :index_size
29
- t.string :data_free
30
- t.json :n1_patterns
31
- t.json :slow_queries
32
- t.datetime :recorded_at, null: false
33
- end
34
-
35
- add_index :rails_nexus_database_stats, :recorded_at
36
- add_index :rails_nexus_database_stats, :table_name
37
-
38
- # ─── rails_nexus_backups ─────────────────────────────────────────
39
- create_table :rails_nexus_backups do |t|
40
- t.string :model_name, null: false
41
- t.string :status, null: false
42
- t.text :file_path
43
- t.bigint :file_size
44
- t.float :duration
45
- t.text :error_message
46
- t.string :triggered_by
47
- t.datetime :started_at, null: false
48
- t.datetime :completed_at
49
- end
50
-
51
- add_index :rails_nexus_backups, [:model_name, :started_at]
52
- add_index :rails_nexus_backups, :status
53
- add_index :rails_nexus_backups, :started_at
54
-
55
- # ─── rails_nexus_server_metrics ──────────────────────────────────
56
- create_table :rails_nexus_server_metrics do |t|
57
- t.string :hostname
58
- t.string :ruby_version
59
- t.string :rails_version
60
- t.string :os_info
61
- t.float :cpu_usage
62
- t.integer :cpu_cores
63
- t.float :load_avg_1m
64
- t.float :load_avg_5m
65
- t.float :load_avg_15m
66
- t.bigint :memory_total
67
- t.bigint :memory_used
68
- t.bigint :memory_free
69
- t.bigint :swap_total
70
- t.bigint :swap_used
71
- t.bigint :disk_total
72
- t.bigint :disk_used
73
- t.float :disk_usage_percent
74
- t.integer :puma_workers
75
- t.integer :puma_threads
76
- t.integer :sidekiq_workers
77
- t.integer :sidekiq_processed
78
- t.integer :sidekiq_failed
79
- t.integer :sidekiq_enqueued
80
- t.float :uptime_seconds
81
- t.datetime :recorded_at, null: false
82
- end
83
-
84
- add_index :rails_nexus_server_metrics, :recorded_at
85
-
86
- # ─── rails_nexus_nginx_metrics ───────────────────────────────────
87
- create_table :rails_nexus_nginx_metrics do |t|
88
- t.integer :status_code, null: false
89
- t.string :request_method
90
- t.string :request_path
91
- t.float :response_time
92
- t.float :upstream_time
93
- t.string :remote_addr
94
- t.string :user_agent
95
- t.string :referer
96
- t.text :request_body
97
- t.json :metadata
98
- t.datetime :recorded_at, null: false
99
- end
100
-
101
- add_index :rails_nexus_nginx_metrics, [:status_code, :recorded_at]
102
- add_index :rails_nexus_nginx_metrics, :recorded_at
103
- add_index :rails_nexus_nginx_metrics, :request_path
104
-
105
- # ─── rails_nexus_events ──────────────────────────────────────────
106
- create_table :rails_nexus_events do |t|
107
- t.string :event_type, null: false
108
- t.string :eventable_type
109
- t.bigint :eventable_id
110
- t.json :metadata
111
- t.string :author
112
- t.text :message
113
- t.datetime :created_at, null: false
114
- end
115
-
116
- add_index :rails_nexus_events, [:eventable_type, :eventable_id]
117
- add_index :rails_nexus_events, :event_type
118
- add_index :rails_nexus_events, :created_at
119
- end
120
- end
@@ -1,11 +0,0 @@
1
- class AddPlatformToRailsNexusLoggedExceptions < ActiveRecord::Migration[8.0]
2
- def change
3
- add_column :rails_nexus_exceptions, :platform, :string, default: "web"
4
- add_column :rails_nexus_exceptions, :platform_version, :string
5
- add_column :rails_nexus_exceptions, :device_type, :string
6
- add_column :rails_nexus_exceptions, :app_version, :string
7
-
8
- add_index :rails_nexus_exceptions, :platform
9
- add_index :rails_nexus_exceptions, [:platform, :exception_class]
10
- end
11
- end
@@ -1,21 +0,0 @@
1
- class CreateRailsNexusWebhookDeliveries < ActiveRecord::Migration[8.0]
2
- def change
3
- create_table :rails_nexus_webhook_deliveries do |t|
4
- t.string :url, null: false
5
- t.string :status, null: false, default: "pending"
6
- t.integer :response_code
7
- t.text :request_body
8
- t.text :response_body
9
- t.float :duration
10
- t.text :error_message
11
- t.string :event_type
12
- t.json :metadata
13
-
14
- t.timestamps
15
- end
16
-
17
- add_index :rails_nexus_webhook_deliveries, :status
18
- add_index :rails_nexus_webhook_deliveries, :created_at
19
- add_index :rails_nexus_webhook_deliveries, :url
20
- end
21
- end
@@ -1,29 +0,0 @@
1
- # Migration for RailsNexus workflow management
2
- # Adds priority, assignment, snooze, mute columns and comments table
3
- class AddWorkflowToRailsNexus < ActiveRecord::Migration[8.0]
4
- def change
5
- # Workflow columns on logged_exceptions
6
- add_column :rails_nexus_exceptions, :priority, :string, default: nil
7
- add_column :rails_nexus_exceptions, :assigned_to, :string, default: nil
8
- add_column :rails_nexus_exceptions, :assigned_at, :datetime, default: nil
9
- add_column :rails_nexus_exceptions, :snoozed_until, :datetime, default: nil
10
- add_column :rails_nexus_exceptions, :muted, :boolean, default: false
11
- add_column :rails_nexus_exceptions, :muted_at, :datetime, default: nil
12
- add_column :rails_nexus_exceptions, :comments_count, :integer, default: 0
13
-
14
- add_index :rails_nexus_exceptions, :priority
15
- add_index :rails_nexus_exceptions, :assigned_to
16
- add_index :rails_nexus_exceptions, :muted
17
-
18
- # Comments table
19
- create_table :rails_nexus_comments do |t|
20
- t.references :logged_exception, null: false, foreign_key: { to_table: :rails_nexus_exceptions }
21
- t.string :author, null: false
22
- t.text :body, null: false
23
- t.string :comment_type, default: "comment" # comment, status_change, assignment, note
24
- t.timestamps
25
- end
26
-
27
- add_index :rails_nexus_comments, [:logged_exception_id, :created_at]
28
- end
29
- end