From: Marcin Haba Date: Thu, 21 Oct 2021 05:23:20 +0000 (+0200) Subject: baculum: New migrate job wizard X-Git-Tag: Release-11.0.6~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41d86595c5993e8b8e6ef6d015caac779f7cd793;p=thirdparty%2Fbacula.git baculum: New migrate job wizard --- diff --git a/gui/baculum/protected/Web/Lang/en/messages.mo b/gui/baculum/protected/Web/Lang/en/messages.mo index 1e4002bf8..b9b82fc4a 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 11109dfbc..7f2dee29e 100644 --- a/gui/baculum/protected/Web/Lang/en/messages.po +++ b/gui/baculum/protected/Web/Lang/en/messages.po @@ -3730,3 +3730,78 @@ msgstr "Setup your custom schedule" msgid "Override directives" msgstr "Override directives" + +msgid "Migrate by job" +msgstr "Migrate by job" + +msgid "Migrate by client" +msgstr "Migrate by client" + +msgid "Migrate by volume" +msgstr "Migrate by volume" + +msgid "Migrate by smallest volume" +msgstr "Migrate by smallest volume" + +msgid "Migrate by oldest volume" +msgstr "Migrate by oldest volume" + +msgid "Migrate using Pool occupancy" +msgstr "Migrate using Pool occupancy" + +msgid "Migrate by Pool time" +msgstr "Migrate by Pool time" + +msgid "Migrate by SQL query" +msgstr "Migrate by SQL query" + +msgid "New migrate job wizard" +msgstr "New migrate job wizard" + +msgid "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing i t to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." +msgstr "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing i t to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." + +msgid "Step 2 - what you want to migrate" +msgstr "Step 2 - what you want to migrate" + +msgid "Please select a pool from which you want to migrate data." +msgstr "Please select a pool from which you want to migrate data." + +msgid "The source pool will be examined for finding backup jobs to migrate." +msgstr "The source pool will be examined for finding backup jobs to migrate." + +msgid "Please select a storage using which you want to read migrate data." +msgstr "Please select a storage using which you want to read migrate data." + +msgid "Because you selected migrate using Pool occupancy, to chosen source pool %pool will be added two directives: Migration Low Bytes and Migration High Bytes." +msgstr "Because you selected migrate using Pool occupancy, to chosen source pool %pool will be added two directives: Migration Low Bytes and Migration High Bytes." + +msgid "Because you selected migrate using Pool time, to chosen source pool %pool will be added the Migration Time directive." +msgstr "Because you selected migrate using Pool time, to chosen source pool %pool will be added the Migration Time directive." + +msgid "Step 3 - how would you like to migrate" +msgstr "Step 3 - how would you like to migrate" + +msgid "Step 4 - where you like to migrate" +msgstr "Step 4 - where you like to migrate" + +msgid "Please select a storage using which you want to write migrated data." +msgstr "Please select a storage using which you want to write migrated data." + +msgid "Step 5 - migrate job options" +msgstr "Step 5 - migrate job options" + +msgid "Purge jobs" +msgstr "Purge jobs" + +msgid "Level, Client and FileSet are not used during migrate jobs running but they are required to define in migrate job resource as the standard Job directives." +msgstr "Level, Client and FileSet are not used during migrate jobs running but they are required to define in migrate job resource as the standard Job directives." + +msgid "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing it to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." +msgstr "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing it to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." + +msgid "New migrate job" +msgstr "New migrate job" + +msgid "Please select the criteria that will be used for selecting backup jobs to migrate." +msgstr "Please select the criteria that will be used for selecting backup jobs to migrate." diff --git a/gui/baculum/protected/Web/Lang/ja/messages.mo b/gui/baculum/protected/Web/Lang/ja/messages.mo index 0894da3ba..5193c2fff 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 eb7b7e012..c4e518935 100644 --- a/gui/baculum/protected/Web/Lang/ja/messages.po +++ b/gui/baculum/protected/Web/Lang/ja/messages.po @@ -3816,3 +3816,78 @@ msgstr "Setup your custom schedule" msgid "Override directives" msgstr "Override directives" + +msgid "Migrate by job" +msgstr "Migrate by job" + +msgid "Migrate by client" +msgstr "Migrate by client" + +msgid "Migrate by volume" +msgstr "Migrate by volume" + +msgid "Migrate by smallest volume" +msgstr "Migrate by smallest volume" + +msgid "Migrate by oldest volume" +msgstr "Migrate by oldest volume" + +msgid "Migrate using Pool occupancy" +msgstr "Migrate using Pool occupancy" + +msgid "Migrate by Pool time" +msgstr "Migrate by Pool time" + +msgid "Migrate by SQL query" +msgstr "Migrate by SQL query" + +msgid "New migrate job wizard" +msgstr "New migrate job wizard" + +msgid "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing i t to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." +msgstr "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing i t to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." + +msgid "Step 2 - what you want to migrate" +msgstr "Step 2 - what you want to migrate" + +msgid "Please select a pool from which you want to migrate data." +msgstr "Please select a pool from which you want to migrate data." + +msgid "The source pool will be examined for finding backup jobs to migrate." +msgstr "The source pool will be examined for finding backup jobs to migrate." + +msgid "Please select a storage using which you want to read migrate data." +msgstr "Please select a storage using which you want to read migrate data." + +msgid "Because you selected migrate using Pool occupancy, to chosen source pool %pool will be added two directives: Migration Low Bytes and Migration High Bytes." +msgstr "Because you selected migrate using Pool occupancy, to chosen source pool %pool will be added two directives: Migration Low Bytes and Migration High Bytes." + +msgid "Because you selected migrate using Pool time, to chosen source pool %pool will be added the Migration Time directive." +msgstr "Because you selected migrate using Pool time, to chosen source pool %pool will be added the Migration Time directive." + +msgid "Step 3 - how would you like to migrate" +msgstr "Step 3 - how would you like to migrate" + +msgid "Step 4 - where you like to migrate" +msgstr "Step 4 - where you like to migrate" + +msgid "Please select a storage using which you want to write migrated data." +msgstr "Please select a storage using which you want to write migrated data." + +msgid "Step 5 - migrate job options" +msgstr "Step 5 - migrate job options" + +msgid "Purge jobs" +msgstr "Purge jobs" + +msgid "Level, Client and FileSet are not used during migrate jobs running but they are required to define in migrate job resource as the standard Job directives." +msgstr "Level, Client and FileSet are not used during migrate jobs running but they are required to define in migrate job resource as the standard Job directives." + +msgid "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing it to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." +msgstr "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing it to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." + +msgid "New migrate job" +msgstr "New migrate job" + +msgid "Please select the criteria that will be used for selecting backup jobs to migrate." +msgstr "Please select the criteria that will be used for selecting backup jobs to migrate." diff --git a/gui/baculum/protected/Web/Lang/pl/messages.mo b/gui/baculum/protected/Web/Lang/pl/messages.mo index 20a1f0892..6f1432726 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 468d6ea4a..769f61178 100644 --- a/gui/baculum/protected/Web/Lang/pl/messages.po +++ b/gui/baculum/protected/Web/Lang/pl/messages.po @@ -3741,3 +3741,78 @@ msgstr "Ustaw swój własny harmonogram" msgid "Override directives" msgstr "Zastąp dyrektywy" + +msgid "Migrate by job" +msgstr "Migrate by job" + +msgid "Migrate by client" +msgstr "Migrate by client" + +msgid "Migrate by volume" +msgstr "Migrate by volume" + +msgid "Migrate by smallest volume" +msgstr "Migrate by smallest volume" + +msgid "Migrate by oldest volume" +msgstr "Migrate by oldest volume" + +msgid "Migrate using Pool occupancy" +msgstr "Migrate using Pool occupancy" + +msgid "Migrate by Pool time" +msgstr "Migrate by Pool time" + +msgid "Migrate by SQL query" +msgstr "Migrate by SQL query" + +msgid "New migrate job wizard" +msgstr "New migrate job wizard" + +msgid "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing i t to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." +msgstr "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing i t to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." + +msgid "Step 2 - what you want to migrate" +msgstr "Step 2 - what you want to migrate" + +msgid "Please select a pool from which you want to migrate data." +msgstr "Please select a pool from which you want to migrate data." + +msgid "The source pool will be examined for finding backup jobs to migrate." +msgstr "The source pool will be examined for finding backup jobs to migrate." + +msgid "Please select a storage using which you want to read migrate data." +msgstr "Please select a storage using which you want to read migrate data." + +msgid "Because you selected migrate using Pool occupancy, to chosen source pool %pool will be added two directives: Migration Low Bytes and Migration High Bytes." +msgstr "Because you selected migrate using Pool occupancy, to chosen source pool %pool will be added two directives: Migration Low Bytes and Migration High Bytes." + +msgid "Because you selected migrate using Pool time, to chosen source pool %pool will be added the Migration Time directive." +msgstr "Because you selected migrate using Pool time, to chosen source pool %pool will be added the Migration Time directive." + +msgid "Step 3 - how would you like to migrate" +msgstr "Step 3 - how would you like to migrate" + +msgid "Step 4 - where you like to migrate" +msgstr "Step 4 - where you like to migrate" + +msgid "Please select a storage using which you want to write migrated data." +msgstr "Please select a storage using which you want to write migrated data." + +msgid "Step 5 - migrate job options" +msgstr "Step 5 - migrate job options" + +msgid "Purge jobs" +msgstr "Purge jobs" + +msgid "Level, Client and FileSet are not used during migrate jobs running but they are required to define in migrate job resource as the standard Job directives." +msgstr "Level, Client and FileSet are not used during migrate jobs running but they are required to define in migrate job resource as the standard Job directives." + +msgid "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing it to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." +msgstr "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing it to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." + +msgid "New migrate job" +msgstr "New migrate job" + +msgid "Please select the criteria that will be used for selecting backup jobs to migrate." +msgstr "Please select the criteria that will be used for selecting backup jobs to migrate." diff --git a/gui/baculum/protected/Web/Lang/pt/messages.mo b/gui/baculum/protected/Web/Lang/pt/messages.mo index 327bdc0c6..17fa3db62 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 1b6e8de74..551b9744b 100644 --- a/gui/baculum/protected/Web/Lang/pt/messages.po +++ b/gui/baculum/protected/Web/Lang/pt/messages.po @@ -3741,3 +3741,78 @@ msgstr "Configurar seu agendamento personalizado" msgid "Override directives" msgstr "Substituir diretivas" + +msgid "Migrate by job" +msgstr "Migrate by job" + +msgid "Migrate by client" +msgstr "Migrate by client" + +msgid "Migrate by volume" +msgstr "Migrate by volume" + +msgid "Migrate by smallest volume" +msgstr "Migrate by smallest volume" + +msgid "Migrate by oldest volume" +msgstr "Migrate by oldest volume" + +msgid "Migrate using Pool occupancy" +msgstr "Migrate using Pool occupancy" + +msgid "Migrate by Pool time" +msgstr "Migrate by Pool time" + +msgid "Migrate by SQL query" +msgstr "Migrate by SQL query" + +msgid "New migrate job wizard" +msgstr "New migrate job wizard" + +msgid "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing i t to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." +msgstr "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing i t to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." + +msgid "Step 2 - what you want to migrate" +msgstr "Step 2 - what you want to migrate" + +msgid "Please select a pool from which you want to migrate data." +msgstr "Please select a pool from which you want to migrate data." + +msgid "The source pool will be examined for finding backup jobs to migrate." +msgstr "The source pool will be examined for finding backup jobs to migrate." + +msgid "Please select a storage using which you want to read migrate data." +msgstr "Please select a storage using which you want to read migrate data." + +msgid "Because you selected migrate using Pool occupancy, to chosen source pool %pool will be added two directives: Migration Low Bytes and Migration High Bytes." +msgstr "Because you selected migrate using Pool occupancy, to chosen source pool %pool will be added two directives: Migration Low Bytes and Migration High Bytes." + +msgid "Because you selected migrate using Pool time, to chosen source pool %pool will be added the Migration Time directive." +msgstr "Because you selected migrate using Pool time, to chosen source pool %pool will be added the Migration Time directive." + +msgid "Step 3 - how would you like to migrate" +msgstr "Step 3 - how would you like to migrate" + +msgid "Step 4 - where you like to migrate" +msgstr "Step 4 - where you like to migrate" + +msgid "Please select a storage using which you want to write migrated data." +msgstr "Please select a storage using which you want to write migrated data." + +msgid "Step 5 - migrate job options" +msgstr "Step 5 - migrate job options" + +msgid "Purge jobs" +msgstr "Purge jobs" + +msgid "Level, Client and FileSet are not used during migrate jobs running but they are required to define in migrate job resource as the standard Job directives." +msgstr "Level, Client and FileSet are not used during migrate jobs running but they are required to define in migrate job resource as the standard Job directives." + +msgid "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing it to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." +msgstr "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing it to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." + +msgid "New migrate job" +msgstr "New migrate job" + +msgid "Please select the criteria that will be used for selecting backup jobs to migrate." +msgstr "Please select the criteria that will be used for selecting backup jobs to migrate." diff --git a/gui/baculum/protected/Web/Lang/ru/messages.mo b/gui/baculum/protected/Web/Lang/ru/messages.mo index 2d8191b76..4fc1dfd01 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 23fdb1eee..1f2997886 100644 --- a/gui/baculum/protected/Web/Lang/ru/messages.po +++ b/gui/baculum/protected/Web/Lang/ru/messages.po @@ -3741,3 +3741,78 @@ msgstr "Настройте свой индивидуальный график" msgid "Override directives" msgstr "Переопределить директивы" + +msgid "Migrate by job" +msgstr "Migrate by job" + +msgid "Migrate by client" +msgstr "Migrate by client" + +msgid "Migrate by volume" +msgstr "Migrate by volume" + +msgid "Migrate by smallest volume" +msgstr "Migrate by smallest volume" + +msgid "Migrate by oldest volume" +msgstr "Migrate by oldest volume" + +msgid "Migrate using Pool occupancy" +msgstr "Migrate using Pool occupancy" + +msgid "Migrate by Pool time" +msgstr "Migrate by Pool time" + +msgid "Migrate by SQL query" +msgstr "Migrate by SQL query" + +msgid "New migrate job wizard" +msgstr "New migrate job wizard" + +msgid "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing i t to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." +msgstr "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing i t to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." + +msgid "Step 2 - what you want to migrate" +msgstr "Step 2 - what you want to migrate" + +msgid "Please select a pool from which you want to migrate data." +msgstr "Please select a pool from which you want to migrate data." + +msgid "The source pool will be examined for finding backup jobs to migrate." +msgstr "The source pool will be examined for finding backup jobs to migrate." + +msgid "Please select a storage using which you want to read migrate data." +msgstr "Please select a storage using which you want to read migrate data." + +msgid "Because you selected migrate using Pool occupancy, to chosen source pool %pool will be added two directives: Migration Low Bytes and Migration High Bytes." +msgstr "Because you selected migrate using Pool occupancy, to chosen source pool %pool will be added two directives: Migration Low Bytes and Migration High Bytes." + +msgid "Because you selected migrate using Pool time, to chosen source pool %pool will be added the Migration Time directive." +msgstr "Because you selected migrate using Pool time, to chosen source pool %pool will be added the Migration Time directive." + +msgid "Step 3 - how would you like to migrate" +msgstr "Step 3 - how would you like to migrate" + +msgid "Step 4 - where you like to migrate" +msgstr "Step 4 - where you like to migrate" + +msgid "Please select a storage using which you want to write migrated data." +msgstr "Please select a storage using which you want to write migrated data." + +msgid "Step 5 - migrate job options" +msgstr "Step 5 - migrate job options" + +msgid "Purge jobs" +msgstr "Purge jobs" + +msgid "Level, Client and FileSet are not used during migrate jobs running but they are required to define in migrate job resource as the standard Job directives." +msgstr "Level, Client and FileSet are not used during migrate jobs running but they are required to define in migrate job resource as the standard Job directives." + +msgid "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing it to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." +msgstr "Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing it to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon." + +msgid "New migrate job" +msgstr "New migrate job" + +msgid "Please select the criteria that will be used for selecting backup jobs to migrate." +msgstr "Please select the criteria that will be used for selecting backup jobs to migrate." diff --git a/gui/baculum/protected/Web/Pages/JobHistoryList.page b/gui/baculum/protected/Web/Pages/JobHistoryList.page index 6ffe38c7a..985857fea 100644 --- a/gui/baculum/protected/Web/Pages/JobHistoryList.page +++ b/gui/baculum/protected/Web/Pages/JobHistoryList.page @@ -10,6 +10,7 @@ +  <%[ Add job ]%> + + + + +
+
+
+
+
+

+
+
+
+
+
+
+

+
+
+
+
+
+
+

+
+
+
+
+
+
+
+
+

+
+
+
+
+
+
+

+
+
+
+
+
+
+

+
+
+
+

<%=$this->Parent->ActiveStep->Title%>

+
+ +
+ +  <%[ Cancel ]%> + + + <%[ Next ]%>  + +
+
+ + +
+ +  <%[ Cancel ]%> + + +  <%[ Previous ]%> + + + <%[ Next ]%>  + +
+
+ +
+ +  <%[ Cancel ]%> + + +  <%[ Previous ]%> + + + <%[ Create job ]%>   + +
+ +
+ +
+

<%[ New migrate job wizard ]%>

+

<%[ Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing it to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon. ]%>

+
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+

<%[ Source Pool ]%>

+

<%[ Please select a pool from which you want to migrate data. ]%>

+

<%[ The source pool will be examined for finding backup jobs to migrate. ]%>

+
+ +
+

<%[ Source Storage ]%>

+

<%[ Please select a storage using which you want to read migrate data. ]%>

+
+
+
+ +
+ + +
+ + + +
+ +
+

<%[ Backup jobs selection criteria ]%>

+

<%[ Please select the criteria that will be used for selecting backup jobs to migrate. ]%>

+
+
+
+ +
+
+ + + + + + + + + + + + + +
+ +
+

<%[ Destination Pool ]%>

+

<%[ Please select destination pool to which will be stored data. ]%>

+
+
+
+ +
+ + + + + +
+
+

<%[ Destination Storage ]%>

+

<%[ Please select a storage using which you want to write migrated data. ]%>

+
+
+
+ +
+
+
+ +
+

<%[ Purge jobs ]%>

+
+
+
+ +
+
+
+

<%[ Limits ]%>

+
+
+
+ +
+
+
+

<%[ Schedule ]%>

+
+
+
+ +
+
+
+

<%[ Messages ]%>

+
+
+
+ +
+
+ + +
+ +
+ <%[ General ]%> +
+
Job Name
+
<%=$this->Name->getDirectiveValue()%>
+
+
+
Description
+
<%=$this->Description->getDirectiveValue() ?: '-'%>
+
+
+
JobDefs
+
<%=$this->JobDefs->getDirectiveValue() ?: '-'%>
+
+
+
+ <%[ What ]%> +
+
Source Pool
+
+ <%=$this->Pool->getDirectiveValue()%> + <%=$this->isInJobDefs('Pool', $this->Pool->getDirectiveValue()) ? ' (' . Prado::localize('inherited from JobDefs') . ')': ''%> +
+
+
+
Source Storage
+
+ <%=$this->SourceStorage->getDirectiveValue()%> + <%=$this->isInJobDefs('Storage', $this->SourceStorage->getDirectiveValue()) ? ' (' . Prado::localize('inherited from JobDefs') . ')': ''%> +
+
+
+
+ <%[ How ]%> +
+
Selection Type
+
+ <%=$this->sel_types[$this->SelectionType->getDirectiveValue()]%> + <%=$this->isInJobDefs('SelectionType', $this->SelectionType->getDirectiveValue()) ? ' (' . Prado::localize('inherited from JobDefs') . ')': ''%> +
+
+
+
Selection Pattern
+
+ <%=$this->getPage()->getSelectionPatternValue() ?: '-'%> + <%=$this->isInJobDefs('SelectionPattern', ($this->getSelectionPatternControl() ? $this->getSelectionPatternControl()->getDirectiveValue() : '')) ? ' (' . Prado::localize('inherited from JobDefs') . ')': ''%> +
+
+
+
Migration High Bytes
+
+ <%=$this->MigrationHighBytes->Directive->getText()%> <%=$this->MigrationHighBytes->SizeFormat->getSelectedItem()->getText()%> + <%=$this->isInJobDefs('MigrationHighBytes', ($this->MigrationHighBytes->getValue() ? $this->MigrationHighBytes->getValue() : '')) ? ' (' . Prado::localize('inherited from JobDefs') . ')': ''%> +
+
+
+
Migration Low Bytes
+
+ <%=$this->MigrationLowBytes->Directive->getText()%> <%=$this->MigrationLowBytes->SizeFormat->getSelectedItem()->getText()%> + <%=$this->isInJobDefs('MigrationLowBytes', ($this->MigrationLowBytes->getValue() ? $this->MigrationLowBytes->getValue() : '')) ? ' (' . Prado::localize('inherited from JobDefs') . ')': ''%> +
+
+
+
Migration Time
+
+ <%=$this->MigrationTime->Directive->getText()%> <%=$this->MigrationTime->TimeFormat->getSelectedItem()->getText()%> + <%=$this->isInJobDefs('MigrationTime', ($this->MigrationTime->getValue() ? $this->MigrationTime->getValue() : '')) ? ' (' . Prado::localize('inherited from JobDefs') . ')': ''%> +
+
+
+
+ <%[ Where ]%> +
+
Destination Pool (NextPool)
+
+ <%=$this->NextPool->getDirectiveValue()%> + <%=$this->isInJobDefs('NextPool', $this->Pool->getDirectiveValue()) ? ' (' . Prado::localize('inherited from JobDefs') . ')': ''%> +
+
+
+
Destination Storage
+
+ <%=$this->DestinationStorage->getDirectiveValue()%> +
+
+
+
+ <%[ Options ]%> +
+
Purge Migration Job
+
+ <%=$this->PurgeMigrationJob->getValue() ? Prado::localize('Yes') : Prado::localize('No')%> + <%=$this->isInJobDefs('PurgeMigrationJob', $this->PurgeMigrationJob->getValue()) ? ' (' . Prado::localize('inherited from JobDefs') . ')': ''%> +
+
+
+
Maximum Spawned Jobs
+
+ <%=$this->MaximumSpawnedJobs->getDirectiveValue() ?: '-'%> + <%=$this->isInJobDefs('MaximumSpawnedJobs', $this->MaximumSpawnedJobs->getDirectiveValue()) ? ' (' . Prado::localize('inherited from JobDefs') . ')': ''%> +
+
+
+
Schedule
+
+ <%=$this->Schedule->getDirectiveValue() ?: '-' %> + <%=$this->isInJobDefs('Schedule', $this->Schedule->getDirectiveValue()) ? ' (' . Prado::localize('inherited from JobDefs') . ')': ''%> +
+
+
+
Messages
+
+ <%=$this->Messages->getDirectiveValue() ?: '-'%> + <%=$this->isInJobDefs('Messages', $this->Messages->getDirectiveValue()) ? ' (' . Prado::localize('inherited from JobDefs') . ')': ''%> +
+
+
+
Level
+
+ <%=$this->Level->getDirectiveValue() ?: '-'%> + (<%[ Not used ]%>) <%=$this->isInJobDefs('Level', $this->Level->getDirectiveValue()) ? ' (' . Prado::localize('inherited from JobDefs') . ')': ''%> +
+
+
+
Client
+
+ <%=$this->Client->getDirectiveValue()%> + (<%[ Not used ]%>) <%=$this->isInJobDefs('Client', $this->Client->getDirectiveValue()) ? ' (' . Prado::localize('inherited from JobDefs') . ')': ''%> +
+
+
+
FileSet
+
+ <%=$this->FileSet->getDirectiveValue()%> + (<%[ Not used ]%>) <%=$this->isInJobDefs('Fileset', $this->FileSet->getDirectiveValue()) ? ' (' . Prado::localize('inherited from JobDefs') . ')': ''%> +
+
+
+ +
+
+
diff --git a/gui/baculum/protected/Web/Pages/NewMigrateJobWizard.php b/gui/baculum/protected/Web/Pages/NewMigrateJobWizard.php new file mode 100644 index 000000000..be106dcb1 --- /dev/null +++ b/gui/baculum/protected/Web/Pages/NewMigrateJobWizard.php @@ -0,0 +1,788 @@ + + * @category Page + * @package Baculum Web + */ +class NewMigrateJobWizard extends BaculumWebPage { + + const PREV_STEP = 'PrevStep'; + const JOBDEFS = 'JobDefs'; + + /** + * Stores available selection types. + * + * @var array + */ + public $sel_types = []; + + public function onInit($param) { + parent::onInit($param); + $this->sel_types = [ + 'Job' => Prado::localize('Migrate by job'), + 'Client' => Prado::localize('Migrate by client'), + 'Volume' => Prado::localize('Migrate by volume'), + 'SmallestVolume' => Prado::localize('Migrate by smallest volume'), + 'OldestVolume' => Prado::localize('Migrate by oldest volume'), + 'PoolOccupancy' => Prado::localize('Migrate using Pool occupancy'), + 'PoolTime' => Prado::localize('Migrate by Pool time'), + 'SQLQuery' => Prado::localize('Migrate by SQL query') + ]; + } + + public function onPreRender($param) { + parent::onPreRender($param); + if ($this->IsCallBack) { + return; + } + $step_index = $this->NewJobWizard->getActiveStepIndex(); + $prev_step = $this->getPrevStep(); + $this->setPrevStep($step_index); + if ($prev_step > $step_index) { + return; + } + switch ($step_index) { + case 0: { + $this->loadJobDefs(); + break; + } + case 1: { + $this->setupJobDefs(); + $this->loadPools(); + $this->loadSourceStorages(); + break; + } + case 2: { + $this->loadSelectionTypes(); + break; + } + case 3: { + $this->loadNextPools(); + $this->loadDestinationStorages(); + break; + } + case 4: { + $this->loadSchedules(); + $this->loadMessages(); + $this->loadLevels(); + $this->loadClients(); + $this->loadFileSets(); + break; + } + } + } + + /** + * Wizard previous button callback actions. + * + * @param TWizard $sender sender object + * @param TWizardNavigationEventParameter $param sender parameters + * @return none + */ + public function wizardPrev($sender, $param) { + } + + /** + * Wizard next button callback actions. + * + * @param TWizard $sender sender object + * @param TWizardNavigationEventParameter $param sender parameters + * @return none + */ + public function wizardNext($sender, $param) { + } + + /** + * Load JobDefs (step 1). + * + * @return none + */ + public function loadJobDefs() { + $jobdefs_list = []; + $jobdefs = $this->getModule('api')->get([ + 'config', + 'dir', + 'jobdefs'] + ); + if ($jobdefs->error === 0) { + for ($i = 0; $i < count($jobdefs->output); $i++) { + $jobdefs_list[] = $jobdefs->output[$i]->JobDefs->Name; + } + asort($jobdefs_list); + $this->JobDefs->setData($jobdefs_list); + $this->JobDefs->createDirective(); + } + } + + /** + * Setup and remember selected JobDefs values to use in next wizard steps. + * + * @return none + */ + public function setupJobDefs() { + $directive_value = $this->JobDefs->getDirectiveValue(); + if (is_null($directive_value)) { + return; + } + $jobdefs = $directive_value; + $result = $this->getModule('api')->get([ + 'config', + 'dir', + 'jobdefs', + $jobdefs + ]); + if ($result->error === 0) { + $value = (array)$result->output; + $this->setJobDefs($value); + } + } + + /** + * Check if directive with given value exists in used JobDefs. + * + * @param string $directive_name directive name + * @param string $directive_value directive value + * @return boolean true if directive exists in JobDefs, otherwise false + */ + public function isInJobDefs($directive_name, $directive_value) { + $jobdefs = $this->getJobDefs(); + $ret = false; + if ($directive_name === 'Storage') { + $ret = (key_exists($directive_name, $jobdefs) && $jobdefs[$directive_name][0] === $directive_value); + } else { + $ret = (key_exists($directive_name, $jobdefs) && $jobdefs[$directive_name] === $directive_value); + } + return $ret; + } + + /** + * Set pool type controls (Pool, NextPool ...etc.) + * + * @param string $name pool type directive name + * @param object $control different type of controls (usually DirectiveComboBox) + * @return none + */ + public function setPools($name, $control) { + $pool_list = []; + $pools = $this->getModule('api')->get(['config', 'dir', 'pool'])->output; + for ($i = 0; $i < count($pools); $i++) { + $pool_list[] = $pools[$i]->Pool->Name; + } + asort($pool_list); + $control->setData($pool_list); + $jobdefs = $this->getJobDefs(); + if (key_exists($name, $jobdefs) && is_null($control->getDirectiveValue())) { + $control->setDirectiveValue($jobdefs[$name]); + } + $control->createDirective(); + } + + /** + * Load pool list (step 2). + * + * @return none + */ + public function loadPools() { + $this->setPools('Pool', $this->Pool); + } + + /** + * Load volumes to display while source pool is configured. + * + * @param TCallback $sender callback object + * @param TCallbackEventParameter $param callback parameter + * @return none + */ + public function loadVolumes($sender, $param) { + $pool = $param->getCallbackParameter(); + $volumes = $this->getVolumes($pool); + $this->getCallbackClient()->callClientFunction( + 'oVolumeList.update', + [$volumes] + ); + } + + /** + * Get volume list for given pool. + * + * @param string $pool pool name + * @return array volume list or empty array on error + */ + public function getVolumes($pool) { + $poolid = null; + $result = $this->getModule('api')->get(['pools']); + if ($result->error === 0) { + for ($i = 0; $i < count($result->output); $i++) { + if ($pool === $result->output[$i]->name) { + $poolid = $result->output[$i]->poolid; + break; + } + } + } + $ret = []; + if ($poolid) { + $result = $this->getModule('api')->get( + ['pools', $poolid, 'volumes'] + ); + if ($result->error === 0) { + $ret = $result->output; + } + } + return $ret; + } + + /** + * Load source storage list (step 2). + * + * @return none + */ + public function loadSourceStorages() { + $this->setStorages($this->SourceStorage); + } + + /** + * Set source storage control basing on pool configuration. + * + * @param TCallback $sender callback object + * @param TCallbackEventParameter $param callback parameter + * @return none + */ + public function setSourceStorageByPool($sender, $param) { + $pool = $this->Pool->getDirectiveValue(); + if (empty($pool)) { + return; + } + $this->setStorageByPool($pool, 'set_storage_from_pool_cb'); + } + + /** + * Load selection types (step 3). + * + * @return none + */ + public function loadSelectionTypes() { + $this->SelectionType->setData($this->sel_types); + $this->SelectionType->createDirective(); + } + + /** + * Load jobs to select one (step 3). + * + * @param TCallback $sender callback object + * @param TCallbackEventParameter $param callback parameter + * @return none + */ + public function loadJobList($sender, $param) { + $result = $this->getModule('api')->get([ + 'jobs', + 'show', + '?output=json' + ]); + $jobs = []; + if ($result->error === 0) { + for ($i = 0; $i < count($result->output); $i++) { + if ($result->output[$i]->jobtype != '66') { + continue; + } + $jobs[] = [ + 'job' => $result->output[$i]->name, + 'enabled' => $result->output[$i]->enabled, + 'priority' => $result->output[$i]->priority, + 'type' => chr($result->output[$i]->jobtype), + 'maxjobs' => $result->output[$i]->maxjobs + ]; + } + } + $this->getCallbackClient()->callClientFunction( + 'oJobList.init', + [$jobs] + ); + } + + /** + * Load clients to select one (step 3). + * + * @param TCallback $sender callback object + * @param TCallbackEventParameter $param callback parameter + * @return none + */ + public function loadClientList($sender, $param) { + $result = $this->getModule('api')->get( + ['clients'] + ); + $clients = []; + if ($result->error === 0) { + $clients = $result->output; + } + $this->getCallbackClient()->callClientFunction( + 'oClientList.init', + [$clients] + ); + } + + /** + * Load pool list (step 4). + * + * @return none + */ + public function loadNextPools() { + $this->setPools('NextPool', $this->NextPool); + } + + public function setStorages($control) { + $storage_list = []; + $storages = $this->getModule('api')->get([ + 'config', + 'dir', + 'storage' + ]); + if ($storages->error === 0) { + for ($i = 0; $i < count($storages->output); $i++) { + $storage_list[] = $storages->output[$i]->Storage->Name; + } + sort($storage_list); + $control->setData($storage_list); + $jobdefs = $this->getJobDefs(); + if (key_exists('Storage', $jobdefs) && is_array($jobdefs['Storage']) && count($jobdefs['Storage']) == 1 && is_null($control->getDirectiveValue())) { + $control->setDirectiveValue($jobdefs['Storage'][0]); + } + $control->createDirective(); + } + } + + /** + * Load destination storage list (step 4). + * + * @return none + */ + public function loadDestinationStorages() { + $this->setStorages($this->DestinationStorage); + } + + /** + * Set storage control basing on usage in pool. + * + * @param TCallback $sender callback object + * @param TCallbackEventParameter $param callback parameter + * @return none + */ + public function setStorageByPool($pool, $cb) { + $pool = $this->getModule('api')->get([ + 'config', + 'dir', + 'pool', + $pool + ]); + if ($pool->error === 0) { + $storage = null; + if (property_exists($pool->output, 'Storage') && is_array($pool->output->Storage) && count($pool->output->Storage) == 1) { + $storage = $pool->output->Storage[0]; + } + $this->getCallbackClient()->callClientFunction($cb, [$storage]); + } + } + + /** + * Set destination storage control basing on pool configuration. + * + * @param TCallback $sender callback object + * @param TCallbackEventParameter $param callback parameter + * @return none + */ + public function setDestinationStorageByPool($sender, $param) { + $nextpool = $this->NextPool->getDirectiveValue(); + if (empty($nextpool)) { + return; + } + $this->setStorageByPool($nextpool, 'set_storage_from_pool_cb'); + } + + /** + * Get jobs that use pool and send them to warning box. + * + * @param TCallback $sender callback object + * @param TCallbackEventParameter $param callback parameter + * @return none + */ + public function getJobsUsingPool($sender, $param) { + $values = $param->getCallbackParameter(); + $job_list = []; + $jobs = $this->getModule('api')->get([ + 'config', + 'dir', + 'job', + '?apply_jobdefs=1' + ]); + if ($jobs->error === 0) { + for ($i = 0; $i < count($jobs->output); $i++) { + if (property_exists($jobs->output[$i]->Job, 'Pool') && $jobs->output[$i]->Job->Pool == $values->pool) { + $job_list[] = $jobs->output[$i]->Job->Name; + } + } + } + if (count($job_list) > 0) { + sort($job_list); + $this->getCallbackClient()->callClientFunction('show_storage_warning', [ + $values->storage, + $values->pool, + $job_list + ]); + } + } + + /** + * Load messages (step 5). + * + * @return none + */ + public function loadMessages() { + $message_list = []; + $messages = $this->getModule('api')->get([ + 'config', + 'dir', + 'messages' + ]); + if ($messages->error === 0) { + for ($i = 0; $i < count($messages->output); $i++) { + $message_list[] = $messages->output[$i]->Messages->Name; + } + sort($message_list); + $this->Messages->setData($message_list); + $jobdefs = $this->getJobDefs(); + if (key_exists('Messages', $jobdefs)) { + $this->Messages->setDirectiveValue($jobdefs['Messages']); + } + $this->Messages->createDirective(); + } + } + + /** + * Load schedule (step 5). + * + * @return none + */ + public function loadSchedules() { + $schedule_list = []; + $schedules = $this->getModule('api')->get([ + 'config', + 'dir', + 'schedule' + ]); + if ($schedules->error === 0) { + for ($i = 0; $i < count($schedules->output); $i++) { + $schedule_list[] = $schedules->output[$i]->Schedule->Name; + } + asort($schedule_list); + $this->Schedule->setData($schedule_list); + $jobdefs = $this->getJobDefs(); + if (key_exists('Schedule', $jobdefs)) { + $this->Schedule->setDirectiveValue($jobdefs['Schedule']); + } + $this->Schedule->createDirective(); + } + } + + /** + * Load job levels (step 5). + * + * @return none + */ + public function loadLevels() { + // so far backup job levels only + $levels = $this->getModule('misc')->getJobLevels(); + $level_list = array_values($levels); + $this->Level->setData($level_list); + $jobdefs = $this->getJobDefs(); + if (key_exists('Level', $jobdefs)) { + $this->Level->setDirectiveValue($jobdefs['Level']); + } elseif (count($level_list) > 0) { + // no level in jobdefs, take first level + $this->Level->setDirectiveValue($level_list[0]); + } + $this->Level->createDirective(); + } + + /** + * Load clients (step 5). + * + * @return none + */ + public function loadClients() { + $clients = $this->getModule('api')->get([ + 'config', + 'dir', + 'client' + ]); + if ($clients->error === 0) { + for ($i = 0; $i < count($clients->output); $i++) { + $client_list[] = $clients->output[$i]->Client->Name; + } + sort($client_list); + $this->Client->setData($client_list); + $jobdefs = $this->getJobDefs(); + if (key_exists('Client', $jobdefs) && is_array($jobdefs['Client']) && is_null($this->Client->getDirectiveValue())) { + $this->Client->setDirectiveValue($jobdefs['Client']); + } elseif (count($client_list) > 0) { + $this->Client->setDirectiveValue($client_list[0]); + } + $this->Client->createDirective(); + } + } + + /** + * Load filesets (step 5). + * + * @return none + */ + public function loadFileSets() { + $filesets = $this->getModule('api')->get([ + 'config', + 'dir', + 'fileset' + ]); + if ($filesets->error === 0) { + for ($i = 0; $i < count($filesets->output); $i++) { + $fileset_list[] = $filesets->output[$i]->Fileset->Name; + } + sort($fileset_list); + $this->FileSet->setData($fileset_list); + $jobdefs = $this->getJobDefs(); + if (key_exists('Fileset', $jobdefs) && is_array($jobdefs['Fileset']) && is_null($this->Fileset->getDirectiveValue())) { + $this->FileSet->setDirectiveValue($jobdefs['Fileset']); + } elseif (count($fileset_list) > 0) { + $this->FileSet->setDirectiveValue($fileset_list[0]); + } + $this->FileSet->createDirective(); + } + } + + /** + * Get selection pattern control. + * + * @return DirectiveTextBox selection pattern control. + */ + public function getSelectionPatternControl() { + $control = null; + $sel_type = $this->SelectionType->getDirectiveValue(); + switch ($sel_type) { + case 'Job': $control = $this->SelectionPatternJob; break; + case 'Client': $control = $this->SelectionPatternClient; break; + case 'Volume': $control = $this->SelectionPatternVolume; break; + case 'SQLQuery': $control = $this->SelectionPatternSQLQuery; break; + } + return $control; + } + + /** + * Get selection pattern value. + * + * @return string selection pattern value + */ + public function getSelectionPatternValue() { + $sel_pattern = ''; + $sp_control = $this->getSelectionPatternControl(); + if (is_object($sp_control)) { + $sel_pattern = $sp_control->getDirectiveValue(); + } + return $sel_pattern; + } + + public function wizardCompleted($sender, $param) { + $jobdefs = $this->getJobDefs(); + $job = [ + 'Name' => $this->Name->getDirectiveValue(), + 'Type' => 'Migrate', + ]; + $jd = $this->JobDefs->getDirectiveValue(); + $directives = ['Description', 'Pool', 'SourceStorage', 'Level', + 'SelectionType', 'MaximumSpawnedJobs', 'Schedule', + 'Messages', 'Client', 'FileSet', 'NextPool', 'PurgeMigrationJob' + ]; + if (is_string($jd)) { + $job['JobDefs'] = $jd; + } + for ($i = 0; $i < count($directives); $i++) { + $val = $this->{$directives[$i]}->getDirectiveValue(); + if (is_null($val)) { + continue; + } + $directive = $directives[$i]; + if ($directive == 'SourceStorage') { + $directive = 'Storage'; + } + if (is_null($jd) || !$this->isInJobDefs($directive, $val)) { + $job[$directive] = $val; + } + } + + // selection type + $sel_type = $this->SelectionType->getDirectiveValue(); + $job['SelectionType'] = $sel_type; + + // selection pattern + $sel_pattern = $this->getSelectionPatternValue(); + if (!empty($sel_pattern)) { + $job['SelectionPattern'] = $sel_pattern; + } + + // Add to source pool directives specific for pool occupancy and pool time selection type + if ($sel_type == 'PoolOccupancy' || $sel_type == 'PoolTime') { + $pool = $this->Pool->getDirectiveValue(); + $params = [ + 'config', + 'dir', + 'Pool', + $pool + ]; + $result = $this->getModule('api')->get( + $params + ); + + if ($result->error === 0) { + $pool = (array)$result->output; + if ($sel_type == 'PoolOccupancy') { + $pool['MigrationLowBytes'] = $this->MigrationLowBytes->getDirectiveValue(); + $pool['MigrationHighBytes'] = $this->MigrationHighBytes->getDirectiveValue(); + } elseif ($sel_type == 'PoolTime') { + $pool['MigrationTime'] = $this->MigrationTime->getDirectiveValue(); + } + + $result = $this->getModule('api')->set( + $params, + ['config' => json_encode($pool)] + ); + + if ($result->error !== 0) { + $this->CreateResourceErrMsg->Display = 'Dynamic'; + $this->CreateResourceErrMsg->Text = $result->output; + return; // END + } + } + } + + // Add storage to pool + $nextpool = $this->NextPool->getDirectiveValue(); + $params = [ + 'config', + 'dir', + 'Pool', + $nextpool + ]; + $result = $this->getModule('api')->get( + $params + ); + + $pool_modified = false; + if ($result->error === 0) { + $pool = (array)$result->output; + $pool['Storage'] = $this->DestinationStorage->getDirectiveValue(); + $result = $this->getModule('api')->set( + $params, + ['config' => json_encode($pool)] + ); + if ($result->error === 0) { + $pool_modified = true; + } else { + $this->CreateResourceErrMsg->Display = 'Dynamic'; + $this->CreateResourceErrMsg->Text = $result->output; + } + } + + // create migrate job + if ($pool_modified) { + $params = [ + 'config', + 'dir', + 'Job', + $job['Name'] + ]; + $result = $this->getModule('api')->set( + $params, + ['config' => json_encode($job)] + ); + if ($result->error === 0) { + $this->getModule('api')->set(array('console'), array('reload')); + $this->goToPage('JobList'); + } else { + $this->CreateResourceErrMsg->Display = 'Dynamic'; + $this->CreateResourceErrMsg->Text = $result->output; + } + } + } + + /** + * Cancel wizard. + * + * @return none + */ + public function wizardStop($sender, $param) { + $this->goToDefaultPage(); + } + + /** + * Set selected JobDefs values. + * + * @param $jobdefs selected JobDefs values + * @return none + */ + public function setJobDefs($jobdefs) { + $this->setViewState(self::JOBDEFS, $jobdefs); + } + + /** + * Get selected JobDefs values. + * + * @return array selected JobDefs values + */ + public function getJobDefs() { + return $this->getViewState(self::JOBDEFS, array()); + } + + /** + * Set previous wizard step. + * + * @param integer $step previous step number + * @return none + */ + public function setPrevStep($step) { + $step = intval($step); + $this->setViewState(self::PREV_STEP, $step); + } + + /** + * Get previous wizard step. + * + * @return integer previous wizard step + */ + public function getPrevStep() { + return $this->getViewState(self::PREV_STEP); + } +} +?> diff --git a/gui/baculum/protected/Web/endpoints.xml b/gui/baculum/protected/Web/endpoints.xml index 51eb579fb..76463225f 100644 --- a/gui/baculum/protected/Web/endpoints.xml +++ b/gui/baculum/protected/Web/endpoints.xml @@ -39,6 +39,7 @@ +