-
Notifications
You must be signed in to change notification settings - Fork 92
wip: Service manager #3134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
wip: Service manager #3134
Conversation
Reviewer's Guide by SourceryThis pull request implements a work-in-progress service manager feature by modifying both frontend and backend components. On the frontend, it updates the SettingsMenu layout to integrate a new ServiceDisabler component for toggling service states. On the backend, it adds new API endpoints in the commander and versionchooser services to manage environment variables and control (kill/restart) services. Additional utility functions and service definitions have been added to support these operations, along with corresponding OpenAPI spec updates and minor UI/styling improvements. Sequence diagram for ServiceDisabler toggle interactionsequenceDiagram
actor User
participant SD as ServiceDisabler
participant CS as CommanderStore
participant API as Commander API
participant VAPI as VersionChooser API
User->>SD: Toggle service switch (e.g., disable/enable 'autopilot')
alt Service Disable
SD->>CS: killService('autopilot')
CS->>API: POST /services/kill(service_name='autopilot', i_know_what_i_am_doing=true)
API-->>CS: 200 OK
else Service Enable
SD->>CS: restartService('autopilot')
CS->>API: POST /services/restart(service_name='autopilot', i_know_what_i_am_doing=true)
API-->>CS: 200 OK
end
SD->>CS: Retrieve current environment variables
CS->>API: GET /environment_variables
API-->>CS: Environment variables
CS->>VAPI: GET /version-chooser/v1.0/version/environment_variables
VAPI-->>CS: Version environment variables
alt Service Disable
CS->>API: POST /version-chooser/v1.0/version/environment_variables
note right of API: Update disable list to include service
else Service Enable
CS->>API: POST /version-chooser/v1.0/version/environment_variables
note right of API: Update disable list to remove service
end
SD-->>User: Display success notification
Updated CommanderStore & Service Definitions Class DiagramclassDiagram
class CommanderStore {
+getVersionChooserEnvironmentVariables() : Promise<Record<string, unknown> | undefined>
+setVersionChooserEnvironmentVariables(variables: Record<string, unknown>) : Promise<void>
+setEnvironmentVariables(variables: Record<string, unknown>) : Promise<void>
+killService(service: string) : Promise<void>
+restartService(service: string) : Promise<void>
}
class Service {
+command : string
+memory_limit : int
+priority : bool
}
note for Service "Represents a BlueOS service with command, memory limit, and priority attributes."
note for CommanderStore "Manages API interactions for service state updates and environment variable operations."
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
cf31246
to
5b62ae4
Compare
frontend updates serviceDisabler: update
version chooser more
5b62ae4
to
3c815de
Compare
@ES-Alexander mentioned this should probably be on "available services" instead. that does mean we need to make sure the "tmux" names of the services can be properly mapped to the available services entries |
fix #2868
needs some cleanup

Summary by Sourcery
Add a service management section to the settings menu, allowing users to enable or disable BlueOS services.
New Features:
Tests: