OpenMediaVault-Plugin-Developers / openmediavault-docker-gui

Docker plugin for OpenMediaVault
32 stars 17 forks source link

Enhancement Request - Restart Options #37

Closed 1activegeek closed 7 years ago

1activegeek commented 7 years ago

Just wanted to suggest a simple tweak to the options for restart of the container. Currently it has the option to "Restart on System Reboot". This option looks to be using the "always" option for Restart Policy. While hopefully OMV isn't being restarted often, there is an alternative restart option that I think is more beneficial and the desired restart state more often. If not, at least having the option to select the restart option would be extremely beneficial.

It would be great to see a dropdown option to let us just select the restart option, which perhaps the default of "Always" may work. Personally, I use "Unless-Stopped" option exclusively. Sometimes tests of containers happen, or for some reason I want to actually stop a container and not have it automatically restart just because the host system restarted. So having a quick option for this would be extremely useful.

Reference Documentation: https://docs.docker.com/engine/reference/run/#restart-policies---restart

subzero79 commented 7 years ago

Shouldn't be to hard to implement just to change the policy, If you want to send a PR. I would include a tooltip with a short explanation. Was this policy recently added to docker ? I don't recall until now.

1activegeek commented 7 years ago

It's been around for a little while now, I've been using for at least the past 4-5 months already. Personally I love it, since sometimes I spin down some containers for testing and/or an on demand basis as needed. Unfortunately, I'm not savvy with the plugins let alone the coding required to update the plugin, so I'm not likely to be able to figure out how to make the appropriate code changes and submit the PR. If I get a chance to, or if there is some direction that can be given to adjust this - I'm usually good at copying similar code and reverse engineering what it's doing. But outside that, I'm simply another "whiner" asking for functionality. So I wouldn't take offense or be disappointed if it takes awhile to be implemented.

subzero79 commented 7 years ago

I manage to copy some of the other function to have a dropdown menu with the restart policies. I did some work also on the backend so is working at the moment. The only problem is having "on-failure" which requires a subfield below the dropdown menu when is selected so it can input the max-retries. The modify button does also retain the policies. The idea is to have the full restart policy options so i won't PR until someone can help me there. Creating that small GUI feature is beyond my skills.

screen shot 2017-05-28 at 5 36 30 pm

subzero79 commented 7 years ago

Maybe the dropdown menu should be placed somewhere else

screen shot 2017-05-28 at 5 41 37 pm

1activegeek commented 7 years ago

That looks great! Wish I could answer the call to having those skills to help with the extra GUI option, but I'm no help there unfortunately. Maybe I'll get to learning more coding next year - this year is being filled with IoT and Networking for me. ☹️

subzero79 commented 7 years ago

Well I have a working version now. I went little bit further and added basic macvlan support. Is a drop down menu with macvlan selection and IP address field.

I am working on something else that is to retain the extra options on modify container button.

1activegeek commented 7 years ago

Happy to test if/when ready ... macvlan support will be great as well! I moved away from the need for macvlan recently, but it could make some things easier so I may still add it back in for a container or two. Having it right inside OMV will be fantastic.

subzero79 commented 7 years ago

Left it here BTW to test, eventually i will make PR if is all good

https://forum.openmediavault.org/index.php/Thread/11290-Docker-GUI-plugin-now-stable/?postID=146029#post146029

1activegeek commented 7 years ago

Ahh ok perfect. I'll mark this closed then. Looks good, I do see the option now. I will be going through to just update all my containers to use the new setting. Excellent work!! Thank you for the time/effort.