Răsfoiți Sursa

fix wizard path api add timeout extender

causefx 7 ani în urmă
părinte
comite
044844a489
2 a modificat fișierele cu 10 adăugiri și 3 ștergeri
  1. 1 1
      api/index.php
  2. 9 2
      js/functions.js

+ 1 - 1
api/index.php

@@ -15,7 +15,7 @@ if ($function === false) {
 	$result['statusText'] = "No API Path Supplied";
 	exit(json_encode($result));
 }
-if ($function !== 'v1_auth' && $function !== 'v1_wizard_config' && $function !== 'v1_login') {
+if ($function !== 'v1_auth' && $function !== 'v1_wizard_config' && $function !== 'v1_login' && $function !== 'v1_wizard_path') {
 	if (isApprovedRequest($method, $_POST) === false) {
 		$result['status'] = "error";
 		$result['statusText'] = "Not Authorized";

+ 9 - 2
js/functions.js

@@ -3264,7 +3264,14 @@ function updateNow(){
 	});
 }
 function organizrAPI(type,path,data=null){
-	//console.log('Organizr API: Calling API: '+path);
+	var timeout = 10000;
+    switch(path){
+        case 'api/?v1/windows/update':
+            timeout = 120000;
+            break;
+        default:
+            timeout = 10000;
+    }
 	switch (type) {
 		case 'get':
 		case 'GET':
@@ -3275,7 +3282,7 @@ function organizrAPI(type,path,data=null){
 				beforeSend: function(request) {
 					request.setRequestHeader("Token", activeInfo.token);
 				},
-				timeout: 10000,
+				timeout: timeout,
 			});
 			break;
 		case 'post':