dockge icon indicating copy to clipboard operation
dockge copied to clipboard

Container control buttons

Open mizady opened this issue 1 year ago • 31 comments

⚠️⚠️⚠️ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules: https://github.com/louislam/dockge/blob/master/CONTRIBUTING.md

Tick the checkbox if you understand [x]:

  • [x] I have read and understand the pull request rules.

Description

New Feature - Control of individual containers for starting, stopping, and restarting.

Fixes #(issue) Fixes having to restart or stop and start the entire stack when you just want to do one container

Type of change

  • User interface (UI)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update (only to change a screenshot so the service buttons are shown)

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] I ran ESLint and other linters for modified files (I didn't run it but the minor modifications kept to already used patterns and practices)
  • [x] I have performed a self-review of my own code and tested it
  • [x] I have commented my code, particularly in hard-to-understand areas (including JSDoc for methods)
  • [x] My changes generate no new warnings
  • [ ] My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)

Screenshot 2024-10-28 091747 Screenshot 2024-10-28 091922

mizady avatar Oct 28 '24 13:10 mizady

I didn't have any of the errors coming up in the checks when i built it or when i ran the built docker container on my end. Most all of those errors appear to be code I did not modify so I'm not sure if that is relevant to these modifications.

mizady avatar Oct 28 '24 13:10 mizady

Waiting for this!

Chathula avatar Oct 30 '24 19:10 Chathula

@louislam why we don't merge this pr?

Chathula avatar Nov 14 '24 15:11 Chathula

@louislam please merge this, this feature is the only feature I think is missing from dockge

xHyperElectric avatar Dec 01 '24 05:12 xHyperElectric

Waiting for this to be in the Image.

m3baid avatar Dec 02 '24 14:12 m3baid

@Chathula, @M3BAID I was curious about this being merged too...however, if you haven't forked and merged this yourself and curious to see controls, feel free to pull from my fork...I merged a bunch of PRs that looked interesting or at least the ones I was interested in...

cmcooper1980 avatar Dec 22 '24 06:12 cmcooper1980

Could this please be merged? This is a very much required feature that will really make dockge stand out.

wsw70 avatar Feb 17 '25 07:02 wsw70

I tried this when merged on my fork, and seem to have no effect on the containers ...

Triskae avatar Feb 24 '25 22:02 Triskae

@Triskae not sure if anything changed as there has been some version changes to a lot of packages and I have not updated and tested my dockge docker build as I spent far longer than i'd like to admit getting it to build on my test system at the time. I did put a docker image up on docker hub thejericko/dockge:latest but like I said it's not the latest dockge version since the update was released right after I built that.

mizady avatar Feb 25 '25 02:02 mizady

@Triskae not sure if anything changed as there has been some version changes to a lot of packages and I have not updated and tested my dockge docker build as I spent far longer than i'd like to admit getting it to build on my test system at the time. I did put a docker image up on docker hub thejericko/dockge:latest but like I said it's not the latest dockge version since the update was released right after I built that.

I understand, I will take a look if can make it work ! Or if you want, you can take a look too.

I spent far longer than i'd like to admit getting it to build on my test system

Ooooh yeah me too .... on macos with M2 Chip impossible for me to getting it to build, had to create a linux VM ....

Triskae avatar Feb 25 '25 07:02 Triskae

FYI, when testing this I noticed that I'm getting quite a few JS warnings in my browser. Add the new "processing" prop and the "start-service", "stop-service" and "restart-service" events to the container component seemed to fix them (see https://github.com/tobi1449/dockge/commit/ee0c54b2e9ae7e56a00d97bcdaf8220204aef9e9).

tobi1449 avatar Mar 01 '25 11:03 tobi1449

It would be awesome to merge this

wsw70 avatar Apr 29 '25 11:04 wsw70

I'm also working on trying to get it to hide the buttons when there is only one container in a stack so I'll post the code if I do. It is much less intrusive without the bright yellow and red but it's also very redundant if the stack only has one container.

Dracrius avatar Jun 06 '25 05:06 Dracrius

I figured out a pretty simple method to hide the controls in single container stacks. You can find the changes in Commit 789f25a on my fork.

Simply put by adding serviceCount() to compute:

        serviceCount() {
            return Object.keys(this.jsonObject.services).length;
        },

we can add this.serviceCount > 1 to the v-if for each button and they will automatically hide in instances where a stack only has a single container.

Single Container Active:

image

Single Container Inactive:

image

Multi Container Active:

image

Multi Container Inactive:

image

Dracrius avatar Jun 07 '25 05:06 Dracrius

~~@Triskae did you ever find a cause for the buttons not doing anything? I can't believe I didn't test them more before modifying it haha I kind of figured @tobi1449 changes were enough to make them work properly. Unfortunatly it didnt, pressing any of the buttons just greys them out.~~

~~My changes only effect button style and hiding the buttons when not needed so reverting those still gives me the same result as you.~~

Edit: I was attempting to use the buttons on containers controlled by an agent without this PR. Having this PR on each agent allows you to control containers from any agent without issue.

Dracrius avatar Jun 07 '25 15:06 Dracrius

@Triskae did you ever find a cause for the buttons not doing anything? I can't believe I didn't test them more before modifying it haha I kind of figured @tobi1449 changes were enough to make them work properly. Unfortunatly it didnt, pressing any of the buttons just greys them out.

My changes only effect button style and hiding the buttons when not needed so reverting those still gives me the same result as you.

The buttons work in my fork:

oz1Boy

Before I rebased to the newer 1.50, the v1.41 of my fork did have this problem and I can't remember but I believe whatever @tobi1449 did did fix it but other stuff was broken such as PR #623 and there was one other that wasn't working so instead of trying to fix and not knowing what else would break or was broken, I just started over and rebased to 1.50 only merging PRs I knew 100% worked or I could get working after merge.

cmcooper1980 avatar Jun 07 '25 18:06 cmcooper1980

@Triskae did you ever find a cause for the buttons not doing anything? I can't believe I didn't test them more before modifying it haha I kind of figured @tobi1449 changes were enough to make them work properly. Unfortunatly it didnt, pressing any of the buttons just greys them out. My changes only effect button style and hiding the buttons when not needed so reverting those still gives me the same result as you.

The buttons work in my fork:

Before I rebased to the newer 1.50, the v1.41 of my fork did have this problem and I can't remember but I believe whatever @tobi1449 did did fix it but other stuff was broken such as PR #623 and there was one other that wasn't working so instead of trying to fix and not knowing what else would break or was broken, I just started over and rebased to 1.50 only merging PRs I knew 100% worked or I could get working after merge.

Oh Interesting, let me clarify after seeing your example I enabled the buttons on single container stacks and yes they work great there. It seem the bug is in stacks with multiple containers do you have any to test with on your end?

SingleContainer

MultiContainer

Note: I've also done test with just this commit and see the same results. Works for a single container stack but not any of my multi container stacks.

Dracrius avatar Jun 07 '25 21:06 Dracrius

@Dracrius yes, my buttons work fine with single and multi container stacks:

brave_Cbo2XC

cmcooper1980 avatar Jun 08 '25 08:06 cmcooper1980

@Dracrius yes, my buttons work fine with single and multi container stacks:

Interestingly I have found a stack that also works perfectly fine. My own combo stack of headscale, headscale ui and tailscale works without issue with the independent control buttons. ~~I'm curious what could be causing it to not work on others.~~

Edit: I'm a fool it was a stack managed by another agent. I updated my other agent with the same image and this will solved the issue.

Dracrius avatar Jun 09 '25 01:06 Dracrius

Hi is there a forked docker image with this changes it would make my life so much easiear :)

GamerClassN7 avatar Aug 04 '25 22:08 GamerClassN7

Hi is there a forked docker image with this changes it would make my life so much easiear :)

there sure is, unless you are already on my fork and still not working for you...in which case, nevermind LOL

cmcooper1980 avatar Aug 05 '25 04:08 cmcooper1980

@cmcooper1980 this is really cool, thanks! @louislam merging this PR would be awesome (there are other PRs also merged by @cmcooper1980 in the fork). It brings dockge to almost perfection (the "almost" being, selfishly, the ability to change the size of the columns :))

wsw70 avatar Aug 05 '25 14:08 wsw70

@cmcooper1980 i tryed your branch in past but UI was broken image

thehere is possible fix but it is not inclooded unforchunatelly: https://github.com/louislam/dockge/pull/800

GamerClassN7 avatar Aug 07 '25 21:08 GamerClassN7

@cmcooper1980 i tryed your branch in past but UI was broken image

thehere is possible fix but it is not inclooded unforchunatelly: #800

how long ago was the past? I haven't had an issue since rebased to 1.50 (there were some issues with previous version). Oh are you referring the to background/colored panel?

cmcooper1980 avatar Aug 07 '25 21:08 cmcooper1980

@cmcooper1980 i tryed your branch in past but UI was broken image

thehere is possible fix but it is not inclooded unforchunatelly: #800

how long ago was the past? I haven't had an issue since rebased to 1.50 (there were some issues with previous version). Oh are you referring the to background/colored panel?

Hi, like some times back and yesterday I tested the latest build of yours :) functionality is definitely there but most of the tasks ended in error in console/ since I have many remote hosts and many containers UI felt broken...

Could it be that I switched official image for yours and did not do a clean install ?

GamerClassN7 avatar Aug 08 '25 16:08 GamerClassN7

Could it be that I switched official image for yours and did not do a clean install ?

I switched by changing the image name in the docker compose and it went flawlessly

wsw70 avatar Aug 08 '25 17:08 wsw70

It is a shame that this has not been merged into master. I'm afraid I'm going to have to switch to another docker management service as this one seems to be completely abandoned.

xHyperElectric avatar Aug 08 '25 21:08 xHyperElectric

t is a shame that this has not been merged into master. I'm afraid I'm going to have to switch to another docker management service as this one seems to be completely abandoned.

It is not abandoned author is just taking its time you can see the same trend on UpTimeKuma container :) Probabli dooing this work in his free time so it is understandable :)

GamerClassN7 avatar Aug 09 '25 18:08 GamerClassN7

It is not abandoned author is just taking its time you can see the same trend on UpTimeKuma container :)

I had no idea that he was also the author of UptimeKuma!

wsw70 avatar Aug 09 '25 18:08 wsw70

Yeah, not abandoned...otherwise I think he'd have archived the project...plus those that are anxious for new features or fixes can try some of the communities' forks that have implemented some of the pull requests. @GamerClassN7, I actually tried to merge #800 previously and tried again yesterday, there is a conflict in the StackList.vue file which I removed and merged. Unfortunately, after the build and spin up the entire list of containers on the left goes missing. I tried different adjustments, however, I am not proficient in VUE to fix this...I'm not even completely sure it is strictly the StackList.vue file that may be causing it. I was successful in merging and testing #834 and #827, I was looking to merge a couple more before uploading an updated release...but probably best to keep this thread about this PR and other talk go into Discussions.

cmcooper1980 avatar Aug 09 '25 20:08 cmcooper1980