From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Hofmann To: development@lists.ipfire.org Subject: Re: [PATCH] webinterface: Add links to the configuration wiki Date: Mon, 20 Sep 2021 15:30:13 +0200 Message-ID: <3d47a7e7-9a27-fd3e-9332-e74be131fd00@leo-andres.de> In-Reply-To: <65a97ff8-3a06-b772-9a87-456134555f58@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5874614065365044060==" List-Id: --===============5874614065365044060== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Adolf, thank you for trying this and providing a new configuration file! This is gre= at! Since you have also come across missing pages, I should realize Bernhard's id= ea and build a test script. I'll implement all suggestions and submit again soon :) Regards, Leo Am 20.09.2021 um 15:06 schrieb Adolf Belka: > Hi Leo, > > I tried it out on my testbed vm system and it is working fine. > > I updated the manualpages file to include all the entries that are visible = in my System menu - no wireless client option as I don't have that on my vm i= nstall. You just have to keep an eye out for changes in the url as I found fo= r the fireinfo wiki page which is not under configuration/system so I got an = oops couldn't find that page message but was able to quickly fix it. > > My manualpages file now looks like:- > > ------------------------ > > index=3Dconfiguration/system/startpage > pppsetup=3Dconfiguration/system/dial > qos=3Dconfiguration/services/qos > mail=3Dconfiguration/system/mail_service > remote=3Dconfiguration/system/ssh > backup=3Dconfiguration/system/backup > gui=3Dconfiguration/system/userinterface > fireinfo=3Dfireinfo > vulnerabilities=3Dconfiguration/system/vulnerabilities > shutdown=3Dconfiguration/system/shutdown > credits=3Dconfiguration/system/credits > > ------------------------ > > Regards, > > Adolf. > > On 19/09/2021 16:34, Leo-Andres Hofmann wrote: >> This patch adds a little "help" icon to the page header. >> If a manual entry exists for a configuration page, the icon >> appears and offers a quick way to access the wiki. >> Wiki pages can be configured in the "manualpages" file. >> >> Signed-off-by: Leo-Andres Hofmann ---------------= --------- >> --- >> >> Hi all, >> >> This patch is not yet complete, but I would like to present the idea. >> What do you think, would this get more people to read the wiki? >> >> To test this, move the new file "manualpages" to /var/ipfire/main/ and CTR= L+F5 reload the webif to refresh the CSS cache. >> >> Still -to do- and where I could use some help: >> Add "manualpages" file to the updater/installer - how, and should this fil= e be read-only? >> Collect and match all wiki pages to the CGIs. >> >> Kind regards >> Leo >> >> =C2=A0 config/cfgroot/general-functions.pl=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 18 +++++++++++++++++- >> =C2=A0 config/cfgroot/manualpages=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |= =C2=A0 3 +++ >> =C2=A0 html/html/themes/ipfire/include/css/style.css | 13 +++++++++++++ >> =C2=A0 html/html/themes/ipfire/include/functions.pl=C2=A0 | 17 +++++++++++= +++++- >> =C2=A0 4 files changed, 49 insertions(+), 2 deletions(-) >> =C2=A0 create mode 100644 config/cfgroot/manualpages >> >> diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-= functions.pl >> index de608e38b..54e23a535 100644 >> --- a/config/cfgroot/general-functions.pl >> +++ b/config/cfgroot/general-functions.pl >> @@ -24,7 +24,9 @@ $|=3D1; # line buffering >> =C2=A0 $General::version =3D 'VERSION'; >> =C2=A0 $General::swroot =3D 'CONFIG_ROOT'; >> =C2=A0 $General::noipprefix =3D 'noipg-'; >> -$General::adminmanualurl =3D 'http://wiki.ipfire.org'; >> + >> +# Base URL of the user manual >> +my $usermanual_base_url =3D 'https://wiki.ipfire.org'; >> =C2=A0 =C2=A0 require "${General::swroot}/network-functions.pl"; >> =C2=A0 @@ -1421,4 +1423,18 @@ sub running_on_gcp() { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return 0; >> =C2=A0 } >> =C2=A0 +# Get user manual url for the specified configuration page, return= s "" if no entry is configured >> +sub get_usermanual_url() { >> +=C2=A0=C2=A0=C2=A0 my ($config_page) =3D @_; >> + >> +=C2=A0=C2=A0=C2=A0 my %manual_pages =3D (); >> +=C2=A0=C2=A0=C2=A0 &readhash("${General::swroot}/main/manualpages", \%man= ual_pages); >> + >> +=C2=A0=C2=A0=C2=A0 if($config_page && defined($manual_pages{$config_page}= )) { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return $usermanual_base_url . = '/' . $manual_pages{$config_page}; >> +=C2=A0=C2=A0=C2=A0 } >> + >> +=C2=A0=C2=A0=C2=A0 return ""; >> +} >> + >> =C2=A0 1; >> diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages >> new file mode 100644 >> index 000000000..02dac5be6 >> --- /dev/null >> +++ b/config/cfgroot/manualpages >> @@ -0,0 +1,3 @@ >> +index=3Dconfiguration/system/startpage >> +pppsetup=3Dconfiguration/system/dial >> +qos=3Dconfiguration/services/qos >> diff --git a/html/html/themes/ipfire/include/css/style.css b/html/html/the= mes/ipfire/include/css/style.css >> index b92f476c4..661773675 100644 >> --- a/html/html/themes/ipfire/include/css/style.css >> +++ b/html/html/themes/ipfire/include/css/style.css >> @@ -169,6 +169,19 @@ iframe { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 margin-bottom: 1em; >> =C2=A0 } >> =C2=A0 +#main_header > * { >> +=C2=A0=C2=A0=C2=A0 display: inline-block; >> +=C2=A0=C2=A0=C2=A0 vertical-align: baseline; >> +} >> + >> +#main_header > span { >> +=C2=A0=C2=A0=C2=A0 margin-left: 0.8em; >> +} >> + >> +#main_header img { >> +=C2=A0=C2=A0=C2=A0 padding: 0; >> +} >> + >> =C2=A0 #footer { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 height: 2.5em; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 margin-bottom: 1em; >> diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/them= es/ipfire/include/functions.pl >> index 9f12bbe59..d352a7d96 100644 >> --- a/html/html/themes/ipfire/include/functions.pl >> +++ b/html/html/themes/ipfire/include/functions.pl >> @@ -170,7 +170,22 @@ END >> =C2=A0 print <> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0

$t= itle

>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0

$title

>> +END >> +; >> + >> +# Print user manual link >> +my $manual_url =3D &General::get_usermanual_url($scriptName); >> +if($manual_url ne "") { >> +=C2=A0=C2=A0=C2=A0 print <> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 3D"$Lan= >> +END >> +; >> +} >> + >> +print <> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
>> =C2=A0 END >> =C2=A0 ; >> =C2=A0 } --===============5874614065365044060==--