module shop client fix

This commit is contained in:
Kavalar 2024-11-05 13:44:08 +03:00
parent 6f7debc25b
commit 825d3df776
3 changed files with 23 additions and 8 deletions

View File

@ -10,4 +10,7 @@ DB_PREFIX=''
VIEWS_PATH=/views VIEWS_PATH=/views
VIEWS_CACHE_PATH=/views_cache VIEWS_CACHE_PATH=/views_cache
MODULE_SHOP_URL='http://localhost:8383/api'
MODULE_SHOP_TOKEN='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.W10.Sisyc1bgy03TI0wT11oKhgh5J6vR9XWDOV56L6BiTJY'
SECRET_KEY='' SECRET_KEY=''

View File

@ -33,8 +33,8 @@ class ModuleShopClientController extends AdminController
{ {
$per_page = 8; $per_page = 8;
$token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.W10.POQZmGB7EZIayINtYhzu5r1rdgZhF9qPJpaQkl_g6pU'; $token = $_ENV['MODULE_SHOP_TOKEN'];
$modules_info = $this->client->request('GET', 'http://igfs.loc/api/module_shop/gb_slug', [ $modules_info = $this->client->request('GET', $_ENV['MODULE_SHOP_URL'] . '/module_shop/gb_slug', [
'headers' => [ 'headers' => [
'Authorization' => 'Bearer ' . $token, 'Authorization' => 'Bearer ' . $token,
] ]

View File

@ -33,8 +33,7 @@ $table->addAction(function ($row, $url) use ($moduleService){
$btn_type = "warning"; $btn_type = "warning";
$btn = "<a class='btn btn-$btn_type' href='$url/deactivate/?slug=$slug' style='margin: 3px; width: 150px;' >$label</a>"; $btn = "<a class='btn btn-$btn_type' href='$url/deactivate/?slug=$slug' style='margin: 3px; width: 150px;' >$label</a>";
} } else {
else {
$label = "Активировать"; $label = "Активировать";
$btn_type = "primary"; $btn_type = "primary";
$btn = "<a class='btn btn-$btn_type' href='$url/activate/?slug=$slug' style='margin: 3px; width: 150px;' >$label</a>"; $btn = "<a class='btn btn-$btn_type' href='$url/activate/?slug=$slug' style='margin: 3px; width: 150px;' >$label</a>";
@ -54,4 +53,17 @@ $table->addAction(function ($row, $url) use ($moduleService){
}); });
$table->create(); $table->create();
?>
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Локальные</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Каталог</a>
</li>
</ul>
<br>
<?php
$table->render(); $table->render();