bugy / script-server

Web UI for your scripts with execution management
Other
1.52k stars 244 forks source link

FEATURE: "group": field in runner.json filled by parent folder name in conf/runners/ #699

Open ojtimsen opened 9 months ago

ojtimsen commented 9 months ago

Hello, ScriptServer checks the conf/runners folders for files with extension .json to load them as runner, even if they are placed in sub-folders of conf/runners.. This is a nice "feature" to allow a folder structure inside the "runners" folder to sort the runners into. To explain my current aim, the following example structure:

conf/runners/helpers conf/runners/helpers/show_groups.json conf/runners/helpers/show_users.json

In the .json I currently define statically that I want the runners be sorted into the "group": "helpers" but I ask myself, if there is a way to set in the "group": field the foldername of the folder where the .json file is stored in? If this would be possible, this would allow a very dynamic menu structure simply based on the folder name a .json file of a runner is placed into.

Thank you in advance for reading and again big thanks for this project! toj

bugy commented 9 months ago

Hi @ojtimsen , unfortunately this is not possible, but this is a nice proposal

bugy commented 8 months ago

Done, now this is possible to enable this behaviour via this option: https://github.com/bugy/script-server/wiki/Server-configuration#--group_by_folders (please note, that it's a nested property!). This option is enabled by default since 1.19

ojtimsen commented 8 months ago

Hi @bugy, thank you for this quick implementation.. I tested it a few seconds ago and I already love this "feature" and the default to enable it by default.. It directly worked in version 1.19 for me, after removing the "group" : "helpers" tag in the .json files of my runners.. Great week to you!