Closed DavesCodeMusings closed 2 years ago
Implemented quick commands that can be defined in data/quick_commands.json with a format of:
[
{
"id": "983bbf9f-3c71-4814-ac01-e6cf80c9cf0f",
"cmd": "service nginx configtest",
"filter": "nginx",
"tooltip": "Validate configuration"
},
{
"id": "c251bb37-a9b1-4392-97be-d9652b6b15af",
"cmd": "service nginx reload",
"filter": "nginx",
"tooltip": "Apply configuration"
}
]
Where id is a random uuid, cmd is the shell command, filter ensures the command only appears for containers with this string in the name, and tooltip is the text shown when a user hovers the mouse over the command link.
The Docker API accepts commands much like
docker exec
on command-line. (See below.)It would be nice to have a set of common commands that can be run by clicking/tapping, rather than typing. For example:
service nginx configtest
andservice nginx reload
. If the list of commands could be filtered based on container name that would be even better. For example, if the container name has 'nginx' in it, show the twoservice nginx ...
commands. If nginx is not in the container name, filter them out.Maybe like this:
Some cURL examples: