README.md in mission_control-servers-0.3.1 vs README.md in mission_control-servers-0.3.2

- old
+ new

@@ -50,10 +50,15 @@ 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. + +![image](https://github.com/kobaltz/mission_control-servers/assets/635114/f867bb8a-e372-4e24-9823-7294a6bb4810) + + ## URL Configuration ### Dark Mode ```html @@ -96,16 +101,28 @@ 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 - get '/mission_control-servers/projects/:project_id/script', to: 'mission_control/servers/scripts#show' - post '/mission_control-servers/projects/:project_id/ingress', to: 'mission_control/servers/ingresses#create' - + 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,