驾驶舱

main
Jing Li 2024-05-09 12:07:29 +08:00
parent 3f6508f81f
commit fc8ec2a540
2 changed files with 18 additions and 19 deletions

View File

@ -4,6 +4,7 @@ namespace App\Admin\Controllers;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Resources\Json\JsonResource;
use Slowlyo\OwlAdmin\Admin;
use Slowlyo\OwlAdmin\Controllers\AdminController;
use Slowlyo\OwlAdmin\Renderers\Action;
use Slowlyo\OwlAdmin\Renderers\Card;
@ -19,25 +20,21 @@ class HomeController extends AdminController
{
public function index(): JsonResponse|JsonResource
{
$page = $this->basePage()->css($this->css())->body([
// amis()->IFrame()->src('')//数据驾驶仓地址-todo
Grid::make()->columns([
$this->frameworkInfo()->md(5),
Flex::make()->items([
$this->pieChart(),
$this->cube(),
]),
]),
Grid::make()->columns([
$this->lineChart()->md(8),
Flex::make()->className('h-full')->items([
$this->clock(),
$this->hitokoto(),
])->direction('column'),
]),
]);
$body = collect();
return $this->response()->success($page);
if (Admin::user()->can('admin.home.cockpit')) {
$body->push(amis()->IFrame()->src('/cockpit'));
} else {
$body->push(
Grid::make()->columns([
$this->frameworkInfo()->md(5),
])
);
}
return $this->response()->success(
$this->basePage()->css($this->css())->body($body)
);
}
/**

View File

@ -26,7 +26,9 @@ class AdminPermissionSeeder extends Seeder
'icon' => 'line-md:home-twotone-alt',
'uri' => '/dashboard',
'is_home' => 1,
'children' => [],
'children' => [
'cockpit' => '驾驶舱',
],
'order' => 1,
],