xh / hoist-core

🏗️ The XH Hoist toolkit for Grails
https://xh.io/
Apache License 2.0
7 stars 2 forks source link

Service support for admin actions #415

Open amcclain opened 1 month ago

amcclain commented 1 month ago

Goal is to build a better version of clearCaches, where a HoistService can spec out a set of actions it wishes to expose via the Hoist Admin Console "Services" tab.

Each "action" could map onto a method on the server. Actions could be given an admin-friendly displayName, which I envision Hoist React rendering as the text on a button. Any HOIST_ADMIN could call any defined action via the Services tab, without app devs needing to write a dedicated controller.

Actions could also be spec'd as primaryOnly, meaning they would only be enabled on the primary instance.

Could also consider supporting:

Would want to decide / plan ahead as to support for accepting args. I am wary of growing the scope in that way - seems like a significant additional complexity - but understand that certain actions might need an arg to be useful - although some use cases could be handled by adding additional methods.

If successful, could replace ambiguous clearCaches entirely.