52 lines
1.3 KiB
PHP
52 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Admin\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Slowlyo\OwlAdmin\Renderers\Tab;
|
|
use Slowlyo\OwlAdmin\Renderers\Tabs;
|
|
use Slowlyo\OwlAdmin\Renderers\Alert;
|
|
use Slowlyo\OwlAdmin\Renderers\InputKV;
|
|
use Slowlyo\OwlAdmin\Renderers\TextControl;
|
|
use Slowlyo\OwlAdmin\Controllers\AdminController;
|
|
|
|
class SettingController extends AdminController
|
|
{
|
|
protected string $queryPath = 'system/settings';
|
|
|
|
protected string $pageTitle = '系统设置';
|
|
|
|
public function index()
|
|
{
|
|
$page = $this->basePage()->body($this->form());
|
|
|
|
return $this->response()->success($page);
|
|
}
|
|
|
|
public function form()
|
|
{
|
|
return $this->baseForm()
|
|
->redirect('')
|
|
->api($this->getStorePath())
|
|
->data(settings()->all())
|
|
->panelClassName('')
|
|
->title('')
|
|
->body(
|
|
Tabs::make()->tabs([
|
|
Tab::make()->title('基本设置')->body([
|
|
TextControl::make()->label('RTSP 转流服务')->name('rtsp_url'),
|
|
])
|
|
])
|
|
);
|
|
}
|
|
|
|
public function store(Request $request)
|
|
{
|
|
$data = $request->only([
|
|
'rtsp_url'
|
|
]);
|
|
|
|
return settings()->adminSetMany($data);
|
|
}
|
|
}
|