Add in Support & Project Links to Docker Context Menu

Every container added in via CA should already have the Support Link present (if added post 6.3)
Majority of apps in CA also have a project link present, but this will only thus far dockerMan hasn't saved that entry on user templates, so the Project link on the context menus will only appear for new containers added after the PR is aproved
This commit is contained in:
Squidly271
2018-01-27 10:13:15 -05:00
parent 430859ca5c
commit 6965583061
5 changed files with 37 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
var eventURL = "/plugins/dynamix.docker.manager/include/Events.php";
function addDockerContainerContext(container, image, template, started, update, autostart, webui, id) {
function addDockerContainerContext(container, image, template, started, update, autostart, webui, id, Support="", Project="") {
var opts = [{header: container, image: "/plugins/dynamix.docker.manager/images/dynamix.docker.manager.png"}];
if (started && (webui !== "" && webui != "#")) {
opts.push({text: 'WebUI', icon: 'fa-globe', href: webui, target: '_blank'});
@@ -25,6 +25,13 @@ function addDockerContainerContext(container, image, template, started, update,
}
opts.push({divider: true});
opts.push({text: 'Remove', icon: 'fa-trash', action: function(e){ e.preventDefault(); rmContainer(container, image, id); }});
if (Support) {
opts.push({divider: true});
opts.push({text: 'Support', icon: 'fa-question', href: Support, target: '_blank'});
}
if (Project) {
opts.push({text: 'Project Page', icon: 'fa-life-ring', href: Project, target: '_blank'});
}
context.attach('#context-'+container, opts);
}