From: Marcin Haba Date: Mon, 5 Jul 2021 18:07:07 +0000 (+0200) Subject: baculum: Add console page to configure consoles X-Git-Tag: Release-11.3.2~202 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dcb637a8156f396d6b2e72bad78f321eb5cfbb81;p=thirdparty%2Fbacula.git baculum: Add console page to configure consoles --- diff --git a/gui/baculum/protected/Web/Data/data_desc.json b/gui/baculum/protected/Web/Data/data_desc.json index 25af95d416..8700370f97 100644 --- a/gui/baculum/protected/Web/Data/data_desc.json +++ b/gui/baculum/protected/Web/Data/data_desc.json @@ -4752,9 +4752,10 @@ }, "Director": { "Required": false, - "ValueType": "str", + "ValueType": "res", "DefaultValue": 0, - "FieldType": "TextBox", + "FieldType": "ComboBox", + "Resource": "Director", "Section": "General" }, "CommCompression": { diff --git a/gui/baculum/protected/Web/Lang/en/messages.mo b/gui/baculum/protected/Web/Lang/en/messages.mo index 9fcafd1a01..aedf50ac24 100644 Binary files a/gui/baculum/protected/Web/Lang/en/messages.mo and b/gui/baculum/protected/Web/Lang/en/messages.mo differ diff --git a/gui/baculum/protected/Web/Lang/en/messages.po b/gui/baculum/protected/Web/Lang/en/messages.po index ccf56b6384..0932befe97 100644 --- a/gui/baculum/protected/Web/Lang/en/messages.po +++ b/gui/baculum/protected/Web/Lang/en/messages.po @@ -3388,3 +3388,12 @@ msgstr "Graphical director status is supported for Bacula directors version 9.0 msgid "Status request timed out. The most probably the Bacula director is not available or it is not running." msgstr "Status request timed out. The most probably the Bacula director is not available or it is not running." + +msgid "To use the console page please configure bbconsjson binary file path on the API side." +msgstr "To use the console page please configure bbconsjson binary file path on the API side." + +msgid "Console details" +msgstr "Console details" + +msgid "Configure console" +msgstr "Configure console" diff --git a/gui/baculum/protected/Web/Lang/ja/messages.mo b/gui/baculum/protected/Web/Lang/ja/messages.mo index 2b9a129537..e3c3064bc9 100644 Binary files a/gui/baculum/protected/Web/Lang/ja/messages.mo and b/gui/baculum/protected/Web/Lang/ja/messages.mo differ diff --git a/gui/baculum/protected/Web/Lang/ja/messages.po b/gui/baculum/protected/Web/Lang/ja/messages.po index 1ebb3f953f..d639c1fa6d 100644 --- a/gui/baculum/protected/Web/Lang/ja/messages.po +++ b/gui/baculum/protected/Web/Lang/ja/messages.po @@ -3474,3 +3474,12 @@ msgstr "Graphical director status is supported for Bacula directors version 9.0 msgid "Status request timed out. The most probably the Bacula director is not available or it is not running." msgstr "Status request timed out. The most probably the Bacula director is not available or it is not running." + +msgid "To use the console page please configure bbconsjson binary file path on the API side." +msgstr "To use the console page please configure bbconsjson binary file path on the API side." + +msgid "Console details" +msgstr "Console details" + +msgid "Configure console" +msgstr "Configure console" diff --git a/gui/baculum/protected/Web/Lang/pl/messages.mo b/gui/baculum/protected/Web/Lang/pl/messages.mo index ee25f09210..d236c66836 100644 Binary files a/gui/baculum/protected/Web/Lang/pl/messages.mo and b/gui/baculum/protected/Web/Lang/pl/messages.mo differ diff --git a/gui/baculum/protected/Web/Lang/pl/messages.po b/gui/baculum/protected/Web/Lang/pl/messages.po index 3d72a8a0f8..8ad4d3ca67 100644 --- a/gui/baculum/protected/Web/Lang/pl/messages.po +++ b/gui/baculum/protected/Web/Lang/pl/messages.po @@ -3398,3 +3398,12 @@ msgstr "Graficzny status zarządcy jest wspierany od wersji zarządcy Bacula 9.0 msgid "Status request timed out. The most probably the Bacula director is not available or it is not running." msgstr "Upłynął limit czasu żądania statusu. Najprawdopodobniej zarządca Bacula nie jest dostępny lub nie jest uruchomiony." + +msgid "To use the console page please configure bbconsjson binary file path on the API side." +msgstr "Aby używać tej strony konsoli, proszę skonfigurować po stronie API lokalizację pliku binarnego bbconsjson." + +msgid "Console details" +msgstr "Szczegóły konsoli" + +msgid "Configure console" +msgstr "Konfiguruj konsolę" diff --git a/gui/baculum/protected/Web/Lang/pt/messages.mo b/gui/baculum/protected/Web/Lang/pt/messages.mo index 0aa747f144..50cea213ae 100644 Binary files a/gui/baculum/protected/Web/Lang/pt/messages.mo and b/gui/baculum/protected/Web/Lang/pt/messages.mo differ diff --git a/gui/baculum/protected/Web/Lang/pt/messages.po b/gui/baculum/protected/Web/Lang/pt/messages.po index 59382ae331..2fb7b7ca65 100644 --- a/gui/baculum/protected/Web/Lang/pt/messages.po +++ b/gui/baculum/protected/Web/Lang/pt/messages.po @@ -3398,3 +3398,12 @@ msgstr "Graphical director status is supported for Bacula directors version 9.0 msgid "Status request timed out. The most probably the Bacula director is not available or it is not running." msgstr "Status request timed out. The most probably the Bacula director is not available or it is not running." + +msgid "To use the console page please configure bbconsjson binary file path on the API side." +msgstr "To use the console page please configure bbconsjson binary file path on the API side." + +msgid "Console details" +msgstr "Console details" + +msgid "Configure console" +msgstr "Configure console" diff --git a/gui/baculum/protected/Web/Lang/ru/messages.mo b/gui/baculum/protected/Web/Lang/ru/messages.mo index 410cbb1d5c..3067275e17 100644 Binary files a/gui/baculum/protected/Web/Lang/ru/messages.mo and b/gui/baculum/protected/Web/Lang/ru/messages.mo differ diff --git a/gui/baculum/protected/Web/Lang/ru/messages.po b/gui/baculum/protected/Web/Lang/ru/messages.po index 052587ccc2..a33cdada75 100644 --- a/gui/baculum/protected/Web/Lang/ru/messages.po +++ b/gui/baculum/protected/Web/Lang/ru/messages.po @@ -3398,3 +3398,12 @@ msgstr "Graphical director status is supported for Bacula directors version 9.0 msgid "Status request timed out. The most probably the Bacula director is not available or it is not running." msgstr "Status request timed out. The most probably the Bacula director is not available or it is not running." + +msgid "To use the console page please configure bbconsjson binary file path on the API side." +msgstr "To use the console page please configure bbconsjson binary file path on the API side." + +msgid "Console details" +msgstr "Console details" + +msgid "Configure console" +msgstr "Configure console" diff --git a/gui/baculum/protected/Web/Pages/ConsoleView.page b/gui/baculum/protected/Web/Pages/ConsoleView.page new file mode 100644 index 0000000000..5141717a55 --- /dev/null +++ b/gui/baculum/protected/Web/Pages/ConsoleView.page @@ -0,0 +1,45 @@ +<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%> + + +
+
+ <%[ Console details ]%> +
+
+ + + + +
diff --git a/gui/baculum/protected/Web/Pages/ConsoleView.php b/gui/baculum/protected/Web/Pages/ConsoleView.php new file mode 100644 index 0000000000..dbb66763c9 --- /dev/null +++ b/gui/baculum/protected/Web/Pages/ConsoleView.php @@ -0,0 +1,57 @@ + + * @category Page + * @package Baculum Web + */ +class ConsoleView extends BaculumWebPage { + + public function onInit($param) { + parent::onInit($param); + if ($this->IsCallBack || $this->IsPostBack) { + return; + } + /** + * NOTE: component name is not used here, set only for compatibility + * with BaculaConfigDirectives. + */ + $this->ConsoleResourcesConfig->setComponentName($_SESSION['director']); + } + + public function loadConsoleResourcesConfig($sender, $param) { + $resource_type = $param->getCallbackParameter(); + if (!empty($resource_type)) { + $this->ConsoleResourcesConfig->setResourceType($resource_type); + $this->ConsoleResourcesConfig->loadResourceListTable(); + } else { + $this->ConsoleResourcesConfig->showError(true); + } + } +} +?> diff --git a/gui/baculum/protected/Web/Portlets/MainSideBar.tpl b/gui/baculum/protected/Web/Portlets/MainSideBar.tpl index 8da2bb4ed1..12b17d802a 100644 --- a/gui/baculum/protected/Web/Portlets/MainSideBar.tpl +++ b/gui/baculum/protected/Web/Portlets/MainSideBar.tpl @@ -54,7 +54,7 @@   <%[ Volumes ]%>   <%[ FileSets ]%>   <%[ Schedules ]%> -   <%[ Configure ]%> +   <%[ Console ]%>   <%[ Restore wizard ]%>   <%[ Graphs ]%>   <%[ Statistics ]%> diff --git a/gui/baculum/protected/Web/endpoints.xml b/gui/baculum/protected/Web/endpoints.xml index 395eeede68..1e218c639f 100644 --- a/gui/baculum/protected/Web/endpoints.xml +++ b/gui/baculum/protected/Web/endpoints.xml @@ -30,10 +30,10 @@ - + - +