From: Marcin Haba Date: Wed, 27 Oct 2021 16:16:29 +0000 (+0200) Subject: baculum: Fix #2642 add tool to re-assigning volumes from one pool to another X-Git-Tag: Release-11.3.2~157 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02a43fadff60d1f4c012187a56274cfec19d934d;p=thirdparty%2Fbacula.git baculum: Fix #2642 add tool to re-assigning volumes from one pool to another After renaming pool Baculum user see warning with instruction what to do to finish the pool rename. User is able to re-assign volumes between pools and at the end remove original pool. --- diff --git a/gui/baculum/protected/Web/Lang/en/messages.mo b/gui/baculum/protected/Web/Lang/en/messages.mo index f887bf649e..be60418d0a 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 0d430492ef..5e55c4c903 100644 --- a/gui/baculum/protected/Web/Lang/en/messages.po +++ b/gui/baculum/protected/Web/Lang/en/messages.po @@ -3817,3 +3817,24 @@ msgstr "Please mount volume %volume for storage: %storage, pool: %pool, media ty msgid "Please create a new volume for storage: %storage, pool: %pool, media type: %mediatype." msgstr "Please create a new volume for storage: %storage, pool: %pool, media type: %mediatype." + +msgid "Assign volumes from selected pool" +msgstr "Assign volumes from selected pool" + +msgid "This function enables re-assigning volumes from selected pool to this pool." +msgstr "This function enables re-assigning volumes from selected pool to this pool." + +msgid "Please select a pool from which you would like to assign volumes to this pool." +msgstr "Please select a pool from which you would like to assign volumes to this pool." + +msgid "Assigned volume count:" +msgstr "Assigned volume count:" + +msgid "Assign volumes" +msgstr "Assign volumes" + +msgid "No volumes in the pool to assign." +msgstr "No volumes in the pool to assign." + +msgid "The pool has not been renamed but it has been copied with the new name. Please note that if the original pool contained volumes, they have not been moved and they are still assigned to the original pool in the catalog database. To re-assign volumes from the original pool to this one please go to the MAIN MENU ➤ Pools ➤ [NEW POOL] ➤ Tab: Actions and please use the 'Assign volumes' button. After re-assgning volumes you can delete the original pool." +msgstr "The pool has not been renamed but it has been copied with the new name. Please note that if the original pool contained volumes, they have not been moved and they are still assigned to the original pool in the catalog database. To re-assign volumes from the original pool to this one please go to the MAIN MENU ➤ Pools ➤ [NEW POOL] ➤ Tab: Actions and please use the 'Assign volumes' button. After re-assgning volumes you can delete the original pool." diff --git a/gui/baculum/protected/Web/Lang/ja/messages.mo b/gui/baculum/protected/Web/Lang/ja/messages.mo index fe34e3ece0..4af93a8c7b 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 d5df331527..f240586ea0 100644 --- a/gui/baculum/protected/Web/Lang/ja/messages.po +++ b/gui/baculum/protected/Web/Lang/ja/messages.po @@ -3903,3 +3903,24 @@ msgstr "Please mount volume %volume for storage: %storage, pool: %pool, media ty msgid "Please create a new volume for storage: %storage, pool: %pool, media type: %mediatype." msgstr "Please create a new volume for storage: %storage, pool: %pool, media type: %mediatype." + +msgid "Assign volumes from selected pool" +msgstr "Assign volumes from selected pool" + +msgid "This function enables re-assigning volumes from selected pool to this pool." +msgstr "This function enables re-assigning volumes from selected pool to this pool." + +msgid "Please select a pool from which you would like to assign volumes to this pool." +msgstr "Please select a pool from which you would like to assign volumes to this pool." + +msgid "Assigned volume count:" +msgstr "Assigned volume count:" + +msgid "Assign volumes" +msgstr "Assign volumes" + +msgid "No volumes in the pool to assign." +msgstr "No volumes in the pool to assign." + +msgid "The pool has not been renamed but it has been copied with the new name. Please note that if the original pool contained volumes, they have not been moved and they are still assigned to the original pool in the catalog database. To re-assign volumes from the original pool to this one please go to the MAIN MENU ➤ Pools ➤ [NEW POOL] ➤ Tab: Actions and please use the 'Assign volumes' button. After re-assgning volumes you can delete the original pool." +msgstr "The pool has not been renamed but it has been copied with the new name. Please note that if the original pool contained volumes, they have not been moved and they are still assigned to the original pool in the catalog database. To re-assign volumes from the original pool to this one please go to the MAIN MENU ➤ Pools ➤ [NEW POOL] ➤ Tab: Actions and please use the 'Assign volumes' button. After re-assgning volumes you can delete the original pool." diff --git a/gui/baculum/protected/Web/Lang/pl/messages.mo b/gui/baculum/protected/Web/Lang/pl/messages.mo index 525bd0c107..c332feb462 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 9aac429764..0fb140132b 100644 --- a/gui/baculum/protected/Web/Lang/pl/messages.po +++ b/gui/baculum/protected/Web/Lang/pl/messages.po @@ -3828,3 +3828,24 @@ msgstr "Please mount volume %volume for storage: %storage, pool: %pool, media ty msgid "Please create a new volume for storage: %storage, pool: %pool, media type: %mediatype." msgstr "Please create a new volume for storage: %storage, pool: %pool, media type: %mediatype." + +msgid "Assign volumes from selected pool" +msgstr "Assign volumes from selected pool" + +msgid "This function enables re-assigning volumes from selected pool to this pool." +msgstr "This function enables re-assigning volumes from selected pool to this pool." + +msgid "Please select a pool from which you would like to assign volumes to this pool." +msgstr "Please select a pool from which you would like to assign volumes to this pool." + +msgid "Assigned volume count:" +msgstr "Assigned volume count:" + +msgid "Assign volumes" +msgstr "Assign volumes" + +msgid "No volumes in the pool to assign." +msgstr "No volumes in the pool to assign." + +msgid "The pool has not been renamed but it has been copied with the new name. Please note that if the original pool contained volumes, they have not been moved and they are still assigned to the original pool in the catalog database. To re-assign volumes from the original pool to this one please go to the MAIN MENU ➤ Pools ➤ [NEW POOL] ➤ Tab: Actions and please use the 'Assign volumes' button. After re-assgning volumes you can delete the original pool." +msgstr "The pool has not been renamed but it has been copied with the new name. Please note that if the original pool contained volumes, they have not been moved and they are still assigned to the original pool in the catalog database. To re-assign volumes from the original pool to this one please go to the MAIN MENU ➤ Pools ➤ [NEW POOL] ➤ Tab: Actions and please use the 'Assign volumes' button. After re-assgning volumes you can delete the original pool." diff --git a/gui/baculum/protected/Web/Lang/pt/messages.mo b/gui/baculum/protected/Web/Lang/pt/messages.mo index 62d049175e..6daf4ac577 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 30e182d2a5..c4bb8f6e0d 100644 --- a/gui/baculum/protected/Web/Lang/pt/messages.po +++ b/gui/baculum/protected/Web/Lang/pt/messages.po @@ -3828,3 +3828,24 @@ msgstr "Please mount volume %volume for storage: %storage, pool: %pool, media ty msgid "Please create a new volume for storage: %storage, pool: %pool, media type: %mediatype." msgstr "Please create a new volume for storage: %storage, pool: %pool, media type: %mediatype." + +msgid "Assign volumes from selected pool" +msgstr "Assign volumes from selected pool" + +msgid "This function enables re-assigning volumes from selected pool to this pool." +msgstr "This function enables re-assigning volumes from selected pool to this pool." + +msgid "Please select a pool from which you would like to assign volumes to this pool." +msgstr "Please select a pool from which you would like to assign volumes to this pool." + +msgid "Assigned volume count:" +msgstr "Assigned volume count:" + +msgid "Assign volumes" +msgstr "Assign volumes" + +msgid "No volumes in the pool to assign." +msgstr "No volumes in the pool to assign." + +msgid "The pool has not been renamed but it has been copied with the new name. Please note that if the original pool contained volumes, they have not been moved and they are still assigned to the original pool in the catalog database. To re-assign volumes from the original pool to this one please go to the MAIN MENU ➤ Pools ➤ [NEW POOL] ➤ Tab: Actions and please use the 'Assign volumes' button. After re-assgning volumes you can delete the original pool." +msgstr "The pool has not been renamed but it has been copied with the new name. Please note that if the original pool contained volumes, they have not been moved and they are still assigned to the original pool in the catalog database. To re-assign volumes from the original pool to this one please go to the MAIN MENU ➤ Pools ➤ [NEW POOL] ➤ Tab: Actions and please use the 'Assign volumes' button. After re-assgning volumes you can delete the original pool." diff --git a/gui/baculum/protected/Web/Lang/ru/messages.mo b/gui/baculum/protected/Web/Lang/ru/messages.mo index 929ac449dc..cab4255e07 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 3e38713122..497ac1409b 100644 --- a/gui/baculum/protected/Web/Lang/ru/messages.po +++ b/gui/baculum/protected/Web/Lang/ru/messages.po @@ -3828,3 +3828,24 @@ msgstr "Please mount volume %volume for storage: %storage, pool: %pool, media ty msgid "Please create a new volume for storage: %storage, pool: %pool, media type: %mediatype." msgstr "Please create a new volume for storage: %storage, pool: %pool, media type: %mediatype." + +msgid "Assign volumes from selected pool" +msgstr "Assign volumes from selected pool" + +msgid "This function enables re-assigning volumes from selected pool to this pool." +msgstr "This function enables re-assigning volumes from selected pool to this pool." + +msgid "Please select a pool from which you would like to assign volumes to this pool." +msgstr "Please select a pool from which you would like to assign volumes to this pool." + +msgid "Assigned volume count:" +msgstr "Assigned volume count:" + +msgid "Assign volumes" +msgstr "Assign volumes" + +msgid "No volumes in the pool to assign." +msgstr "No volumes in the pool to assign." + +msgid "The pool has not been renamed but it has been copied with the new name. Please note that if the original pool contained volumes, they have not been moved and they are still assigned to the original pool in the catalog database. To re-assign volumes from the original pool to this one please go to the MAIN MENU ➤ Pools ➤ [NEW POOL] ➤ Tab: Actions and please use the 'Assign volumes' button. After re-assgning volumes you can delete the original pool." +msgstr "The pool has not been renamed but it has been copied with the new name. Please note that if the original pool contained volumes, they have not been moved and they are still assigned to the original pool in the catalog database. To re-assign volumes from the original pool to this one please go to the MAIN MENU ➤ Pools ➤ [NEW POOL] ➤ Tab: Actions and please use the 'Assign volumes' button. After re-assgning volumes you can delete the original pool." diff --git a/gui/baculum/protected/Web/Pages/DirectorView.page b/gui/baculum/protected/Web/Pages/DirectorView.page index 00bfad7462..f24b68a9f6 100644 --- a/gui/baculum/protected/Web/Pages/DirectorView.page +++ b/gui/baculum/protected/Web/Pages/DirectorView.page @@ -935,6 +935,10 @@ function load_director_config() { diff --git a/gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.php b/gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.php index 7145a953ae..1892ef7039 100644 --- a/gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.php +++ b/gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.php @@ -20,6 +20,7 @@ * Bacula(R) is a registered trademark of Kern Sibbald. */ +Prado::using('System.Web.UI.TCommandEventParameter'); Prado::using('System.Web.UI.ActiveControls.TActiveLabel'); Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton'); Prado::using('System.Web.UI.ActiveControls.TActivePanel'); @@ -370,6 +371,11 @@ class BaculaConfigDirectives extends DirectiveListTemplate { // set new resource name $this->setResourceName($res_name_dir); $resource_name = $res_name_dir; + $param = new TCommandEventParameter('rename', [ + 'resource_type' => $resource_type, + 'resource_name' => $resource_name + ]); + $this->onRename($param); } } } else { @@ -579,6 +585,16 @@ class BaculaConfigDirectives extends DirectiveListTemplate { $host = null; $resource_type = $this->getResourceType(); $resource_name = $this->getResourceName(); + + if ($resource_type == 'Pool') { + /** + * For Pools there is done copy resource, not rename, to allow users + * re-assigning volumes from original pool to new pool and at the end + * to remove original pool. + */ + return true; + } + $config = $this->getConfigData($host, array($component_type)); $deps = $this->getModule('data_deps')->checkDependencies( $component_type, @@ -681,7 +697,7 @@ class BaculaConfigDirectives extends DirectiveListTemplate { /** * Set if buttons should be flexible and available at the bottom of the page. * - * @return none; + * @return none */ public function setShowBottomButtons($show) { $show = TPropertyValue::ensureBoolean($show); @@ -697,10 +713,25 @@ class BaculaConfigDirectives extends DirectiveListTemplate { return $this->getViewState(self::SHOW_BOTTOM_BUTTONS, true); } + /** + * On save event fired when resource is saved. + * + * @return none + */ public function onSave($param) { $this->raiseEvent('OnSave', $this, $param); } + /** + * On rename event fired when resource is renamed. + * + * @return none + */ + public function onRename($param) { + $this->raiseEvent('OnRename', $this, $param); + } + + /** * Set if name field should be disabled. * diff --git a/gui/baculum/protected/Web/Portlets/BaculaConfigResourceList.php b/gui/baculum/protected/Web/Portlets/BaculaConfigResourceList.php index 1728223d2f..9ed5cf58e0 100644 --- a/gui/baculum/protected/Web/Portlets/BaculaConfigResourceList.php +++ b/gui/baculum/protected/Web/Portlets/BaculaConfigResourceList.php @@ -189,6 +189,14 @@ class BaculaConfigResourceList extends Portlets { $this->getPage()->getCallbackClient()->show($err_win_id); } + public function renameResource($sender, $param) { + $this->onRename($param); + } + + public function onRename($param) { + $this->raiseEvent('OnRename', $this, $param); + } + public function getHost() { return $this->getViewState(self::HOST); } diff --git a/gui/baculum/protected/Web/Portlets/BaculaConfigResourceList.tpl b/gui/baculum/protected/Web/Portlets/BaculaConfigResourceList.tpl index 88bf0967d8..141ee58298 100644 --- a/gui/baculum/protected/Web/Portlets/BaculaConfigResourceList.tpl +++ b/gui/baculum/protected/Web/Portlets/BaculaConfigResourceList.tpl @@ -141,6 +141,7 @@ var oBaculaConfigResourceList<%=$this->ClientID%> = { ShowBottomButtons="false" SaveDirectiveActionOk="oBaculaConfigResourceWindow<%=$this->ClientID%>.close_resource_window();" OnSave="loadResourceListTable" + OnRename="renameResource" /> diff --git a/gui/baculum/protected/Web/Portlets/LabelVolume.tpl b/gui/baculum/protected/Web/Portlets/LabelVolume.tpl index 6da2e6cfa8..af98a72939 100644 --- a/gui/baculum/protected/Web/Portlets/LabelVolume.tpl +++ b/gui/baculum/protected/Web/Portlets/LabelVolume.tpl @@ -8,7 +8,6 @@  <%[ Label volume(s) ]%> -