[增添]添加了Manage Exposer的默认数据库值以及Page页面
This commit is contained in:
40
management-panel/app/Filament/Pages/ManageExposer.php
Normal file
40
management-panel/app/Filament/Pages/ManageExposer.php
Normal 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(),
|
||||
]),
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
18
management-panel/app/Settings/ExposerSettings.php
Normal file
18
management-panel/app/Settings/ExposerSettings.php
Normal 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';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
use Spatie\LaravelSettings\Migrations\SettingsMigration;
|
||||
|
||||
return new class extends SettingsMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
$this->migrator->add('exposer.exposer_bind', '0.0.0.0:8191');
|
||||
$this->migrator->add('exposer.exposer_thread', 2);
|
||||
$this->migrator->add('exposer.exposer_auth', 'None');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user