AI prompts
base on Monitor for Ruby on Rails applications' server resources # MissionControl::Servers
The goal of MissionControl::Servers is to provide a simple monitoring of the resources
on your Ruby on Rails application. You can either use this directly on the projects or create a separate Ruby on
Rails application to mount this in.
## Installation
Add this line to your application's Gemfile:
```ruby
bundle add "mission_control-servers"
bin/rails mission_control_servers:install:migrations
```
Add a mount to your `config/routes.rb`
```ruby
mount MissionControl::Servers::Engine => "/mission_control-servers"
```
## Configuration
Within your application, you can make some configuration changes in how the gem operates. Below are the default
configuration options. You can override these options by creating an initializer file.
For example, if you're wanting to use MissionControl::Servers in a single project, then there is no need to have
the ability to create multiple projects. You can set the `single_project_mode` to true which will hide the ability
to create new projects.
```ruby
# config/initializers/mission_control_servers.rb
MissionControl::Servers.configure do |config|
config.single_project_mode = true
end
```
## Usage
Create a project. Once you create a project, you can easily copy the script specific to that project.
Install a script which captures:
- Hostname
- CPU Usage
- Memory Usage
- Free Memory
- Free Disk Space
The data will be retained for 7 days automatically. After 7 days, the data will start truncating itself
so that it doesn't take up much disk space within the database.
If you would like to put the dashboard on something like a Raspberry Pi, you can use the `dark` parameter to
change the dashboard to a dark mode automatically. This will hopefully help provide a "hands off" approach to
setting up the kiosk mode.
You can also create public links with read only permissions.

## URL Configuration
### Dark Mode
```html
http://localhost:3000/mission_control-servers/projects?dark=true
```
### Interval
You can also adjust the interval when you have multiple servers on a project. The default setting is 10 seconds
between servers, but this can be adjusted with an URL Parameter. The `interval` value is entered in seconds.
```html
http://localhost:3000/mission_control-servers/projects?interval=10
```
### Combo History
By default, the CPU Usage and Memory Usage Line Chart will be combined, but you can add the URL Parameter `?combo=false` to
toggle this behavior. Default is `true`.
```html
http://localhost:3000/mission_control-servers/projects?combo=false
```

### Combining URL Parameters
If you need to change multiple settings, you can chain these in the URL Parameters.
```html
http://localhost:3000/mission_control-servers/projects?interval=30&dark=true&combo=false
```
## Protecting the Dashboard
You can protect the dashboard by using a constraint. This will allow you to only allow certain users to access
the dashboard. However, the ingress still needs to be accessible by the servers which are being monitored. In
order to install the script on the servers, you also have to expose the endpoint for the script.
```ruby
Rails.application.routes.draw do
MissionControl::Servers::RoutingHelpers.add_public_routes_helper(self)
constraints AdminConstraint do
mount MissionControl::Servers::Engine => "/mission_control-servers"
end
end
```
If you want to change the endpoint, you can do so by changing the mount path.
```ruby
Rails.application.routes.draw do
engine_mount_path = "/dashymcdashface"
MissionControl::Servers::RoutingHelpers.add_public_routes_helper(self, engine_mount_path)
constraints AdminConstraint do
mount MissionControl::Servers::Engine => engine_mount_path
end
end
```
In this example, we have directly given a path to the ingress, but locked down everything else to the AdminConstraint.
The AdminConstraint takes in the request and calls the `matches?` method. If the method returns true,
then the routes will be defined for that request.
```ruby
class AdminConstraint
def self.matches?(request)
true
end
end
```
## Demo
You can see a demo of the application at [https://dashboard.railsenv.com/](https://dashboard.railsenv.com/)
## Screenshots
Simple Installation

View all of your projects

Detailed Dashboard updates automatically

Dark Mode support added in v0.1.4 (you can set this with a URL Param dark=true)


## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
", Assign "at most 3 tags" to the expected json: {"id":"7698","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"