From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH] apcupsd: Make apcupsd link in services page access its apcupsd WUI menu. Date: Mon, 04 Sep 2023 18:52:31 +0200 Message-ID: <20230904165231.3436184-1-adolf.belka@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5481315997847556675==" List-Id: --===============5481315997847556675== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable - In the services WUI page any addon that has a WUI menu page defined, such a= s Samba, Guardian etc, has the addon name shown in underlined red which is a link t= o the addon cgi page. This works for the other addons as the addon cgi name is the sam= e as the addon name. I have identified that this is not the case for apcupsd, becau= se the cgi page is called upsstats.cgi - This patch adjusts the cgi name to allow apcupsd to also be shown in underl= ined red. - The lfs file copies the upsstats.cgi file to one named apcupsd.cgi - The apcupsd menu file has the cgi name changed from upsstats.cgi to apcupsd= .cgi - The rootfile is updated to also include the apcupsd.cgi file with the other= s. - Tested in my vm testbed by making the above changes in the code and the apc= upsd addon was then shown in underlined red, which acted as a link to the apcupsd sta= tus WUI page. Tested-by: Adolf Belka Signed-off-by: Adolf Belka --- config/menu/EX-apcupsd.menu | 2 +- config/rootfiles/packages/apcupsd | 1 + lfs/apcupsd | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/menu/EX-apcupsd.menu b/config/menu/EX-apcupsd.menu index 5f01dce33..ae462db18 100644 --- a/config/menu/EX-apcupsd.menu +++ b/config/menu/EX-apcupsd.menu @@ -1,5 +1,5 @@ $subipfire->{'35.apcupsd'} =3D {'caption' =3D> $Lang::tr{'apcupsd'}, - 'uri' =3D> '/cgi-bin/upsstats.cgi', + 'uri' =3D> '/cgi-bin/apcupsd.cgi', 'title' =3D> $Lang::tr{'apcupsd'}, 'enabled' =3D> 1, }; diff --git a/config/rootfiles/packages/apcupsd b/config/rootfiles/packages/ap= cupsd index a28c961eb..f85ba3557 100644 --- a/config/rootfiles/packages/apcupsd +++ b/config/rootfiles/packages/apcupsd @@ -21,6 +21,7 @@ srv/web/ipfire/cgi-bin/multimon.cgi srv/web/ipfire/cgi-bin/upsfstats.cgi srv/web/ipfire/cgi-bin/upsimage.cgi srv/web/ipfire/cgi-bin/upsstats.cgi +srv/web/ipfire/cgi-bin/apcupsd.cgi #usr/share/hal #usr/share/hal/fdi #usr/share/hal/fdi/policy diff --git a/lfs/apcupsd b/lfs/apcupsd index f7c0b245f..8ed9bbd8c 100644 --- a/lfs/apcupsd +++ b/lfs/apcupsd @@ -34,7 +34,7 @@ DL_FROM =3D $(URL_IPFIRE) DIR_APP =3D $(DIR_SRC)/$(THISAPP) TARGET =3D $(DIR_INFO)/$(THISAPP) PROG =3D apcupsd -PAK_VER =3D 10 +PAK_VER =3D 11 =20 DEPS =3D =20 @@ -95,5 +95,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) ln -sf ../init.d/apcupsd /etc/rc.d/rc6.d/K35apcupsd install -v -m 644 ${DIR_SRC}/config/backup/includes/apcupsd \ /var/ipfire/backup/addons/includes/apcupsd + cp /srv/web/ipfire/cgi-bin/upsstats.cgi /srv/web/ipfire/cgi-bin/apcupsd.cgi @rm -rf $(DIR_APP) @$(POSTBUILD) --=20 2.42.0 --===============5481315997847556675==--