[增添]添加了Manage Exposer的默认数据库值以及Page页面

This commit is contained in:
makotocc0107
2024-08-27 10:44:40 +08:00
parent fae4b62663
commit b1d638a2ed
4 changed files with 84 additions and 5 deletions

View File

@@ -0,0 +1,40 @@
<?php
namespace App\Filament\Pages;
use App\Settings\ExposerSettings;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Pages\SettingsPage;
use Filament\Forms\Components\TextInput;
use App\Services\EtcdService;
use App\Settings\DataSourceSettings;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Toggle;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\Fieldset;
class ManageExposer extends SettingsPage
{
protected static ?string $navigationIcon = 'heroicon-o-cog-6-tooth';
protected static string $settings = ExposerSettings::class;
public function form(Form $form): Form
{
return $form
->schema([
Fieldset::make()
->schema([
Textarea::make('exposer_bind')
->label('OPC UA Endpoint')
->required(),
TextInput::make('exposer_auth')
->label('OPC UA Endpoint')
->required(),
]),
]);
}
}

View File

@@ -0,0 +1,18 @@
<?php
namespace App\Settings;
use Spatie\LaravelSettings\Settings;
class ExposerSettings extends Settings
{
public string $exposer_bind;
public int $exposer_thread;
public string $exposer_auth;
public static function group(): string
{
return 'exposer';
}
}