generated from liutk/owl-admin-base
驾驶舱
parent
3f6508f81f
commit
fc8ec2a540
|
|
@ -4,6 +4,7 @@ namespace App\Admin\Controllers;
|
||||||
|
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
use Slowlyo\OwlAdmin\Admin;
|
||||||
use Slowlyo\OwlAdmin\Controllers\AdminController;
|
use Slowlyo\OwlAdmin\Controllers\AdminController;
|
||||||
use Slowlyo\OwlAdmin\Renderers\Action;
|
use Slowlyo\OwlAdmin\Renderers\Action;
|
||||||
use Slowlyo\OwlAdmin\Renderers\Card;
|
use Slowlyo\OwlAdmin\Renderers\Card;
|
||||||
|
|
@ -19,25 +20,21 @@ class HomeController extends AdminController
|
||||||
{
|
{
|
||||||
public function index(): JsonResponse|JsonResource
|
public function index(): JsonResponse|JsonResource
|
||||||
{
|
{
|
||||||
$page = $this->basePage()->css($this->css())->body([
|
$body = collect();
|
||||||
// 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'),
|
|
||||||
]),
|
|
||||||
]);
|
|
||||||
|
|
||||||
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)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,9 @@ class AdminPermissionSeeder extends Seeder
|
||||||
'icon' => 'line-md:home-twotone-alt',
|
'icon' => 'line-md:home-twotone-alt',
|
||||||
'uri' => '/dashboard',
|
'uri' => '/dashboard',
|
||||||
'is_home' => 1,
|
'is_home' => 1,
|
||||||
'children' => [],
|
'children' => [
|
||||||
|
'cockpit' => '驾驶舱',
|
||||||
|
],
|
||||||
'order' => 1,
|
'order' => 1,
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue