ms client update
This commit is contained in:
@ -3,9 +3,11 @@
|
||||
namespace kernel\modules\module_shop_client\controllers;
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
use JetBrains\PhpStorm\NoReturn;
|
||||
use kernel\AdminController;
|
||||
use kernel\helpers\Debug;
|
||||
use kernel\modules\module_shop_client\services\ModuleShopClientService;
|
||||
use kernel\Request;
|
||||
use kernel\services\ModuleService;
|
||||
|
||||
class ModuleShopClientController extends AdminController
|
||||
@ -37,6 +39,7 @@ class ModuleShopClientController extends AdminController
|
||||
$modules_info = array_slice($modules_info, $per_page*($page_number-1), $per_page);
|
||||
$this->cgView->render("index.php", [
|
||||
'modules_info' => $modules_info,
|
||||
'moduleService' => $this->moduleService,
|
||||
'page_number' => $page_number,
|
||||
'module_count' => $module_count,
|
||||
'per_page' => $per_page,
|
||||
@ -55,8 +58,10 @@ class ModuleShopClientController extends AdminController
|
||||
$this->cgView->render("view.php", ['data' => $module_info]);
|
||||
}
|
||||
|
||||
public function actionInstall(int $id): void
|
||||
public function actionInstall(): void
|
||||
{
|
||||
$request = new Request();
|
||||
$id = $request->get("id");
|
||||
$token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.W10.POQZmGB7EZIayINtYhzu5r1rdgZhF9qPJpaQkl_g6pU';
|
||||
$module_info = $this->client->request('GET', 'http://igfs.loc/api/module_shop/' . $id, [
|
||||
'headers' => [
|
||||
@ -69,4 +74,13 @@ class ModuleShopClientController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
#[NoReturn] public function actionDelete(): void
|
||||
{
|
||||
$request = new Request();
|
||||
$slug = $request->get("slug");
|
||||
$module_info = $this->moduleService->getModuleInfoBySlug($slug);
|
||||
$this->moduleService->uninstallModule($module_info['app_module_path']);
|
||||
$this->redirect('/admin/module_shop_client', 302);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user