mirror of
https://github.com/unraid/webgui.git
synced 2026-04-22 18:19:14 -05:00
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:
@@ -84,7 +84,10 @@ img.stopped{opacity:0.3;}
|
||||
$updateStatus = ($updateStatus == "true" || $updateStatus == "undef") ? 'true' : 'false';
|
||||
$running = ($ct['Running']) ? 'true' : 'false';
|
||||
$webGuiUrl = $info[$name]['url'];
|
||||
$contextMenus[] = sprintf("addDockerContainerContext('%s', '%s', '%s', %s, %s, %s, '%s', '%s');", addslashes($ct['Name']), addslashes($ct['ImageId']), addslashes($info[$name]['template']), $running, $updateStatus, $is_autostart, addslashes($webGuiUrl), $ct["Id"]);
|
||||
$Support = $ct['Support'];
|
||||
$Project = $ct['Project'];
|
||||
|
||||
$contextMenus[] = sprintf("addDockerContainerContext('%s', '%s', '%s', %s, %s, %s, '%s', '%s', '%s', '%s');", addslashes($ct['Name']), addslashes($ct['ImageId']), addslashes($info[$name]['template']), $running, $updateStatus, $is_autostart, addslashes($webGuiUrl), $ct["Id"], addslashes($info[$name]['Support']),addslashes($info[$name]['Project']));
|
||||
$shape = ($ct["Running"]) ? "play" : "square";
|
||||
$status = ($ct["Running"]) ? "started" : "stopped";
|
||||
|
||||
@@ -207,8 +210,8 @@ img.stopped{opacity:0.3;}
|
||||
<input type="button" onclick="addContainer()" value="Add Container"/>
|
||||
<input type="button" onclick="reloadUpdate()" value="Check for Updates"/>
|
||||
|
||||
<script src="/webGui/javascript/jquery.switchbutton.js"></script>
|
||||
<script src="/plugins/dynamix.docker.manager/javascript/docker.js"></script>
|
||||
<script src="<?autov('/webGui/javascript/jquery.switchbutton.js')?>"></script>
|
||||
<script src="<?autov('/plugins/dynamix.docker.manager/javascript/docker.js')?>"></script>
|
||||
<script>
|
||||
<?if ($display['resize']):?>
|
||||
function resize(bind) {
|
||||
|
||||
@@ -198,6 +198,7 @@ function postToXML($post, $setOwnership = false) {
|
||||
$xml->MyIP = xml_encode($post['contMyIP']);
|
||||
$xml->Privileged = (strtolower($post["contPrivileged"]) == 'on') ? 'true' : 'false';
|
||||
$xml->Support = xml_encode($post['contSupport']);
|
||||
$xml->Project = xml_encode($post['contProject']);
|
||||
$xml->Overview = xml_encode($post['contOverview']);
|
||||
$xml->Category = xml_encode($post['contCategory']);
|
||||
$xml->WebUI = xml_encode(trim($post['contWebUI']));
|
||||
@@ -262,6 +263,7 @@ function xmlToVar($xml) {
|
||||
$out['MyIP'] = isset($xml->MyIP) ? xml_decode($xml->MyIP) : '';
|
||||
$out['Privileged'] = xml_decode($xml->Privileged);
|
||||
$out['Support'] = xml_decode($xml->Support);
|
||||
$out['Project'] = xml_decode($xml->Project);
|
||||
$out['Overview'] = stripslashes(xml_decode($xml->Overview));
|
||||
$out['Category'] = xml_decode($xml->Category);
|
||||
$out['WebUI'] = xml_decode($xml->WebUI);
|
||||
@@ -1319,6 +1321,17 @@ optgroup.title{background-color:#625D5D;color:#FFFFFF;text-align:center;margin-t
|
||||
<p>Link to a support thread on Lime-Technology's forum.</p>
|
||||
</blockquote>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="<?=$authoring;?>">
|
||||
<td>Project Page:</td>
|
||||
<td><input type="text" name="contProject"></td>
|
||||
</tr>
|
||||
<tr class="<?=$authoring;?>">
|
||||
<td colspan="2">
|
||||
<blockquote class="inline_help">
|
||||
<p>Link to the project page (eg: www.plex.tv)</p>
|
||||
</blockquote>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="advanced">
|
||||
<td>Docker Hub URL:</td>
|
||||
|
||||
@@ -333,6 +333,12 @@ class DockerTemplates {
|
||||
|
||||
$Registry = $this->getTemplateValue($image, "Registry");
|
||||
$tmp['registry'] = ($Registry) ? $Registry : null;
|
||||
|
||||
$Support = $this->getTemplateValue($image, "Support");
|
||||
$tmp['Support'] = ($Support) ? $Support : null;
|
||||
|
||||
$Project = $this->getTemplateValue($image, "Project");
|
||||
$tmp['Project'] = ($Project) ? $Project : null;
|
||||
|
||||
if (!$tmp['updated'] || $reload) {
|
||||
if ($reload) $DockerUpdate->reloadUpdateStatus($image);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user