From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo-Andres Hofmann To: development@lists.ipfire.org Subject: [PATCH 3/7] pakfire.cgi: Show error and log messages earlier Date: Sun, 08 May 2022 14:09:48 +0200 Message-ID: <20220508120952.52-3-hofmann@leo-andres.de> In-Reply-To: <20220508120952.52-1-hofmann@leo-andres.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4348323356411312894==" List-Id: --===============4348323356411312894== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The main page cannot be used while an installation is running. Therefore it makes more sense to generate the log output first. Signed-off-by: Leo-Andres Hofmann --- html/cgi-bin/pakfire.cgi | 79 ++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index 535168547..daa82e34c 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -212,7 +212,45 @@ END &Header::openpage($Lang::tr{'pakfire configuration'}, 1, $extraHead); &Header::openbigbox('100%', 'left', '', $errormessage); =20 -# Process Pakfire commands +# Show error message +if ($errormessage) { + &Header::openbox('100%', 'left', $Lang::tr{'error messages'}); + print "$errormessage \n"; + &Header::closebox(); +} + +# Show log output while Pakfire is running +if(&_is_pakfire_busy()) { + &Header::openbox("100%", "center", "Pakfire"); + + print < +
3D"$Lang::tr{'active'}"
+
+ $Lang::tr{'pakfire working'}
+
+ +
+
3D"$Lang::tr{'refresh'}"
+ + + +

+
+
+END
+;
+
+	&Header::closebox();
+	&Header::closebigbox();
+	&Header::closepage();
+	exit;
+}
+
+# Show Pakfire install/remove dependencies and confirm form
 if (($cgiparams{'ACTION'} eq 'install') && (! &_is_pakfire_busy())) {
 	&Header::openbox("100%", "center", $Lang::tr{'request'});
=20
@@ -290,6 +328,7 @@ END
 	exit;
 }
=20
+# Show Pakfire main page
 my %selected=3D();
 my %checked=3D();
=20
@@ -299,44 +338,6 @@ $selected{"TREE"}{"testing"} =3D "";
 $selected{"TREE"}{"unstable"} =3D "";
 $selected{"TREE"}{$pakfiresettings{"TREE"}} =3D "selected";
=20
-# DPC move error message to top so it is seen!
-if ($errormessage) {
-	&Header::openbox('100%', 'left', $Lang::tr{'error messages'});
-	print "$errormessage \n";
-	&Header::closebox();
-}
-
-# Show log output while Pakfire is running
-if(&_is_pakfire_busy()) {
-	&Header::openbox("100%", "center", "Pakfire");
-
-	print <
-	
3D"$Lang::tr{'active'}"
-
- $Lang::tr{'pakfire working'}
-
- -
-
3D"$Lang::tr{'refresh'}"
- - - -

-
-
-END
-;
-
-	&Header::closebox();
-	&Header::closebigbox();
-	&Header::closepage();
-	exit;
-}
-
 my $core_release =3D `cat /opt/pakfire/db/core/mine 2>/dev/null`;
 chomp($core_release);
 my $core_update_age =3D &General::age("/opt/pakfire/db/core/mine");
--=20
2.27.0.windows.1


--===============4348323356411312894==--