From 71435fca0f40f7266fbe5b59c399c044b2c53bf4 Mon Sep 17 00:00:00 2001 From: wandercone <137902980+wandercone@users.noreply.github.com> Date: Wed, 25 Mar 2026 07:07:05 -0500 Subject: [PATCH] feat(dockerMan): add Save-only button to save template without recreating container or authoring mode --- .../include/CreateDocker.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php b/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php index 794faadfbe..412d3a833d 100755 --- a/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php +++ b/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php @@ -71,12 +71,11 @@ function cpu_pinning() { if (isset($_POST['contName'])) { $postXML = postToXML($_POST, true); $dry_run = isset($_POST['dryRun']) && $_POST['dryRun']=='true'; + $save_only = isset($_POST['saveOnly']) && $_POST['saveOnly']=='true'; $existing = _var($_POST,'existingContainer',false); - $create_paths = $dry_run ? false : true; + $create_paths = ($dry_run || $save_only) ? false : true; // Get the command line [$cmd, $Name, $Repository] = xmlToCommand($postXML, $create_paths); - readfile("$docroot/plugins/dynamix.docker.manager/log.htm"); - @flush(); // Saving the generated configuration file. $userTmplDir = $dockerManPaths['templates-user']; if (!is_dir($userTmplDir)) mkdir($userTmplDir, 0777, true); @@ -93,6 +92,13 @@ function cpu_pinning() { } file_put_contents($filename, $postXML); } + // Save only - template written, navigate back without log output + if ($save_only) { + echo ""; + goto END; + } + readfile("$docroot/plugins/dynamix.docker.manager/log.htm"); + @flush(); // Run dry if ($dry_run) { echo "