Ver Fonte

try to refresh form after action

andre há 4 anos atrás
pai
commit
eabce7a50b

+ 4 - 0
app/UI/Client/Templates/assets/js/vm/index.js

@@ -91,6 +91,10 @@ function mgLocationReload(data) {
     window.location.reload();
 }
 
+function mgLocationReloadDelay(data) {
+    setTimeout(function(){ window.location.reload(); }, 2000);
+}
+
 /* VM delete done*/
 function pcVmDeltedAjaxDone(data) {
     if(data.htmlData.redirectUrl)

+ 5 - 5
app/UI/Home/Providers/StatusProvider.php

@@ -45,7 +45,7 @@ class StatusProvider extends BaseDataProvider implements ClientArea
             ->setStatusSuccess()
             ->setMessageAndTranslate('The Virtual Machine has been booted successfully')
             ->addData('refreshState', 'serverinformationTable')
-            ->setCallBackFunction('mgLocationReload')
+            ->setCallBackFunction('mgLocationReloadDelay')
             ->addRefreshTargetId('serviceInformationDataTable');
     }
 
@@ -64,7 +64,7 @@ class StatusProvider extends BaseDataProvider implements ClientArea
                 ->setStatusSuccess()
                 ->setMessageAndTranslate('Rebooting container in progress')
                 ->addData('refreshState', 'serverinformationTable')
-                ->setCallBackFunction('mgLocationReload')
+                ->setCallBackFunction('mgLocationReloadDelay')
                 ->addRefreshTargetId('serviceInformationDataTable');
         }
         else
@@ -74,7 +74,7 @@ class StatusProvider extends BaseDataProvider implements ClientArea
                 ->setStatusSuccess()
                 ->setMessageAndTranslate('The Virtual Machine has been rebooted successfully')
                 ->addData('refreshState', 'serverinformationTable')
-                ->setCallBackFunction('mgLocationReload')
+                ->setCallBackFunction('mgLocationReloadDelay')
                 ->addRefreshTargetId('serviceInformationDataTable');
         }
 
@@ -88,7 +88,7 @@ class StatusProvider extends BaseDataProvider implements ClientArea
             ->setStatusSuccess()
             ->setMessageAndTranslate('The Virtual Machine has been stopped successfully')
             ->addData('refreshState', 'serverinformationTable')
-            ->setCallBackFunction('mgLocationReload')
+            ->setCallBackFunction('mgLocationReloadDelay')
             ->addRefreshTargetId('serviceInformationDataTable');
     }
 
@@ -100,7 +100,7 @@ class StatusProvider extends BaseDataProvider implements ClientArea
             ->setStatusSuccess()
             ->setMessageAndTranslate('The Virtual Machine has been shut down successfully')
             ->addData('refreshState', 'serverinformationTable')
-            ->setCallBackFunction('mgLocationReload')
+            ->setCallBackFunction('mgLocationReloadDelay')
             ->addRefreshTargetId('serviceInformationDataTable');
     }