From: Marcin Haba Date: Sat, 31 Jul 2021 06:56:14 +0000 (+0200) Subject: baculum: Remove redundant statistics pages X-Git-Tag: Release-11.3.2~168 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6e6d73c66d188030bcbadbf0962a5e7cbf3f005;p=thirdparty%2Fbacula.git baculum: Remove redundant statistics pages --- diff --git a/gui/baculum/protected/Web/Pages/StatisticsList.page b/gui/baculum/protected/Web/Pages/StatisticsList.page deleted file mode 100644 index 2ea7beee4..000000000 --- a/gui/baculum/protected/Web/Pages/StatisticsList.page +++ /dev/null @@ -1,86 +0,0 @@ -<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%> - - -
-
- <%[ Statistics list ]%> -
-
-
- - - -
-
- - - - - - - - - - -
<%[ Name ]%><%[ Component type ]%><%[ Component name ]%><%[ Actions ]%>
-
- -
diff --git a/gui/baculum/protected/Web/Pages/StatisticsList.php b/gui/baculum/protected/Web/Pages/StatisticsList.php deleted file mode 100644 index a6ee4ef78..000000000 --- a/gui/baculum/protected/Web/Pages/StatisticsList.php +++ /dev/null @@ -1,71 +0,0 @@ - - * @category Page - * @package Baculum Web - */ -class StatisticsList extends BaculumWebPage { - - const USE_CACHE = true; - - public $statistics = array(); - - public function onInit($param) { - parent::onInit($param); - if ($this->IsPostBack || $this->IsCallBack) { - return; - } - $misc = $this->getModule('misc'); - $components = array('dir', 'sd', 'fd'); - - for ($i = 0; $i < count($components); $i++) { - if (empty($_SESSION[$components[$i]])) { - continue; - } - - $result = $this->getModule('api')->get( - array('config', $components[$i], 'statistics'), - null, - true, - self::USE_CACHE - ); - - if ($result->error === 0) { - for ($j = 0; $j < count($result->output); $j++) { - $this->statistics[] = array( - 'statistics' => $result->output[$j]->Statistics->Name, - 'component_type' => $components[$i], - 'component_type_full' => $misc->getComponentFullName($components[$i]), - 'component_name' => $_SESSION[$components[$i]] - ); - } - } - } - } -} -?> diff --git a/gui/baculum/protected/Web/Pages/StatisticsView.page b/gui/baculum/protected/Web/Pages/StatisticsView.page deleted file mode 100644 index 854c762dc..000000000 --- a/gui/baculum/protected/Web/Pages/StatisticsView.page +++ /dev/null @@ -1,20 +0,0 @@ -<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%> - - -
-
- <%[ Statistics details ]%> -
-
-

<%[ Statistics: ]%> <%=$this->getStatisticsName()%>

-
- -
-
- -
-
diff --git a/gui/baculum/protected/Web/Pages/StatisticsView.php b/gui/baculum/protected/Web/Pages/StatisticsView.php deleted file mode 100644 index a8234a77e..000000000 --- a/gui/baculum/protected/Web/Pages/StatisticsView.php +++ /dev/null @@ -1,95 +0,0 @@ - - * @category Page - * @package Baculum Web - */ -class StatisticsView extends BaculumWebPage { - - const COMPONENT_TYPE = 'ComponentType'; - const STATISTICS_NAME = 'StatisticsName'; - - public function onInit($param) { - parent::onInit($param); - if ($this->IsPostBack || $this->IsCallBack) { - return; - } - - $components = $this->getModule('misc')->getComponents(); - if (in_array($this->Request['component_type'], $components)) { - $this->setComponentType($this->Request['component_type']); - } else { - $wmsg = sprintf( - 'Invalid component type "%s" on %s', - $this->Request['component_type'], - __CLASS__ - ); - $this->Application->getModule('logging')->log( - __FUNCTION__, - $wmsg, - Logging::CATEGORY_SECURITY, - __FILE__, - __LINE__ - ); - $this->StatisticsConfig->setVisible(false); - } - $this->setStatisticsName($this->Request['statistics']); - } - - public function onPreRender($param) { - parent::onPreRender($param); - if ($this->IsCallBack || $this->IsPostBack) { - return; - } - $component_type = $this->getComponentType(); - if (key_exists($component_type, $_SESSION) && !empty($_SESSION[$component_type])) { - $this->StatisticsConfig->setComponentType($component_type); - $this->StatisticsConfig->setComponentName($_SESSION[$component_type]); - $this->StatisticsConfig->setResourceName($this->getStatisticsName()); - $this->StatisticsConfig->setLoadValues(true); - $this->StatisticsConfig->raiseEvent('OnDirectiveListLoad', $this, null); - } - } - - public function getComponentType() { - return $this->getViewState(self::COMPONENT_TYPE, ''); - } - - public function setComponentType($component_type) { - $this->setViewState(self::COMPONENT_TYPE, $component_type); - } - - public function getStatisticsName() { - return $this->getViewState(self::STATISTICS_NAME, ''); - } - - public function setStatisticsName($statistics_name) { - $this->setViewState(self::STATISTICS_NAME, $statistics_name); - } -} -?> diff --git a/gui/baculum/protected/Web/Portlets/MainSideBar.tpl b/gui/baculum/protected/Web/Portlets/MainSideBar.tpl index 12b17d802..4401a0e48 100644 --- a/gui/baculum/protected/Web/Portlets/MainSideBar.tpl +++ b/gui/baculum/protected/Web/Portlets/MainSideBar.tpl @@ -57,7 +57,6 @@   <%[ Console ]%>   <%[ Restore wizard ]%>   <%[ Graphs ]%> -   <%[ Statistics ]%>   <%[ Settings ]%>   <%[ Security ]%> diff --git a/gui/baculum/protected/Web/endpoints.xml b/gui/baculum/protected/Web/endpoints.xml index b230d4339..51eb579fb 100644 --- a/gui/baculum/protected/Web/endpoints.xml +++ b/gui/baculum/protected/Web/endpoints.xml @@ -24,8 +24,6 @@ - -