Răsfoiți Sursa

more backup stuff

causefx 8 ani în urmă
părinte
comite
c7e08e792b
2 a modificat fișierele cu 13 adăugiri și 2 ștergeri
  1. 4 0
      ajax.php
  2. 9 2
      settings.php

+ 4 - 0
ajax.php

@@ -26,6 +26,10 @@ $response = array();
 switch ($_SERVER['REQUEST_METHOD']) {
 	case 'GET':
 		switch ($action) {
+			case 'get-backups':
+				qualifyUser("admin", true);
+				$response = implode("\n",getBackups());
+				break;
 			case 'get-calendar':
 				echo json_encode(getCalendar());
 				die();

+ 9 - 2
settings.php

@@ -1584,7 +1584,7 @@ echo buildSettings(
 							'labelTranslate' => 'BACKUP_NOW',
 							'id' => 'backupNow',
 							'icon' => 'database',
-                            'style' =>  (extension_loaded("ZIP")) ? "" : "display : none",
+                            'style' =>  (extension_loaded("ZIP")) ? "margin-bottom: 5px;" : "display : none",
 						),
 					),
                     array(
@@ -2858,7 +2858,14 @@ echo buildSettings(
             $('#backupNow').on('click', function () {
                 console.log("starting backup now");
                 ajax_request('POST', 'backup-now');
-                console.log("ajax backup done");
+                setTimeout(function(){
+                    ajax_request('GET', 'get-backups').done(function(data){
+                        $('#backupList_id').html(data);
+                        $('#backupList_id').addClass('animated pulse');
+                    });
+                    console.log("ajax backup done")
+                }, 500);
+                ;
             });
             //TestEmail
             function isUpperCase(str) {