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.0.6~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7642da4240244b83da9c62b993d2cf2abbe99cc2;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 f887bf649..be60418d0 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 0d430492e..5e55c4c90 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 fe34e3ece..4af93a8c7 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 d5df33152..f240586ea 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 525bd0c10..c332feb46 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 9aac42976..0fb140132 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 62d049175..6daf4ac57 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 30e182d2a..c4bb8f6e0 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 929ac449d..cab4255e0 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 3e3871312..497ac1409 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 00bfad746..f24b68a9f 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 7145a953a..1892ef703 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 1728223d2..9ed5cf58e 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 88bf0967d..141ee5829 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 6da2e6cfa..af98a7293 100644 --- a/gui/baculum/protected/Web/Portlets/LabelVolume.tpl +++ b/gui/baculum/protected/Web/Portlets/LabelVolume.tpl @@ -8,7 +8,6 @@  <%[ Label volume(s) ]%> -