-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e79c34d
commit 19db5f5
Showing
5 changed files
with
107 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Glpi\Controller; | ||
|
||
use Glpi\Http\Firewall; | ||
use Glpi\Security\Attribute\SecurityStrategy; | ||
use Symfony\Component\HttpFoundation\JsonResponse; | ||
use Glpi\Progress\ProgressChecker; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\Routing\Attribute\Route; | ||
|
||
class ProgressController extends AbstractController | ||
{ | ||
public function __construct( | ||
private readonly ProgressChecker $progressChecker, | ||
) { | ||
} | ||
|
||
#[Route("/progress/check/{key}", methods: 'POST')] | ||
#[SecurityStrategy(Firewall::STRATEGY_NO_CHECK)] | ||
public function check_progress(string $key): Response | ||
{ | ||
if (!$this->progressChecker->hasProgress($key)) { | ||
return new JsonResponse([], 404); | ||
} | ||
|
||
return new JsonResponse($this->progressChecker->getCurrentProgress($key)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters