[Plugin] Docker Folder


Recommended Posts

@GuildDarts Yeah, i figured it was missing the settings part from the config, however, it is there now and only thing it is complaining about is the includes method being used on the object rather than array. Also, in the PR comments there is a one-liner to fix this issue, so you dont have to rename and replace variables.

 

BTW, here is what the server response looks like right now (before the PR is merged), so no idea why and where it decides to go with the object instead of an array (well, kinda know why, due to the indexes in PHP on the array itself)

var prefs = {
    "0": "utilities-folder",
    "1": "pgadmin4",
    "2": "core-folder",
    "3": "traefik",
    "4": "portainer",
    "5": "unifi-controller",
    "6": "monitoring-folder",
    "7": "hddtemp",
    "8": "influxdb",
    "9": "telegraf",
    "10": "Grafana",
    "11": "development-folder",
    "12": "postgres",
    "13": "mariadb",
    "14": "redis",
    "15": "registry",
    "16": "portus",
    "17": "portus-worker",
    "18": "gitea",
    "19": "drone-server",
    "20": "drone-agent",
    "21": "drone-runner",
    "22": "media-server-folder",
    "23": "ombi",
    "24": "jackett",
    "25": "qbittorrent",
    "26": "sonarr",
    "27": "radarr",
    "28": "plex",
    "30": "gcs-development-folder"
};

And here is the folders.json output (now with all the fields necessary)

{
    "foldersVersion": 3,
    "settings": {
        "fix_docker_page_shifting": false
    },
    "folders": {
        "core": {
            "icon": "",
            "docker_preview": "none",
            "docker_preview_hover_only": false,
            "docker_preview_text_update_color": true,
            "docker_preview_icon_grayscale": false,
            "docker_preview_icon_show_log": true,
            "docker_preview_icon_show_webui": true,
            "docker_preview_advanced_context_menu": false,
            "docker_preview_advanced_context_menu_activation_mode": "click",
            "docker_preview_advanced_context_menu_graph_mode": "none",
            "docker_icon_style": "label-tab",
            "docker_expanded_style": "right",
            "docker_start_expanded": false,
            "dashboard_expanded": false,
            "dashboard_expanded_button": false,
            "icon_animate_hover": false,
            "status_icon_autostart": false,
            "regex": "",
            "buttons": [],
            "children": [
                "portainer",
                "traefik",
                "unifi-controller"
            ]
        },
        "monitoring": {
            "icon": "",
            "docker_preview": "none",
            "docker_preview_hover_only": false,
            "docker_preview_text_update_color": true,
            "docker_preview_icon_grayscale": false,
            "docker_preview_icon_show_log": true,
            "docker_preview_icon_show_webui": true,
            "docker_preview_advanced_context_menu": false,
            "docker_preview_advanced_context_menu_activation_mode": "click",
            "docker_preview_advanced_context_menu_graph_mode": "none",
            "docker_icon_style": "label-tab",
            "docker_expanded_style": "right",
            "docker_start_expanded": false,
            "dashboard_expanded": false,
            "dashboard_expanded_button": false,
            "icon_animate_hover": false,
            "status_icon_autostart": false,
            "regex": "",
            "buttons": [],
            "children": [
                "Grafana",
                "hddtemp",
                "influxdb",
                "telegraf"
            ]
        }
    }
}

 

Edited by darki73
Link to comment

@GuildDarts sure, no problem. Thank you for such a fast fixing =D And it works! To be honest, this should be the default plugin for the Unraid, having 30+ containers is a bit hard to manage. But i guess many people use Unraid as a home media server, so probably 4-6 containers maximum. Also, loving folders for docker-compose!

image.png.abd72fd0bf0dee59bb6535ba537bf2e0.png

Edited by darki73
  • Like 1
Link to comment
31 minutes ago, darki73 said:

Thank you for such a fast fixing =D And it works! To be honest, this should be the default plugin for the Unraid, having 30+ containers is a bit hard to manage. But i guess many people use Unraid as a home media server, so probably 4-6 containers maximum. Also, loving folders for docker-compose!

Thanks for the positive comment.
Yeah my main motivation for making it was when i was running mailcow. 18 containers for one app was just a bit too messy O.o
before-after.png

Edited by GuildDarts
  • Like 1
Link to comment
6 hours ago, shaunsund said:

Loving this plugin, but did notice something odd:1539828853_ScreenShot2020-08-13at1_00_03PM.thumb.png.22224d1603380609c6720afbe1adde2f.png

 

Image named '0' with wrong Icon for the image name. It can't be a orphaned image; I have a User Script that removes those.

That is indeed very odd. Just checked myself and i also have a docker named '0' tho it does not have a image.
docker.folder_0.png.9f84f7c30d1886a97cc4bd5f8e5bd3fb.png

Also checked squids CA Backup / Restore Appdata plugin, which is where i copy pasted the code that displays the dockers (shhh dont tell :D) and its also there
backup_0.png.4ed2b72e02c0e26bd0863ad4e7c21aad.png

Also checked CA Auto Update Applications and that does not have it. Will look at what that might be doing differently and see if i can fix it for docker.folder ^_^

  • Thanks 1
Link to comment
On 7/26/2020 at 6:29 AM, GuildDarts said:

Update

  • Added: Global settings
  • Added: Option to prevent docker page shifting
    @bambi73 This should fix it, the option is under "Global Settings" in the top right when editing/adding a folder.
    Changed a bit how the fix is a applied, so i hope it still works ^_^
  • Added: Preview webui icon

This update changes a few things about folders.json incase your folders are gone please report it. And there is a backup at "/boot/config/plugins/docker.folder/folders.backup.json"
This should not happen but just in case :)

Was bit out but finally got to test you last changes and everything works fine :)

  • Like 1
Link to comment

I believe this has been mentioned in this thread, however, search terms are hard 😕

 

In the normal docker list dockers start in that order, from top to bottom, implementing 'wait' if enabled.  What is the proper order that dockers start in when using folders?

 

Am I correct in thinking the order is as follows:

  • Folder 1
    • Docker 1 {Starts 1st}
      • [Wait: 60]
    • Docker 1.1 {Starts 2nd after 60 seconds}
    • Docker 1.2 {Starts 3rd}
  • Folder 2
    • Docker 2 {Starts 4th}
    • Docker 2.1 {Starts 5th}
    • Docker 2.2 {Starts 6th}

Again, thanks for the a great plugin and your prompt replies to all of these requests!

 

 

Edited by dtctechs
formatting
Link to comment
11 minutes ago, dtctechs said:

I believe this has been mentioned in this thread, however, search terms are hard 😕

 

In the normal docker list dockers start in that order, from top to bottom, implementing 'wait' if enabled.  What is the proper order that dockers start in when using folders?

 

Am I correct in thinking the order is as follows:

  • Folder 1
    • Docker 1 {Starts 1st}
      • [Wait: 60]
    • Docker 1.1 {Starts 2nd after 60 seconds}
    • Docker 1.2 {Starts 3rd}
  • Folder 2
    • Docker 2 {Starts 4th}
    • Docker 2.1 {Starts 5th}
    • Docker 2.2 {Starts 6th}

Again, thanks for the a great plugin and your prompt replies to all of these requests!

 

 

you are correct :D
tho if you make a folder and dont sort a folder/docker after, the displayed order might be lying.
you can see the order here "/boot/config/plugins/dockerMan/userprefs.cfg"

Link to comment

Update

  • Added: VM folder support
    @vw-kombi took a while but this is now a thing xD

  • Fixed: Oddly named dockers showing up

There might be a few bugs so watch out. In Case you find something check browser console for errors. Also if your folders are gone (not that i am expecting them to vanish :D) there is a backup at '/boot/config/plugins/docker.folder/folders.backup.json'

Link to comment

Yeah, pretty much the same. Everything in the folder is ordered as it is supposed to be (assuming you've ordered everything the way you need it to be ordered), however, when i order the folders themselves, upon F5/container update/changing page and going back it resets to the "random" order

 

This is how i want the folders to look like

image.thumb.png.f2cecf61de24fa78b23e1be2a8ed67b7.png

 

This is how WebUI sorting them

image.png.4504902ce9457d15c6936789d2d76cab.png

 

The WebUI is providing incorrect sorting, the folders.json file looks totally fine

Edited by darki73
Link to comment
3 hours ago, boomam said:

Latest update seems to have messed up my config, only seeing one folder, whereas before there were 5-6x.

Known bug? Or intended?

That's very much not intended :/
 

If you open browser console and refresh the page do you get any errors?
If you goto addFolder then in the top right there is a button called 'import/export' if you click it do you see all your folders there?
Do your folders also seem to come and go like @sjb217 or are they just gone
Are they missing on both the docker page and dashboard or just one of them?


Will also try and see if i can reproduce this

Link to comment

You can easily check if it is just a WebUI bug by executing the following command in the Unraid Terminal

cat /boot/config/plugins/docker.folder/folders.json

If you see all of your folders there, the next step is to go to the Unraid main page (assuming you are using Google Chrome), hit 

Ctrl + Shift + J

This will bring up developer console, go to the Console tab,navigate to Docker page and look for anything that might pop up in a red text in the console.

 

If you are seeing just this (sorta, it will be different for you in terms of IPs and stuff), then you are fine

image.thumb.png.32a65581a2807de84e6da4c96b41cbf0.png

 

And here is the example from this forum page

image.thumb.png.7b980d0c98ac4f9b8964a30b48fcfb52.png

If you see red lines like on the screenshot above on your Docker page, then make a screenshot and post it here (be aware, some sensitive data might be present on the screenshot, so be sure to mask it off)

 

Just a side note, but that what helped me when i had some strange issues with the folders

image.png.4d74386136474146485db125aea50c15.png

The foldersVersion should be at 4 (at least i think so), if it is not (lower than 4, or missing the settings variable in the json), it worth to simply (this will delete plugin folders configuration)

rm /boot/config/plugins/docker.folder/folders.json

Refresh Docker page 2 times (necessary to do it twice, first time it will give you error that file is not found, and on the second refresh you will be able to create folders just as you usually do), just recreate folders and you are good to go

Edited by darki73
  • Thanks 1
Link to comment

GuildDarts, thanks for staying on top of this!

 

I have re-installed your plug-in and set up my folders as I like them.

Things are stable for now, and the server passed all of the tests that were just recommended.

 

The one difference this time is that all of my folders have at least one active docker.

On previous attempts, I've had a folder(s) that contained all stopped dockers.

Is this not allowed?

 

Link to comment

@darki73 wow thanks for the very detailed steps. I really need to learn to format my typing like that:D

@sjb217 glad that its working :)
could you elaborate what you mean by 

24 minutes ago, sjb217 said:

The one difference this time is that all of my folders have at least one active docker.

On previous attempts, I've had a folder(s) that contained all stopped dockers.

Is this not allowed?

Not quite sure i'm totally getting your question sorry

Link to comment

@sjb217 It is allowed and working out of the box

image.thumb.png.af9635699f904aeda6ad05ab6af080e0.png

 

You can even start containers via the docker-compose.yml and corresponding folder will be created, it will even stay in the UI if you stop AND remove them (or maybe i made it long time ago, i dont remember tbh 😁)

 

P.S. If you have containers which are not assigned to any folder, they will remain alongside with folders, just like they used to be on the Docker page before you've installed that plugin. You can add stopped containers to folders you like, you can stop them all, and this folder will still be there waiting for you to start them up when you need to.

Edited by darki73
Link to comment
9 minutes ago, darki73 said:

@sjb217 It is allowed and working out of the box

image.thumb.png.af9635699f904aeda6ad05ab6af080e0.png

 

You can even start containers via the docker-compose.yml and corresponding folder will be created, it will even stay in the UI if you stop AND remove them (or maybe i made it long time ago, i dont remember tbh 😁)

 

P.S. If you have containers which are not assigned to any folder, they will remain alongside with folders, just like they used to be on the Docker page before you've installed that plugin. You can add stopped containers to folders you like, you can stop them all, and this folder will still be there waiting for you to start them up when you need to.

 

@GuildDarts, this is exactly what I was describing.

 

So after, reading the post from @darki73

I created a new folder with only stopped dockers. As soon as I clicked SUBMIT, I lost all folders.

Now when I click on the IMPORT/EXPORT button, the only folder showing is the one that killed it.

 

Capture.JPG.b6f4351a0d586ad68bad6874ce8d4ee0.JPG

 

 

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.