From f0797dcbcc8bbc5fce77f1fd35cfdc84cca98723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s?= Date: Wed, 4 Oct 2023 23:05:52 -0400 Subject: [PATCH] Update migrate page to stream results correctly under php-fpm, make a nice loader and style --- modules/backup_restore/restore.php | 19 ++++++++++++------- .../themes/default/css/style.css | 2 ++ .../themes/default/migration.tpl | 19 +++++++++++++------ 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/modules/backup_restore/restore.php b/modules/backup_restore/restore.php index 0e5fcd8..8a4c0a7 100644 --- a/modules/backup_restore/restore.php +++ b/modules/backup_restore/restore.php @@ -19,7 +19,8 @@ +----------------------------------------------------------------------+ | The Initial Developer is Issabel Foundation | +----------------------------------------------------------------------+ -*/ + */ + $module_name=basename(getcwd()); $documentRoot = $_SERVER["DOCUMENT_ROOT"]; include_once "$documentRoot/libs/paloSantoDB.class.php"; @@ -37,6 +38,7 @@ $backup_dir = $arrConfModule['dir']; +echo ""; if (isset($_REQUEST['filename'])){ $filename = escapeshellarg($_REQUEST['filename']); @@ -44,7 +46,7 @@ $filename = $backup_dir."/".$filename; if(is_file($filename)) { echo "
"; - + $padSize = ini_get('output_buffering'); $dahdi = ""; $cmd = "/usr/bin/issabel-helper migration $dahdi $filename"; $cmd .= " 2>&1 || echo \"err_flag\""; @@ -57,15 +59,18 @@ $error = true; break; } - echo $line."
"; + echo str_pad("$line
", $padSize); ob_flush(); - flush(); + @ flush(); } - pclose($file); + pclose($file); + echo "
"; - echo ""; + echo ""; + + } else { echo "$filename is not a file"; } } - +echo ""; diff --git a/modules/backup_restore/themes/default/css/style.css b/modules/backup_restore/themes/default/css/style.css index 32b5114..590c327 100644 --- a/modules/backup_restore/themes/default/css/style.css +++ b/modules/backup_restore/themes/default/css/style.css @@ -110,3 +110,5 @@ altura 0 (Elastix bug #1526) */ .droptrue, .droptrue2 { min-height: 20px; } + +*{padding:0;margin:0}.checkwrapper{display:flex;justify-content:center;align-items:center;background-color:#fff;zoom:.6;display:none;}.checkmark__circle{stroke-dasharray: 166;stroke-dashoffset: 166;stroke-width: 2;stroke-miterlimit: 10;stroke: #7ac142;fill: none;animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards}.checkmark{width: 56px;height: 56px;border-radius: 50%;display: block;stroke-width: 2;stroke: #fff;stroke-miterlimit: 10;margin: 10% auto;box-shadow: inset 0px 0px 0px #7ac142;animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both}.checkmark__check{transform-origin: 50% 50%;stroke-dasharray: 48;stroke-dashoffset: 48;animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards}@keyframes stroke{100%{stroke-dashoffset: 0}}@keyframes scale{0%, 100%{transform: none}50%{transform: scale3d(1.1, 1.1, 1)}}@keyframes fill{100%{box-shadow: inset 0px 0px 0px 30px #7ac142}} diff --git a/modules/backup_restore/themes/default/migration.tpl b/modules/backup_restore/themes/default/migration.tpl index 990bef9..2eecb04 100644 --- a/modules/backup_restore/themes/default/migration.tpl +++ b/modules/backup_restore/themes/default/migration.tpl @@ -1,7 +1,14 @@ - - - -
{php}echo _tr('Progress');{/php}
-
- +
+
+

{php}echo _tr('Progress');{/php}

+
+
+
+ +
+
+
+