From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter =?utf-8?q?M=C3=BCller?= To: development@lists.ipfire.org Subject: Re: [PATCH 3/7] pakfire.cgi: Show error and log messages earlier Date: Sun, 08 May 2022 13:12:06 +0000 Message-ID: In-Reply-To: <20220508120952.52-3-hofmann@leo-andres.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3320338232686061425==" List-Id: --===============3320338232686061425== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Acked-by: Peter M=C3=BCller > The main page cannot be used while an installation is running. > Therefore it makes more sense to generate the log output first. >=20 > Signed-off-by: Leo-Andres Hofmann > --- > html/cgi-bin/pakfire.cgi | 79 ++++++++++++++++++++-------------------- > 1 file changed, 40 insertions(+), 39 deletions(-) >=20 > 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");

--===============3320338232686061425==--