nextcloud / app_api

Nextcloud AppAPI
https://apps.nextcloud.com/apps/app_api
GNU Affero General Public License v3.0
71 stars 6 forks source link

Add option to remove volume on ExApp removal #297

Closed andrey18106 closed 3 months ago

andrey18106 commented 3 months ago

Describe why it is important and where it will be useful

Currently, ExApps management is limited to the default narrowed number of actions (Install, enable/disable, remove).

It would be useful to extend ExApps management page, in particular the "Remove" action to allow selecting the option whether to remove ExApp volume (docker volume) or not (simple flag already available in API).

Describe your proposed solution

Add checkbox somewhere on ExApps management page (in sidebar) to allow administrator to remove ExApp and it's volume from the daemon.

Describe alternatives you've considered, if relevant

No response

Additional context

image

edward-ly commented 3 months ago

Sounds reasonable to me, but a couple points I want to clarify:

  1. I assume that the checkbox should be toggled on (to remove volume) by default?
  2. And that the checkbox should only appear when the ExApp is disabled?
  3. Would it be helpful to also add a text label explaining its behavior (something like "Delete data on remove")?
  4. Should the checkbox also appear next to the same buttons in the AppList (on the left side of the screenshot) as well?
  5. Does the checkbox have to be red or is that just for mockup purposes?
  6. How is the flag able to be passed into the uninstallApp function in ExAppsPageController.php? I could be missing something, but so far, I couldn't find any information on this. My best guess would be to update the route URL to something like /apps/uninstall/{appId}/{removeData}, but I'm not sure if that's right.
bigcat88 commented 3 months ago
  1. Yes, currently the delete volume option is only available in the CLI. It should be unticked by default.
  2. You are right, so yes here too.
  3. Yes, it should be clear that if you check the box, the data volume for ExApp will be deleted.
  4. No, so as not to overload the interface. It is very rare that you need to delete an ExApp volume containing data.
  5. This is for mockup only, checkbox should be in usual Nextcloud style.
  6. This is the $removeData parameter, which is already present.