From patchwork Mon Sep 4 16:52:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 7146 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4RfZSV19fZz3wtG for ; Mon, 4 Sep 2023 16:52:42 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4RfZSR3btBzcX; Mon, 4 Sep 2023 16:52:39 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4RfZSR2XTDz2yl9; Mon, 4 Sep 2023 16:52:39 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4RfZSP2BhBz2xfn for ; Mon, 4 Sep 2023 16:52:37 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4RfZSN22xhzcX; Mon, 4 Sep 2023 16:52:36 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1693846356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=dvTymCdPt1IfCU7Fb+gzHC422q0e/pJITt0Tij1jzAc=; b=tI4VT3eLdVgS1pC07BCBV0/iw3eW461yhXi4cTXGIxp522hngLw2/ePytPYxROWcPN5s/z Izx8pbi7FyB8mUCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1693846356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=dvTymCdPt1IfCU7Fb+gzHC422q0e/pJITt0Tij1jzAc=; b=gq1XZKyCaEgn6Fs9ByWC9YejRCQBAKQE+A9zNCTc/dOzeFmrp2VH8Ml0XJEI8UAm4mj850 aTx+sPiPK82CrteFQ0wEPfywxEHNB8rXobdhtjk4gXgaI3wSN3moilsOvhloeioNzLeW0X 4uI4XPEUUDr2yMsadVrW0l9H+4h+yyNM5O1Mnx9vqI+mRRnGVLEX41YeXFRYXFo0ZS+xl4 FNt5+zXt40o3PruKuEK+nE39loaLtJoLAJm4kZn0trZKpFvYuxgsWMvXV7NlsCpV5AQ1Ew 2CiTpjsJdw47oltdhVVfVxYUV3AIDv9okcQrksViD7za133e/1vutDyjRUeZkQ== From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH] apcupsd: Make apcupsd link in services page access its apcupsd WUI menu. Date: Mon, 4 Sep 2023 18:52:31 +0200 Message-ID: <20230904165231.3436184-1-adolf.belka@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" - In the services WUI page any addon that has a WUI menu page defined, such as Samba, Guardian etc, has the addon name shown in underlined red which is a link to the addon cgi page. This works for the other addons as the addon cgi name is the same as the addon name. I have identified that this is not the case for apcupsd, because the cgi page is called upsstats.cgi - This patch adjusts the cgi name to allow apcupsd to also be shown in underlined 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 others. - Tested in my vm testbed by making the above changes in the code and the apcupsd addon was then shown in underlined red, which acted as a link to the apcupsd status 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'} = {'caption' => $Lang::tr{'apcupsd'}, - 'uri' => '/cgi-bin/upsstats.cgi', + 'uri' => '/cgi-bin/apcupsd.cgi', 'title' => $Lang::tr{'apcupsd'}, 'enabled' => 1, }; diff --git a/config/rootfiles/packages/apcupsd b/config/rootfiles/packages/apcupsd 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 = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) PROG = apcupsd -PAK_VER = 10 +PAK_VER = 11 DEPS = @@ -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)