]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Improve showing create new resource messages
authorMarcin Haba <marcin.haba@bacula.pl>
Wed, 4 Dec 2019 23:46:56 +0000 (00:46 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Tue, 17 Dec 2019 17:16:35 +0000 (18:16 +0100)
Go back to previous page after confirming new resource message

12 files changed:
gui/baculum/protected/Web/Lang/en/messages.mo
gui/baculum/protected/Web/Lang/en/messages.po
gui/baculum/protected/Web/Lang/ja/messages.mo
gui/baculum/protected/Web/Lang/ja/messages.po
gui/baculum/protected/Web/Lang/pl/messages.mo
gui/baculum/protected/Web/Lang/pl/messages.po
gui/baculum/protected/Web/Lang/pt/messages.mo
gui/baculum/protected/Web/Lang/pt/messages.po
gui/baculum/protected/Web/Pages/NewJobWizard.page
gui/baculum/protected/Web/Pages/NewResource.page
gui/baculum/protected/Web/Pages/NewResource.php
gui/baculum/protected/Web/Portlets/BaculaConfigComponents.tpl

index 6ed8a35f31bd8c98863a2834733203977ce5bff8..916d3f1bb898aea92659626234b6e60ab673fe8f 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/en/messages.mo and b/gui/baculum/protected/Web/Lang/en/messages.mo differ
index 2014807408b1be5ce0845dca0df8d48532c173ce..f78bc5b3632bfe6f68d0220e45ab668f7471bab0 100644 (file)
@@ -2518,3 +2518,9 @@ msgstr "Enable restore from copy jobs feature:"
 
 msgid "Note: if you select incremental or differential backup, on the next step will be also loaded all directories and files from older backups required to do the job restore. In other words, the selected backup determines time point from which will be loaded the selected backup and other older backups (incremental, differential) backups up till closest full backup."
 msgstr "Note: if you select incremental or differential backup, on the next step will be also loaded all directories and files from older backups required to do the job restore. In other words, the selected backup determines time point from which will be loaded the selected backup and other older backups (incremental, differential) backups up till closest full backup."
+
+msgid "Create new resource"
+msgstr "Create new resource"
+
+msgid "The resource has been created successfully."
+msgstr "The resource has been created successfully."
index deafb7a03fa679ced9325d0700906a8038e50a24..c09a299fb9ff3056463dc1acee5840fc270f7329 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/ja/messages.mo and b/gui/baculum/protected/Web/Lang/ja/messages.mo differ
index fa7a6323f58ffeeed46800e13cbbf8078f6bb9a1..9de7ea6a950bdd8f6d7f0e008fe8a7bd8df0aa0b 100644 (file)
@@ -2604,3 +2604,9 @@ msgstr "Enable restore from copy jobs feature:"
 
 msgid "Note: if you select incremental or differential backup, on the next step will be also loaded all directories and files from older backups required to do the job restore. In other words, the selected backup determines time point from which will be loaded the selected backup and other older backups (incremental, differential) backups up till closest full backup."
 msgstr "Note: if you select incremental or differential backup, on the next step will be also loaded all directories and files from older backups required to do the job restore. In other words, the selected backup determines time point from which will be loaded the selected backup and other older backups (incremental, differential) backups up till closest full backup."
+
+msgid "Create new resource"
+msgstr "Create new resource"
+
+msgid "The resource has been created successfully."
+msgstr "The resource has been created successfully."
index ac535cddb992eb99a4577cfd5526892f3067e717..25767c1e88f57651363253df987fbdef5893f402 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/pl/messages.mo and b/gui/baculum/protected/Web/Lang/pl/messages.mo differ
index 14744bc9f7652002c429ef57de2d0dd35dd77bf1..4dbe093ae3eac32c1961e78ae1de5d3ca143ac08 100644 (file)
@@ -2525,3 +2525,9 @@ msgstr "Włącz funkcję przywracania danych z kopii zadań:"
 
 msgid "Note: if you select incremental or differential backup, on the next step will be also loaded all directories and files from older backups required to do the job restore. In other words, the selected backup determines time point from which will be loaded the selected backup and other older backups (incremental, differential) backups up till closest full backup."
 msgstr "Uwaga: jeśli wybierzesz kopię przyrostową lub różnicową, w następnym kroku będą również załadowane wszystkie pliki i katalogi ze starszych kopii wymaganych do przywrócenia zadania. Innymi słowy, wybrana kopia zapasowa określa punkt czasowy z którego będzie załadowana wybrana kopia i inne starsze kopie (przyrostowe, różnicowe) aż do najbliższej kopii pełnej."
+
+msgid "Create new resource"
+msgstr "Tworzenie nowego zasobu"
+
+msgid "The resource has been created successfully."
+msgstr "Zasób został utworzony pomyślnie."
index 9c413734b7919c4f927eabb9acd512376a202962..6e5c93f4318089189accced923a9e5aaec0c7c90 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/pt/messages.mo and b/gui/baculum/protected/Web/Lang/pt/messages.mo differ
index 711282ab09402f7a98f716813f912f67e0edd8f3..8e0d62e88f6e6daad1e27326fed37efa102b1dc9 100644 (file)
@@ -2533,3 +2533,9 @@ msgstr "Enable restore from copy jobs feature:"
 
 msgid "Note: if you select incremental or differential backup, on the next step will be also loaded all directories and files from older backups required to do the job restore. In other words, the selected backup determines time point from which will be loaded the selected backup and other older backups (incremental, differential) backups up till closest full backup."
 msgstr "Note: if you select incremental or differential backup, on the next step will be also loaded all directories and files from older backups required to do the job restore. In other words, the selected backup determines time point from which will be loaded the selected backup and other older backups (incremental, differential) backups up till closest full backup."
+
+msgid "Create new resource"
+msgstr "Create new resource"
+
+msgid "The resource has been created successfully."
+msgstr "The resource has been created successfully."
index cc778dace486200451b8047415d91b168f80551b..fcb352dee3e26572a4a62b9ea4780c3c2293a568 100644 (file)
                        </div>
                        <div id="fileset_save_ok" class="w3-panel w3-green w3-display-container" style="display: none">
                                <span onclick="this.parentElement.style.display='none'" class="w3-button w3-green w3-large w3-display-topright">x</span>
-                               <p><%[ Resource has been saved successfully. ]%></p>
+                               <p><%[ The resource has been created successfully. ]%></p>
                        </div>
                        <div id="job_wizard_new_fileset" class="w3-card-4 w3-padding w3-margin-top" style="display: none">
                                <h3><%[ New FileSet ]%></h3>
                        </div>
                        <div id="pool_save_ok" class="w3-panel w3-green w3-display-container" style="display: none">
                                <span onclick="this.parentElement.style.display='none'" class="w3-button w3-green w3-large w3-display-topright">x</span>
-                               <p><%[ Resource has been saved successfully. ]%></p>
+                               <p><%[ The resource has been created successfully. ]%></p>
                        </div>
                        <div id="job_wizard_new_pool" class="w3-card-4 w3-padding w3-margin-top" style="display: none">
                                <h3><%[ New Pool ]%></h3>
                        </div>
                        <div id="schedule_save_ok" class="w3-panel w3-green w3-display-container" style="display: none">
                                <span onclick="this.parentElement.style.display='none'" class="w3-button w3-green w3-large w3-display-topright">x</span>
-                               <p><%[ Resource has been saved successfully. ]%></p>
+                               <p><%[ The resource has been created successfully. ]%></p>
                        </div>
                        <div id="job_wizard_new_schedule" class="w3-card-4 w3-padding w3-margin-top" style="display: none">
                                <h3><%[ New Schedule ]%></h3>
index ff7f6a20c1aa07d597e6edce6afdfbe883d65cdc..b60d38ae238ff05ddb3bf0f243c3b5bf3472d6a1 100644 (file)
@@ -9,9 +9,19 @@
        <button type="button" class="w3-button w3-green w3-margin-left w3-margin-bottom" onclick="document.getElementById('new_resource').style.display = 'block'">
                <i class="fa fa-plus"></i> &nbsp;<%=Prado::localize('Add new resource')%>
        </button>
-       <div id="resource_save_ok" class="w3-panel w3-green w3-display-container" style="display: none">
-               <span onclick="this.parentElement.style.display='none'" class="w3-button w3-green w3-large w3-display-topright">x</span>
-               <p><%[ Resource has been saved successfully. ]%></p>
+       <div id="resource_save_ok_box" class="w3-modal" style="display: none">
+               <div class="w3-modal-content w3-card-4 w3-animate-zoom" style="width: 600px">
+                       <header class="w3-container w3-green">
+                               <span onclick="$('#resource_save_ok_box').hide();" class="w3-button w3-display-topright">×</span>
+                               <h2><%[ Create new resource ]%></h2>
+                       </header>
+                       <div class="w3-panel w3-padding">
+                               <p><%[ The resource has been created successfully. ]%></p>
+                       </div>
+                       <footer class="w3-container w3-center w3-border-top">
+                               <button type="button" class="w3-button w3-section w3-green" onclick="$('#resource_save_ok_box').hide(); save_directive_post_action();"><i class="fa fa-check"></i> &nbsp;<%[ OK ]%></button>
+                       </footer>
+               </div>
        </div>
        <div id="new_resource" class="w3-modal">
                <div class="w3-modal-content w3-animate-top w3-card-4 w3-padding">
        <div id="resource_config" class="w3-container">
                <com:Application.Web.Portlets.BaculaConfigDirectives
                        ID="NewResource"
-                       SaveDirectiveActionOk="$('#resource_config').slideUp(); $('#resource_save_ok').show();"
+                       SaveDirectiveActionOk="save_directive_action_ok();"
                        ShowRemoveButton="false"
                        ShowCancelButton="false"
                />
        </div>
        <script>
+               function save_directive_action_ok() {
+                       $('#resource_config').slideUp();
+                       $('#resource_save_ok_box').show();
+               }
+               function save_directive_post_action() {
+                       var origin_url = '<%=$this->getOriginUrl()%>';
+                       if (origin_url) {
+                               document.location.href = origin_url;
+                       }
+               }
                oBaculaConfigSection.show_sections(true);
        </script>
 </com:TContent>
index 679efa134e49c8b1f4afb38492de78bf5ef37a86..bf9151393f18f6b1e0fcca4e43f478853390e6aa 100644 (file)
@@ -30,6 +30,7 @@ class NewResource extends BaculumWebPage {
        const COMPONENT_TYPE = 'ComponentType';
        const COMPONENT_NAME = 'ComponentName';
        const RESOURCE_TYPE = 'ResourceType';
+       const ORIGIN_URL = 'OriginUrl';
 
        public function onPreRender($param) {
                parent::onPreRender($param);
@@ -63,6 +64,9 @@ class NewResource extends BaculumWebPage {
                        $this->NewResource->raiseEvent('OnDirectiveListLoad', $this, null);
                        $this->setHosts();
                }
+               if (key_exists('HTTP_REFERER', $_SERVER)) {
+                       $this->setOriginUrl($_SERVER['HTTP_REFERER']);
+               }
        }
 
        public function setHosts() {
@@ -183,6 +187,14 @@ class NewResource extends BaculumWebPage {
                $this->setViewState(self::RESOURCE_TYPE, $type);
        }
 
+       public function getOriginUrl() {
+               return $this->getViewState(self::ORIGIN_URL);
+       }
+
+       public function setOriginUrl($url) {
+               $this->setViewState(self::ORIGIN_URL, $url);
+       }
+
        public function createResource() {
                if ($this->Host->SelectedIndex > 0 && $this->Component->SelectedIndex > 0 && $this->Resource->SelectedValue) {
                        $host = $this->Host->SelectedValue;
index 81678206a70585d0d0d1f5afd832218a35585b5a..2bf3db73849a2e8b0970b1f2d555286661346b11 100644 (file)
                </prop:ItemTemplate>
        </com:TActiveRepeater>
 </div>
-       <com:TActiveLabel ID="ErrorMsg" Display="None" />
+<com:TActiveLabel ID="ErrorMsg" Display="None" />
 <div class="config_directives new_resource" rel="<%=$this->getHost()%>new_resource" style="display: none">
+       <!-- New resource -->
        <h2 rel="<%[ Add new %resource_type resource on %component_name (%component_type) ]%>"></h2>
        <hr />
-       <com:Application.Web.Portlets.BaculaConfigDirectives ID="NewResource" LoadValues="<%=false%>" />
+       <com:Application.Web.Portlets.BaculaConfigDirectives
+               ID="NewResource"
+               LoadValues="<%=false%>"
+               SaveDirectiveActionOk="$('#<%=$this->ResourceCreatedOk->ClientID%>').show();"
+       />
 </div>
+<!-- Resource created successfully - confirm -->
+<com:TPanel ID="ResourceCreatedOk" CssClass="w3-modal" Style="display: none">
+       <div class="w3-modal-content w3-card-4 w3-animate-zoom" style="width: 600px">
+               <header class="w3-container w3-green">
+                       <span onclick="$('#<%=$this->ResourceCreatedOk->ClientID%>').hide();" class="w3-button w3-display-topright">×</span>
+                       <h2><%[ Create new resource ]%></h2>
+               </header>
+               <div class="w3-panel w3-padding">
+                       <p><%[ The resource has been created successfully. ]%></p>
+               </div>
+               <footer class="w3-container w3-center w3-border-top">
+                       <button type="button" class="w3-button w3-section w3-green" onclick="$('#<%=$this->ResourceCreatedOk->ClientID%>').hide(); $('#<%=$this->NewResource->Cancel->ClientID%>').click();"><i class="fa fa-check"></i> &nbsp;<%[ OK ]%></button>
+               </footer>
+       </div>
+</com:TPanel>