Custom process accordions

There is a half-implemented feature that should enable the admin to add custom processes to the control server to be launched from within the dashboard.

Idea

The idea is to configure custom accordion panels inside Server -> config -> ui-config.json with the folloing syntax:

[
  {
    "title": <your title>,
    "body": <panel description>,
    "command": <command to execute>,
    "args": [<array of args as strings>]
  }
]

The control server server.js should read this file and send it to the frontend. The frontend should interpret the incoming list and render the necessary accordion modules accordingly. Each module should have a text field to show the process' output and a button to start/stop the process. On clicking 'start', the frontend calls localhost:7273/api/start-custom-process with the correct custom-process-id. On clicking stop, localhost:7273/api/stop-custom-process is called in the same way.

Important

The custom commands to be executed are only(!) specified control-server-side inside ui-config.json and must not be forwarded to the frontend. The frontend should only call start-custom-process and stop-custom-process by sending an id. This is to ensure there is no way of remote code execution on the server via the dashboard web page.

Alread implemented

The following is already implemented:

  1. The control server already validates ui-config.json on startup. If the file is missing or incorrect, a warning is displayed in the cmd window after running start.bat

  2. The control server sends the list of specified modules when http://localhost:7273/api/get-additional-panels is called with GET

  3. The frontend calls http://localhost:7273/api/get-additional-panels on startup, saves the incoming modules in data.additionalPanels and renders them correctly

ToDo

  1. In the frontend, the start/stop button is missing currently. Add a button to the procedually rendered accordion modules and add a function to that button, that calls start-custom-process or stop-custom-process together with the right ID depending on the state of the process (start if stopped, stop if currently running)

  2. Implement start-custom-process and stop-custom-process in server.js. Expect an id and start/stop the defined process corresponding to that id. Throw an error, if the id is unknown. Remember to use authentification to ensure no unauthorized code execution is possible.

  3. Once the frontend features are fully implemented and thoroughly tested, bundle the frontend and move the bundled output to Server/www to make the control server use the new frontend