From: Marcin Haba Date: Sat, 28 Nov 2015 10:16:37 +0000 (+0100) Subject: baculum: Split configuration windows into two tabs: actions and console X-Git-Tag: Release-7.4.0~159 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=87108179780719f2f03fe45ee369e1596e1f0c7e;p=bacula%2Fbacula baculum: Split configuration windows into two tabs: actions and console --- diff --git a/gui/baculum/protected/JavaScript/configuration-window.js b/gui/baculum/protected/JavaScript/configuration-window.js index dbbe28268d..cd4ff3fb3a 100644 --- a/gui/baculum/protected/JavaScript/configuration-window.js +++ b/gui/baculum/protected/JavaScript/configuration-window.js @@ -13,6 +13,7 @@ var ConfigurationWindowClass = new Class.create({ show: function() { this.hideAll(); + this.initTabs(); $(this.window_id).setStyle({'display' : 'block'}); $$('div[id=' + this.window_id + '] input[type="submit"]').each(function(el) { el.observe('click', function() { @@ -60,6 +61,38 @@ var ConfigurationWindowClass = new Class.create({ is_progress: function() { return $(this.progress_id).getStyle('display') == 'block'; }, + + initTabs: function() { + var show_elements = []; + var element; + var tabs = $$('div[id=' + this.window_id + '] span.tab'); + tabs.each(function(el) { + element = el.readAttribute('rel'); + show_elements.push($(element)); + el.observe('click', function() { + show_elements.invoke('hide'); + tabs.invoke('removeClassName', 'tab_active'); + el.addClassName('tab_active'); + var show_el = $(el.readAttribute('rel')); + $(show_el).show(); + }.bind(this)); + }.bind(this)); + }, + + switchTab: function(tab_rel) { + var tabs = $$('div[id=' + this.window_id + '] span.tab'); + tabs.each(function(el) { + element = el.readAttribute('rel'); + if (element == tab_rel) { + el.addClassName('tab_active'); + } else { + el.removeClassName('tab_active'); + } + $(element).hide(); + }); + $(tab_rel).show(); + }, + openConfigurationWindow: function(slideWindowObj) { if(this.is_progress() === false) { this.progress(true); diff --git a/gui/baculum/protected/Lang/en/messages.mo b/gui/baculum/protected/Lang/en/messages.mo index e7d19e89dd..52ab131e48 100644 Binary files a/gui/baculum/protected/Lang/en/messages.mo and b/gui/baculum/protected/Lang/en/messages.mo differ diff --git a/gui/baculum/protected/Lang/en/messages.po b/gui/baculum/protected/Lang/en/messages.po index 84dd8cb876..4d5d1c4e28 100644 --- a/gui/baculum/protected/Lang/en/messages.po +++ b/gui/baculum/protected/Lang/en/messages.po @@ -1013,3 +1013,6 @@ msgstr "Finished jobs:" msgid "Add" msgstr "Add" +msgid "Actions" +msgstr "Actions" + diff --git a/gui/baculum/protected/Lang/pl/messages.mo b/gui/baculum/protected/Lang/pl/messages.mo index d6f8946779..b83bca1bed 100644 Binary files a/gui/baculum/protected/Lang/pl/messages.mo and b/gui/baculum/protected/Lang/pl/messages.mo differ diff --git a/gui/baculum/protected/Lang/pl/messages.po b/gui/baculum/protected/Lang/pl/messages.po index 761e21bf98..13a8987db3 100644 --- a/gui/baculum/protected/Lang/pl/messages.po +++ b/gui/baculum/protected/Lang/pl/messages.po @@ -1014,3 +1014,6 @@ msgstr "Zakończone zadania:" msgid "Add" msgstr "Dodaj" +msgid "Actions" +msgstr "Akcje" + diff --git a/gui/baculum/protected/Portlets/ClientConfiguration.tpl b/gui/baculum/protected/Portlets/ClientConfiguration.tpl index 0660892bd4..6bf974ea4a 100644 --- a/gui/baculum/protected/Portlets/ClientConfiguration.tpl +++ b/gui/baculum/protected/Portlets/ClientConfiguration.tpl @@ -1,53 +1,66 @@ <%@ MasterClass="Application.Portlets.ConfigurationPanel"%> - <%[ Client name: ]%>
- -
- -
<%[ Console status ]%>
-
- -
-
- -
-
-
-
- - +

<%[ Client name: ]%>

+ + <%[ Actions ]%> + <%[ Console status ]%> +
+
+ +
+
+
+ + +
-
-
-
-
- - +
+
+
+ + +
-
-
-
-
-
- - -
- + +
+ + + ConfigurationWindow.getObj('ClientWindow').progress(false); + ConfigurationWindow.getObj('ClientWindow').switchTab('client_console_tab'); + + + + + ConfigurationWindow.getObj('ClientWindow').progress(false); + client_callback_func(); + + +
+
+ diff --git a/gui/baculum/protected/Portlets/JobConfiguration.php b/gui/baculum/protected/Portlets/JobConfiguration.php index 061db24313..0be1ad5c71 100644 --- a/gui/baculum/protected/Portlets/JobConfiguration.php +++ b/gui/baculum/protected/Portlets/JobConfiguration.php @@ -113,6 +113,9 @@ class JobConfiguration extends Portlets { $this->Priority->Text = ($jobdata->priorjobid == 0) ? self::DEFAULT_JOB_PRIORITY : $jobdata->priorjobid; $this->DeleteButton->Visible = true; $this->CancelButton->Visible = $this->RefreshStart->Value = in_array($jobdata->jobstatus, $runningJobStates); + $this->Run->Display = 'Dynamic'; + $this->EstimateLine->Display = 'Dynamic'; + $this->Status->Visible = true; } public function status($sender, $param) { @@ -131,12 +134,16 @@ class JobConfiguration extends Portlets { public function delete($sender, $param) { $this->Application->getModule('api')->remove(array('jobs', $this->JobID->Text)); + $this->Status->Visible = false; + $this->Run->Display = 'None'; $this->DeleteButton->Visible = false; + $this->EstimateLine->Display = 'None'; } public function cancel($sender, $param) { $this->Application->getModule('api')->set(array('jobs', 'cancel', $this->JobID->Text), array('a' => 'b')); $this->CancelButton->Visible = false; + $this->status(null, null); } public function run_again($sender, $param) { diff --git a/gui/baculum/protected/Portlets/JobConfiguration.tpl b/gui/baculum/protected/Portlets/JobConfiguration.tpl index 2d0d73df8f..71e78dbe57 100644 --- a/gui/baculum/protected/Portlets/JobConfiguration.tpl +++ b/gui/baculum/protected/Portlets/JobConfiguration.tpl @@ -1,164 +1,201 @@ <%@ MasterClass="Application.Portlets.ConfigurationPanel"%> - <%[ Job name: ]%> -
- -
-
-
- - - var job_to_verify = $('<%=$this->JobToVerifyOptionsLine->ClientID%>'); - var verify_options = $('<%=$this->JobToVerifyOptionsLine->ClientID%>'); - var verify_by_job_name = $('<%=$this->JobToVerifyJobNameLine->ClientID%>'); - var verify_by_jobid = $('<%=$this->JobToVerifyJobIdLine->ClientID%>'); - var accurate = $('<%=$this->AccurateLine->ClientID%>'); - var estimate = $('<%=$this->EstimateLine->ClientID%>'); - var verify_current_opt = $('<%=$this->JobToVerifyOptions->ClientID%>').value; - if(/^(<%=implode('|', $this->jobToVerify)%>)$/.test(this.value)) { - accurate.hide(); - estimate.hide(); - verify_options.show(); - job_to_verify.show(); - if (verify_current_opt == 'jobid') { +

<%[ Job name: ]%>

+ <%[ Actions ]%> + <%[ Console status ]%> +
+
+ +
+
+
+ + + var job_to_verify = $('<%=$this->JobToVerifyOptionsLine->ClientID%>'); + var verify_options = $('<%=$this->JobToVerifyOptionsLine->ClientID%>'); + var verify_by_job_name = $('<%=$this->JobToVerifyJobNameLine->ClientID%>'); + var verify_by_jobid = $('<%=$this->JobToVerifyJobIdLine->ClientID%>'); + var accurate = $('<%=$this->AccurateLine->ClientID%>'); + var estimate = $('<%=$this->EstimateLine->ClientID%>'); + var verify_current_opt = $('<%=$this->JobToVerifyOptions->ClientID%>').value; + if(/^(<%=implode('|', $this->jobToVerify)%>)$/.test(this.value)) { + accurate.hide(); + estimate.hide(); + verify_options.show(); + job_to_verify.show(); + if (verify_current_opt == 'jobid') { + verify_by_job_name.hide(); + verify_by_jobid.show(); + } else if (verify_current_opt == 'jobname') { + verify_by_job_name.show(); + verify_by_jobid.hide(); + } + } else if (job_to_verify.visible()) { + job_to_verify.hide(); + verify_options.hide(); verify_by_job_name.hide(); - verify_by_jobid.show(); - } else if (verify_current_opt == 'jobname') { - verify_by_job_name.show(); verify_by_jobid.hide(); + accurate.show(); + estimate.show(); } - } else if (job_to_verify.visible()) { - job_to_verify.hide(); - verify_options.hide(); - verify_by_job_name.hide(); - verify_by_jobid.hide(); - accurate.show(); - estimate.show(); - } - - -
-
- -
-
- - - var verify_by_job_name = $('<%=$this->JobToVerifyJobNameLine->ClientID%>'); - var verify_by_jobid = $('<%=$this->JobToVerifyJobIdLine->ClientID%>'); - if (this.value == 'jobname') { - verify_by_jobid.hide(); - verify_by_job_name.show(); - } else if (this.value == 'jobid') { - verify_by_job_name.hide(); - verify_by_jobid.show(); - } else { - verify_by_job_name.hide(); - verify_by_jobid.hide(); - } - - + + +
- - -
-
- -
-
- -
-
- - + +
+
+ + + var verify_by_job_name = $('<%=$this->JobToVerifyJobNameLine->ClientID%>'); + var verify_by_jobid = $('<%=$this->JobToVerifyJobIdLine->ClientID%>'); + if (this.value == 'jobname') { + verify_by_jobid.hide(); + verify_by_job_name.show(); + } else if (this.value == 'jobid') { + verify_by_job_name.hide(); + verify_by_jobid.show(); + } else { + verify_by_job_name.hide(); + verify_by_jobid.hide(); + } + + +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+
+
+
+ +
- -
-
-
- +
+
+
+ +
-
-
-
-
- +
+
+
+ +
-
-
-
-
- +
+
+
+ +
-
-
-
-
- +
+
+
+ + +
-
-
-
-
- - + +
+
+
+ + +
+ + + ConfigurationWindow.getObj('JobWindow').progress(false); + job_callback_func(); + ConfigurationWindow.getObj('JobWindow').switchTab('job_console_tab'); + + + + + + ConfigurationWindow.getObj('JobWindow').progress(false); + job_callback_func(); + + + + + + + ConfigurationWindow.getObj('JobWindow').progress(false); + job_callback_func(); + ConfigurationWindow.getObj('JobWindow').switchTab('job_console_tab'); + + + + + + + ConfigurationWindow.getObj('JobWindow').progress(false); + ConfigurationWindow.getObj('JobWindow').switchTab('job_console_tab'); + + + + + + ConfigurationWindow.getObj('JobWindow').progress(false); + job_callback_func(); + oMonitor(); + +
- - -
- - - - -
- - - -
<%[ Console status ]%>
-
- + + +
+ +
- -
-
-
- - - diff --git a/gui/baculum/protected/Portlets/JobRunConfiguration.tpl b/gui/baculum/protected/Portlets/JobRunConfiguration.tpl index 44e948a155..1fecd5e396 100644 --- a/gui/baculum/protected/Portlets/JobRunConfiguration.tpl +++ b/gui/baculum/protected/Portlets/JobRunConfiguration.tpl @@ -1,139 +1,161 @@ <%@ MasterClass="Application.Portlets.ConfigurationPanel"%> - <%[ Job name: ]%> -
- -
-
-
- - - var job_to_verify = $('<%=$this->JobToVerifyOptionsLine->ClientID%>'); - var verify_options = $('<%=$this->JobToVerifyOptionsLine->ClientID%>'); - var verify_by_job_name = $('<%=$this->JobToVerifyJobNameLine->ClientID%>'); - var verify_by_jobid = $('<%=$this->JobToVerifyJobIdLine->ClientID%>'); - var accurate = $('<%=$this->AccurateLine->ClientID%>'); - var estimate = $('<%=$this->EstimateLine->ClientID%>'); - var verify_current_opt = $('<%=$this->JobToVerifyOptions->ClientID%>').value; - if(/^(<%=implode('|', $this->jobToVerify)%>)$/.test(this.value)) { - accurate.hide(); - estimate.hide(); - verify_options.show(); - job_to_verify.show(); - if (verify_current_opt == 'jobid') { +

<%[ Job name: ]%>

+ <%[ Actions ]%> + <%[ Console status ]%> +
+
+ +
+
+
+ + + var job_to_verify = $('<%=$this->JobToVerifyOptionsLine->ClientID%>'); + var verify_options = $('<%=$this->JobToVerifyOptionsLine->ClientID%>'); + var verify_by_job_name = $('<%=$this->JobToVerifyJobNameLine->ClientID%>'); + var verify_by_jobid = $('<%=$this->JobToVerifyJobIdLine->ClientID%>'); + var accurate = $('<%=$this->AccurateLine->ClientID%>'); + var estimate = $('<%=$this->EstimateLine->ClientID%>'); + var verify_current_opt = $('<%=$this->JobToVerifyOptions->ClientID%>').value; + if(/^(<%=implode('|', $this->jobToVerify)%>)$/.test(this.value)) { + accurate.hide(); + estimate.hide(); + verify_options.show(); + job_to_verify.show(); + if (verify_current_opt == 'jobid') { + verify_by_job_name.hide(); + verify_by_jobid.show(); + } else if (verify_current_opt == 'jobname') { + verify_by_job_name.show(); + verify_by_jobid.hide(); + } + } else if (job_to_verify.visible()) { + job_to_verify.hide(); + verify_options.hide(); verify_by_job_name.hide(); - verify_by_jobid.show(); - } else if (verify_current_opt == 'jobname') { - verify_by_job_name.show(); verify_by_jobid.hide(); + accurate.show(); + estimate.show(); } - } else if (job_to_verify.visible()) { - job_to_verify.hide(); - verify_options.hide(); - verify_by_job_name.hide(); - verify_by_jobid.hide(); - accurate.show(); - estimate.show(); - } - - -
-
- -
-
- - - var verify_by_job_name = $('<%=$this->JobToVerifyJobNameLine->ClientID%>'); - var verify_by_jobid = $('<%=$this->JobToVerifyJobIdLine->ClientID%>'); - if (this.value == 'jobname') { - verify_by_jobid.hide(); - verify_by_job_name.show(); - } else if (this.value == 'jobid') { - verify_by_job_name.hide(); - verify_by_jobid.show(); - } else { - verify_by_job_name.hide(); - verify_by_jobid.hide(); - } - - + + +
- - -
-
- + +
+
+ + + var verify_by_job_name = $('<%=$this->JobToVerifyJobNameLine->ClientID%>'); + var verify_by_jobid = $('<%=$this->JobToVerifyJobIdLine->ClientID%>'); + if (this.value == 'jobname') { + verify_by_jobid.hide(); + verify_by_job_name.show(); + } else if (this.value == 'jobid') { + verify_by_job_name.hide(); + verify_by_jobid.show(); + } else { + verify_by_job_name.hide(); + verify_by_jobid.hide(); + } + + +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+
+
+
+ +
- - -
-
- - +
+
+
+ +
- -
-
-
- +
+
+
+ +
-
-
-
-
- +
+
+
+ +
-
-
-
-
- +
+
+
+ + +
-
-
-
-
- + +
+
+
+ + +
+ + + ConfigurationWindow.getObj('JobRunWindow').progress(false); + jobrun_callback_func(); + if (Prado.Validation.isValid(Prado.Validation.getForm(), 'JobRunGroup') === true) { + ConfigurationWindow.getObj('JobRunWindow').switchTab('jobrun_console_tab'); + } + + + + + + ConfigurationWindow.getObj('JobRunWindow').progress(false); + jobrun_callback_func(); + oMonitor(); + if (Prado.Validation.isValid(Prado.Validation.getForm(), 'JobRunGroup') === true) { + ConfigurationWindow.getObj('JobRunWindow').switchTab('jobrun_console_tab'); + } + + +
-
-
-
- - + - - -
- -
-
<%[ Console status ]%>
-
- -
- -
-
-
- - - diff --git a/gui/baculum/protected/Portlets/StorageConfiguration.php b/gui/baculum/protected/Portlets/StorageConfiguration.php index 6e9b5cb591..58eae5d3c6 100644 --- a/gui/baculum/protected/Portlets/StorageConfiguration.php +++ b/gui/baculum/protected/Portlets/StorageConfiguration.php @@ -46,7 +46,7 @@ class StorageConfiguration extends Portlets { } public function umount($sender, $param) { - $isValid = $this->DriveValidator->IsValid === true && $this->SlotValidator->IsValid === true; + $isValid = $this->DriveValidator->IsValid === true; if($isValid === false) { return; } @@ -57,7 +57,12 @@ class StorageConfiguration extends Portlets { } public function release($sender, $param) { - $release = $this->Application->getModule('api')->get(array('storages', 'release', $this->StorageID->Text))->output; + $isValid = $this->DriveValidator->IsValid === true; + if($isValid === false) { + return; + } + $drive = ($this->AutoChanger->Visible === true) ? intval($this->Drive->Text) : 0; + $release = $this->Application->getModule('api')->get(array('storages', 'release', $this->StorageID->Text, $drive))->output; $this->ShowStorage->Text = implode(PHP_EOL, $release); } diff --git a/gui/baculum/protected/Portlets/StorageConfiguration.tpl b/gui/baculum/protected/Portlets/StorageConfiguration.tpl index 6c5e9feb6d..7a1dcd42ee 100644 --- a/gui/baculum/protected/Portlets/StorageConfiguration.tpl +++ b/gui/baculum/protected/Portlets/StorageConfiguration.tpl @@ -1,38 +1,69 @@ <%@ MasterClass="Application.Portlets.ConfigurationPanel"%> - <%[ Storage name: ]%> -
- -
<%[ Console status ]%>
-
- -
- -
-
-
- - +

<%[ Storage name: ]%>

+ <%[ Actions ]%> + <%[ Console status ]%> +
+
+ + +
+
+
+ + +
-
-
-
-
- - +
+
+
+ + +
+ +
+ + + ConfigurationWindow.getObj('StorageWindow').progress(false); + if (Prado.Validation.isValid(Prado.Validation.getForm(), 'AutoChangerGroup') === true) { + ConfigurationWindow.getObj('StorageWindow').switchTab('storage_console_tab'); + } + + + + + ConfigurationWindow.getObj('StorageWindow').progress(false); + if (Prado.Validation.isValid(Prado.Validation.getForm(), 'AutoChangerGroup') === true) { + ConfigurationWindow.getObj('StorageWindow').switchTab('storage_console_tab'); + } + + + + + ConfigurationWindow.getObj('StorageWindow').progress(false); + if (Prado.Validation.isValid(Prado.Validation.getForm(), 'AutoChangerGroup') === true) { + ConfigurationWindow.getObj('StorageWindow').switchTab('storage_console_tab'); + } + + + + + ConfigurationWindow.getObj('StorageWindow').progress(false); + ConfigurationWindow.getObj('StorageWindow').switchTab('storage_console_tab'); + + +
+
+