]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Add statistics resource support
authorMarcin Haba <marcin.haba@bacula.pl>
Sun, 7 Jul 2019 17:45:58 +0000 (19:45 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Sat, 14 Dec 2019 14:55:25 +0000 (15:55 +0100)
17 files changed:
gui/baculum/protected/Common/Class/Miscellaneous.php
gui/baculum/protected/Web/Data/data_desc.json
gui/baculum/protected/Web/Lang/en/messages.mo
gui/baculum/protected/Web/Lang/en/messages.po
gui/baculum/protected/Web/Lang/ja/messages.mo
gui/baculum/protected/Web/Lang/ja/messages.po
gui/baculum/protected/Web/Lang/pl/messages.mo
gui/baculum/protected/Web/Lang/pl/messages.po
gui/baculum/protected/Web/Lang/pt/messages.mo
gui/baculum/protected/Web/Lang/pt/messages.po
gui/baculum/protected/Web/Pages/StatisticsList.page [new file with mode: 0644]
gui/baculum/protected/Web/Pages/StatisticsList.php [new file with mode: 0644]
gui/baculum/protected/Web/Pages/StatisticsView.page [new file with mode: 0644]
gui/baculum/protected/Web/Pages/StatisticsView.php [new file with mode: 0644]
gui/baculum/protected/Web/Portlets/MainSideBar.tpl
gui/baculum/protected/Web/Portlets/NewResourceMenu.tpl
gui/baculum/protected/Web/endpoints.xml

index a8a0a6c033e74dd7ca519f38381b65b51f27870e..f2465681bafd1010447575d3fab35759e8ea7be4 100644 (file)
@@ -133,7 +133,7 @@ class Miscellaneous extends TModule {
        }
 
        public function getComponents() {
-               $components = array_keys($this->components);
+               return array_keys($this->components);
        }
 
        public function getMainComponentResource($type) {
index c8eaf1897c32319d2a8ffeef733f86ff4853750b..92a5d09165ba95cbadcee0068a6fbec960d6e89c 100644 (file)
                                "FieldType": "ListBox",
                                "Resource": "Job"
                        }
+               },
+               "Statistics": {
+                       "Name": {
+                               "Required": true,
+                               "ValueType": "name",
+                               "DefaultValue": 0,
+                               "FieldType": "TextBox"
+                       },
+                       "Description": {
+                               "Required": false,
+                               "ValueType": "str",
+                               "DefaultValue": 0,
+                               "FieldType": "TextBox"
+                       },
+                       "Interval": {
+                               "Required": false,
+                               "ValueType": "time",
+                               "DefaultValue": 300,
+                               "FieldType": "TimePeriod"
+                       },
+                       "Type": {
+                               "Required": true,
+                               "ValueType": "str",
+                               "DefaultValue": 0,
+                               "FieldType": "ComboBox",
+                               "Data": ["CSV", "Graphite"]
+                       },
+                       "Metrics": {
+                               "Required": false,
+                               "ValueType": "str",
+                               "DefaultValue": 0,
+                               "FieldType": "MultiTextBox"
+                       },
+                       "Prefix": {
+                               "Required": false,
+                               "ValueType": "str",
+                               "DefaultValue": 0,
+                               "FieldType": "TextBox"
+                       },
+                       "File": {
+                               "Required": false,
+                               "ValueType": "str",
+                               "DefaultValue": 0,
+                               "FieldType": "TextBox"
+                       },
+                       "Host": {
+                               "Required": false,
+                               "ValueType": "str",
+                               "DefaultValue": 0,
+                               "FieldType": "TextBox"
+                       },
+                       "Port": {
+                               "Required": false,
+                               "ValueType": "pint32",
+                               "DefaultValue": 0,
+                               "FieldType": "Integer"
+                       },
+                       "MangleMetric": {
+                               "Required": false,
+                               "ValueType": "bool",
+                               "DefaultValue": 0,
+                               "FieldType": "CheckBox"
+                       }
                }
        },
        "sd": {
                                "DefaultValue": 0,
                                "FieldType": "TextBox"
                        }
+               },
+               "Statistics": {
+                       "Name": {
+                               "Required": true,
+                               "ValueType": "name",
+                               "DefaultValue": 0,
+                               "FieldType": "TextBox"
+                       },
+                       "Description": {
+                               "Required": false,
+                               "ValueType": "str",
+                               "DefaultValue": 0,
+                               "FieldType": "TextBox"
+                       },
+                       "Interval": {
+                               "Required": false,
+                               "ValueType": "time",
+                               "DefaultValue": 300,
+                               "FieldType": "TimePeriod"
+                       },
+                       "Type": {
+                               "Required": true,
+                               "ValueType": "str",
+                               "DefaultValue": 0,
+                               "FieldType": "ComboBox",
+                               "Data": ["CSV", "Graphite"]
+                       },
+                       "Metrics": {
+                               "Required": false,
+                               "ValueType": "str",
+                               "DefaultValue": 0,
+                               "FieldType": "MultiTextBox"
+                       },
+                       "Prefix": {
+                               "Required": false,
+                               "ValueType": "str",
+                               "DefaultValue": 0,
+                               "FieldType": "TextBox"
+                       },
+                       "File": {
+                               "Required": false,
+                               "ValueType": "str",
+                               "DefaultValue": 0,
+                               "FieldType": "TextBox"
+                       },
+                       "Host": {
+                               "Required": false,
+                               "ValueType": "str",
+                               "DefaultValue": 0,
+                               "FieldType": "TextBox"
+                       },
+                       "Port": {
+                               "Required": false,
+                               "ValueType": "pint32",
+                               "DefaultValue": 0,
+                               "FieldType": "Integer"
+                       },
+                       "MangleMetric": {
+                               "Required": false,
+                               "ValueType": "bool",
+                               "DefaultValue": 0,
+                               "FieldType": "CheckBox"
+                       }
                }
        },
        "fd": {
                                "DefaultValue": 0,
                                "FieldType": "TextBox"
                        }
+               },
+               "Statistics": {
+                       "Name": {
+                               "Required": true,
+                               "ValueType": "name",
+                               "DefaultValue": 0,
+                               "FieldType": "TextBox"
+                       },
+                       "Description": {
+                               "Required": false,
+                               "ValueType": "str",
+                               "DefaultValue": 0,
+                               "FieldType": "TextBox"
+                       },
+                       "Interval": {
+                               "Required": false,
+                               "ValueType": "time",
+                               "DefaultValue": 300,
+                               "FieldType": "TimePeriod"
+                       },
+                       "Type": {
+                               "Required": true,
+                               "ValueType": "str",
+                               "DefaultValue": 0,
+                               "FieldType": "ComboBox",
+                               "Data": ["CSV", "Graphite"]
+                       },
+                       "Metrics": {
+                               "Required": false,
+                               "ValueType": "str",
+                               "DefaultValue": 0,
+                               "FieldType": "MultiTextBox"
+                       },
+                       "Prefix": {
+                               "Required": false,
+                               "ValueType": "str",
+                               "DefaultValue": 0,
+                               "FieldType": "TextBox"
+                       },
+                       "File": {
+                               "Required": false,
+                               "ValueType": "str",
+                               "DefaultValue": 0,
+                               "FieldType": "TextBox"
+                       },
+                       "Host": {
+                               "Required": false,
+                               "ValueType": "str",
+                               "DefaultValue": 0,
+                               "FieldType": "TextBox"
+                       },
+                       "Port": {
+                               "Required": false,
+                               "ValueType": "pint32",
+                               "DefaultValue": 0,
+                               "FieldType": "Integer"
+                       },
+                       "MangleMetric": {
+                               "Required": false,
+                               "ValueType": "bool",
+                               "DefaultValue": 0,
+                               "FieldType": "CheckBox"
+                       }
                }
        },
        "bcons": {
index 7b09f690d4ef7595979e17909e20ae39d059858b..fd60c2de13e27a0257f4cf6d22a15d3e562030ea 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/en/messages.mo and b/gui/baculum/protected/Web/Lang/en/messages.mo differ
index e0a228d261684fde65c4606b4b6ef2c919deb298..94caf645e44cffa073ab15f1ae29a953e8a51dcd 100644 (file)
@@ -2071,3 +2071,30 @@ msgstr "Decimal Bytes (1 mega = 10<sup>6</sup>)"
 
 msgid "Binary Bytes (1 mebi = 2<sup>20</sup>)"
 msgstr "Binary Bytes (1 mebi = 2<sup>20</sup>)"
+
+msgid "Statistics list"
+msgstr "Statistics list"
+
+msgid "Add director statistics"
+msgstr "Add director statistics"
+
+msgid "Add storage statistics"
+msgstr "Add storage statistics"
+
+msgid "Add file daemon statistics"
+msgstr "Add file daemon statistics"
+
+msgid "Component type"
+msgstr "Component type"
+
+msgid "Component name"
+msgstr "Component name"
+
+msgid "Statistics details"
+msgstr "Statistics details"
+
+msgid "Statistics:"
+msgstr "Statistics:"
+
+msgid "Statistics"
+msgstr "Statistics"
index 0d9e97ac54e4198645e59da8d2f82db8217b9caf..4261a01d70447634d35a388da1cc2ba9b758c154 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/ja/messages.mo and b/gui/baculum/protected/Web/Lang/ja/messages.mo differ
index 0777a4568fd34539a32e53c820697455ae9a460f..b63830ee637abc024e6cefe3884984cce2a6bef7 100644 (file)
@@ -2161,3 +2161,30 @@ msgstr "Decimal Bytes (1 mega = 10<sup>6</sup>)"
 
 msgid "Binary Bytes (1 mebi = 2<sup>20</sup>)"
 msgstr "Binary Bytes (1 mebi = 2<sup>20</sup>)"
+
+msgid "Statistics list"
+msgstr "Statistics list"
+
+msgid "Add director statistics"
+msgstr "Add director statistics"
+
+msgid "Add storage statistics"
+msgstr "Add storage statistics"
+
+msgid "Add file daemon statistics"
+msgstr "Add file daemon statistics"
+
+msgid "Component type"
+msgstr "Component type"
+
+msgid "Component name"
+msgstr "Component name"
+
+msgid "Statistics details"
+msgstr "Statistics details"
+
+msgid "Statistics:"
+msgstr "Statistics:"
+
+msgid "Statistics"
+msgstr "Statistics"
index 42b7fa3ad5e3591c0e169c84351fa9f8bccb0568..1269e5442b285fc4a3208991cf9f249c8f7a1e00 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/pl/messages.mo and b/gui/baculum/protected/Web/Lang/pl/messages.mo differ
index facf3ed2b97d8911f4022779b0a70ec0f4052aa2..c78ed8b27182529d0834a4b7e697aad61e6f3921 100644 (file)
@@ -2078,3 +2078,30 @@ msgstr "Dziesiętne Bajty (1 mega = 10<sup>6</sup>)"
 
 msgid "Binary Bytes (1 mebi = 2<sup>20</sup>)"
 msgstr "Binarne Bajty (1 mebi = 2<sup>20</sup>)"
+
+msgid "Statistics list"
+msgstr "Lista statystyk"
+
+msgid "Add director statistics"
+msgstr "Dodaj statystyki zarządcy"
+
+msgid "Add storage statistics"
+msgstr "Dodaj statystyki magazynu danych"
+
+msgid "Add file daemon statistics"
+msgstr "Dodaj statystyki klienta"
+
+msgid "Component type"
+msgstr "Typ komponentu"
+
+msgid "Component name"
+msgstr "Nazwa komponentu"
+
+msgid "Statistics details"
+msgstr "Szczegóły statystyk"
+
+msgid "Statistics:"
+msgstr "Statystyki:"
+
+msgid "Statistics"
+msgstr "Statystyki"
index d186c99a45fe0e45bdcf7653ea1e47273c36cfb4..ad4f6c7204b90bb408ca1ca4dbbea7a04bee6393 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/pt/messages.mo and b/gui/baculum/protected/Web/Lang/pt/messages.mo differ
index 3233ce22b13d0ea7491eb77dfb1224f8b0349b5c..3b682f0a3e46bb5aab4704f14c7caa29530a4ba9 100644 (file)
@@ -2086,3 +2086,30 @@ msgstr "Decimal Bytes (1 mega = 10<sup>6</sup>)"
 
 msgid "Binary Bytes (1 mebi = 2<sup>20</sup>)"
 msgstr "Binary Bytes (1 mebi = 2<sup>20</sup>)"
+
+msgid "Statistics list"
+msgstr "Statistics list"
+
+msgid "Add director statistics"
+msgstr "Add director statistics"
+
+msgid "Add storage statistics"
+msgstr "Add storage statistics"
+
+msgid "Add file daemon statistics"
+msgstr "Add file daemon statistics"
+
+msgid "Component type"
+msgstr "Component type"
+
+msgid "Component name"
+msgstr "Component name"
+
+msgid "Statistics details"
+msgstr "Statistics details"
+
+msgid "Statistics:"
+msgstr "Statistics:"
+
+msgid "Statistics"
+msgstr "Statistics"
diff --git a/gui/baculum/protected/Web/Pages/StatisticsList.page b/gui/baculum/protected/Web/Pages/StatisticsList.page
new file mode 100644 (file)
index 0000000..3648581
--- /dev/null
@@ -0,0 +1,86 @@
+<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<com:TContent ID="Main">
+       <!-- Header -->
+       <header class="w3-container">
+               <h5>
+                       <strong><i class="fa fa-file-medical-alt"></i> <%[ Statistics list ]%></strong>
+               </h5>
+       </header>
+       <div class="w3-margin-left w3-margin-bottom">
+               <button type="button" class="w3-button w3-green<%=empty($_SESSION['dir']) ? ' hide': ''%>" onclick="document.location.href='<%=$this->Service->constructUrl('NewResource', array('component_type' => 'dir', 'component_name' => $_SESSION['dir'], 'resource_type' => 'Statistics'))%>';"><i class="fa fa-plus"></i> &nbsp;<%[ Add director statistics ]%></button>
+               <button type="button" class="w3-button w3-green<%=empty($_SESSION['sd']) ? ' hide': ''%>" onclick="document.location.href='<%=$this->Service->constructUrl('NewResource', array('component_type' => 'sd', 'component_name' => $_SESSION['sd'], 'resource_type' => 'Statistics'))%>';"><i class="fa fa-plus"></i> &nbsp;<%[ Add storage statistics ]%></button>
+               <button type="button" class="w3-button w3-green<%=empty($_SESSION['fd']) ? ' hide': ''%>" onclick="document.location.href='<%=$this->Service->constructUrl('NewResource', array('component_type' => 'fd', 'component_name' => $_SESSION['fd'], 'resource_type' => 'Statistics'))%>';"><i class="fa fa-plus"></i> &nbsp;<%[ Add file daemon statistics ]%></button>
+       </div>
+       <div class="w3-container">
+               <table id="statistics_list" class="w3-table w3-striped w3-hoverable w3-white w3-margin-bottom">
+                       <thead>
+                               <tr>
+                                       <th></th>
+                                       <th><%[ Name ]%></th>
+                                       <th><%[ Component type ]%></th>
+                                       <th><%[ Component name ]%></th>
+                                       <th class="w3-center"><%[ Actions ]%></th>
+                               </tr>
+                       </thead>
+               </table>
+       </div>
+<script type="text/javascript">
+var oStatisticsList = {
+       ids: {
+               statistics_list: 'statistics_list'
+       },
+       init: function() {
+               this.set_table();
+       },
+       set_table: function() {
+               var table = $('#' + this.ids.statistics_list).DataTable({
+                       data: <%=json_encode($this->statistics)%>,
+                       deferRender: true,
+                       columns: [
+                               {
+                                       className: 'details-control',
+                                       orderable: false,
+                                       data: null,
+                                       defaultContent: '<button type="button" class="w3-button w3-blue"><i class="fa fa-angle-down"></i></button>'
+                               },
+                               {data: 'statistics'},
+                               {data: 'component_type_full'},
+                               {data: 'component_name'},
+                               {
+                                       data: 'statistics',
+                                       render: function (data, type, row) {
+                                               var btn = document.createElement('BUTTON');
+                                               btn.className = 'w3-button w3-green';
+                                               btn.type = 'button';
+                                               var i = document.createElement('I');
+                                               i.className = 'fa fa-list-ul';
+                                               var label = document.createTextNode(' <%[ Details ]%>');
+                                               btn.appendChild(i);
+                                               btn.innerHTML += '&nbsp';
+                                               btn.appendChild(label);
+                                               btn.setAttribute('onclick', "document.location.href = '/web/statistics/" + row.component_type + "/" + data + "/'");
+                                               return btn.outerHTML;
+                                       }
+                               }
+                       ],
+                       responsive: {
+                               details: {
+                                       type: 'column'
+                               }
+                       },
+                       columnDefs: [{
+                               className: 'control',
+                               orderable: false,
+                               targets: 0
+                       },
+                       {
+                               className: "dt-center",
+                               targets: [ 2, 3 ]
+                       }],
+                       order: [2, 'asc']
+               });
+       }
+};
+oStatisticsList.init();
+</script>
+</com:TContent>
diff --git a/gui/baculum/protected/Web/Pages/StatisticsList.php b/gui/baculum/protected/Web/Pages/StatisticsList.php
new file mode 100644 (file)
index 0000000..1bbf34e
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum   - Bacula web interface
+ *
+ * Copyright (C) 2013-2019 Kern Sibbald
+ *
+ * The main author of Baculum is Marcin Haba.
+ * The original author of Bacula is Kern Sibbald, with contributions
+ * from many others, a complete list can be found in the file AUTHORS.
+ *
+ * You may use this file and others of this release according to the
+ * license defined in the LICENSE file, which includes the Affero General
+ * Public License, v3.0 ("AGPLv3") and some additional permissions and
+ * terms pursuant to its AGPLv3 Section 7.
+ *
+ * This notice must be preserved when any source code is
+ * conveyed and/or propagated.
+ *
+ * Bacula(R) is a registered trademark of Kern Sibbald.
+ */
+
+Prado::using('Application.Web.Class.BaculumWebPage');
+
+class StatisticsList extends BaculumWebPage {
+
+       const USE_CACHE = true;
+
+       protected $admin = 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
new file mode 100644 (file)
index 0000000..cf4cda2
--- /dev/null
@@ -0,0 +1,20 @@
+<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<com:TContent ID="Main">
+       <!-- Header -->
+       <header class="w3-container">
+               <h5>
+                       <strong><i class="fa fa-file-medical-alt"></i> <%[ Statistics details ]%></strong>
+               </h5>
+       </header>
+       <h3 class="w3-margin-left"><%[ Statistics: ]%> <%=$this->getStatisticsName()%></h3>
+       <div class="w3-bar w3-green w3-margin-bottom">
+               <a class="w3-button w3-bar-item" href="<%=$this->Service->constructUrl('StatisticsList')%>"><i class="fa fa-angle-left"></i></a>
+       </div>
+       <div class="w3-container">
+               <com:Application.Web.Portlets.BaculaConfigDirectives
+                       ID="StatisticsConfig"
+                       ResourceType="Statistics"
+                       ShowCancelButton="false"
+               />
+       </div>
+</com:TContent>
diff --git a/gui/baculum/protected/Web/Pages/StatisticsView.php b/gui/baculum/protected/Web/Pages/StatisticsView.php
new file mode 100644 (file)
index 0000000..b550725
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum   - Bacula web interface
+ *
+ * Copyright (C) 2013-2019 Kern Sibbald
+ *
+ * The main author of Baculum is Marcin Haba.
+ * The original author of Bacula is Kern Sibbald, with contributions
+ * from many others, a complete list can be found in the file AUTHORS.
+ *
+ * You may use this file and others of this release according to the
+ * license defined in the LICENSE file, which includes the Affero General
+ * Public License, v3.0 ("AGPLv3") and some additional permissions and
+ * terms pursuant to its AGPLv3 Section 7.
+ *
+ * This notice must be preserved when any source code is
+ * conveyed and/or propagated.
+ *
+ * Bacula(R) is a registered trademark of Kern Sibbald.
+ */
+
+Prado::using('Application.Web.Class.BaculumWebPage');
+
+class StatisticsView extends BaculumWebPage {
+
+       const COMPONENT_TYPE = 'ComponentType';
+       const STATISTICS_NAME = 'StatisticsName';
+
+       protected $admin = true;
+
+       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 onLoad($param) {
+               parent::onLoad($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);
+       }
+}
+?>
index b0ea46e64d0c771e5e4da86a69406531b6b481ab..0e0e2d64fcf8566a16f8599ae38c3db407ca6d96 100644 (file)
@@ -36,6 +36,7 @@
                <a href="<%=$this->Service->constructUrl('ConfigureHosts')%>" class="w3-bar-item w3-button w3-padding<%=$this->Service->getRequestedPagePath() == 'ConfigureHosts' ? ' w3-blue': ''%><%=!$_SESSION['admin'] ? ' hide' : ''%>"><i class="fa fa-cog fa-fw"></i>  <%[ Configure ]%></a>
                <a href="<%=$this->Service->constructUrl('RestoreWizard')%>" class="w3-bar-item w3-button w3-padding<%=$this->Service->getRequestedPagePath() == 'RestoreWizard' ? ' w3-blue': ''%>"><i class="fa fa-reply fa-fw"></i>  <%[ Restore wizard ]%></a>
                <a href="<%=$this->Service->constructUrl('Graphs')%>" class="w3-bar-item w3-button w3-padding<%=$this->Service->getRequestedPagePath() == 'Graphs' ? ' w3-blue': ''%>"><i class="fa fa-chart-pie fa-fw"></i>  <%[ Graphs ]%></a>
+               <a href="<%=$this->Service->constructUrl('StatisticsList')%>" class="w3-bar-item w3-button w3-padding<%=in_array($this->Service->getRequestedPagePath(), array('StatisticsList', 'StatisticsView')) ? ' w3-blue': ''%><%=!$_SESSION['admin'] ? ' hide' : ''%>"><i class="fa fa-file-medical-alt fa-fw"></i>  <%[ Statistics ]%></a>
                <a href="<%=$this->Service->constructUrl('WebConfigWizard')%>" class="w3-bar-item w3-button w3-padding<%=$this->Service->getRequestedPagePath() == 'WebConfigWizard' ? ' w3-blue': ''%><%=!$_SESSION['admin'] ? ' hide' : ''%>"><i class="fa fa-wrench fa-fw"></i>  <%[ Settings ]%></a>
                <a href="<%=$this->Service->constructUrl('Users')%>" class="w3-bar-item w3-button w3-padding<%=$this->Service->getRequestedPagePath() == 'Users' ? ' w3-blue': ''%><%=!$_SESSION['admin'] ? ' hide' : ''%>"><i class="fa fa-users fa-fw"></i>  <%[ Users ]%></a>
        </div>
index 23db7d3c92a143c9f580068ce719c10dc464c171..c459591d47f2b0b77559bd8b655fc6cc323e8c9d 100644 (file)
                        Attributes.onclick="$(this).closest('div.config_new_resource').hide();$('div.config_directives').slideUp();"
                        />
                </li>
+               <li><com:TActiveLinkButton
+                       OnCommand="Parent.SourceTemplateControl.newResource"
+                       CommandParameter="Statistics|<%=$this->getHost()%>|<%=$this->getComponentType()%>|<%=$this->getComponentName()%>"
+                       Text="Statistics"
+                       ClientSide.OnComplete="BaculaConfig.show_new_config('<%=$this->getHost()%>new_resource', '<%=$this->getComponentType()%>', '<%=$this->getComponentName()%>', 'Statistics');"
+                       Attributes.onclick="$(this).closest('div.config_new_resource').hide();$('div.config_directives').slideUp();"
+                       />
+               </li>
        </ul>
        <ul style="display: <%=$this->getComponentType() === 'sd' ? 'block': 'none'%>; margin-top: 0;">
                <li><com:TActiveLinkButton
                        Attributes.onclick="$(this).closest('div.config_new_resource').hide();$('div.config_directives').slideUp();"
                        />
                </li>
+               <li><com:TActiveLinkButton
+                       OnCommand="Parent.SourceTemplateControl.newResource"
+                       CommandParameter="Statistics|<%=$this->getHost()%>|<%=$this->getComponentType()%>|<%=$this->getComponentName()%>"
+                       Text="Statistics"
+                       ClientSide.OnComplete="BaculaConfig.show_new_config('<%=$this->getHost()%>new_resource', '<%=$this->getComponentType()%>', '<%=$this->getComponentName()%>', 'Statistics');"
+                       Attributes.onclick="$(this).closest('div.config_new_resource').hide();$('div.config_directives').slideUp();"
+                       />
+               </li>
        </ul>
        <ul style="display: <%=$this->getComponentType() === 'fd' ? 'block': 'none'%>; margin-top: 0;">
                <li><com:TActiveLinkButton
                        Attributes.onclick="$(this).closest('div.config_new_resource').hide();$('div.config_directives').slideUp();"
                        />
                </li>
+               <li><com:TActiveLinkButton
+                       OnCommand="Parent.SourceTemplateControl.newResource"
+                       CommandParameter="Statistics|<%=$this->getHost()%>|<%=$this->getComponentType()%>|<%=$this->getComponentName()%>"
+                       Text="Statistics"
+                       ClientSide.OnComplete="BaculaConfig.show_new_config('<%=$this->getHost()%>new_resource', '<%=$this->getComponentType()%>', '<%=$this->getComponentName()%>', 'Statistics');"
+                       Attributes.onclick="$(this).closest('div.config_new_resource').hide();$('div.config_directives').slideUp();"
+                       />
+               </li>
        </ul>
        <ul style="display: <%=$this->getComponentType() === 'bcons' ? 'block': 'none'%>; margin-top: 0;">
                <li><com:TActiveLinkButton
index edf9c88eb873277b4a22fb2128fb233fb2c44c70..41d2d64be30dadb94b6eac672c4aa2947caa18bb 100644 (file)
@@ -21,6 +21,8 @@
        <url ServiceParameter="ClientView" pattern="web/client/{client}/" parameters.client="[a-zA-Z0-9:.\-_ ]+" />
        <url ServiceParameter="FileSetList" pattern="web/fileset/" />
        <url ServiceParameter="FileSetView" pattern="web/fileset/{fileset}/" parameters.fileset="[a-zA-Z0-9:.\-_ ]+" />
+       <url ServiceParameter="StatisticsList" pattern="web/statistics/" />
+       <url ServiceParameter="StatisticsView" pattern="web/statistics/{component_type}/{statistics}/" parameters.component_type="\w+" parameters.statistics="[a-zA-Z0-9:.\-_ ]+"/>
        <url ServiceParameter="ScheduleList" pattern="web/schedule/" />
        <url ServiceParameter="ScheduleStatusList" pattern="web/schedule/status/" />
        <url ServiceParameter="ScheduleView" pattern="web/schedule/{schedule}/" parameters.schedule="[a-zA-Z0-9:.\-_ ]+" />