[增添]添加了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

18
.idea/workspace.xml generated
View File

@@ -4,8 +4,7 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="596fb1a0-d6fb-4db8-a922-13b01593ce79" name="更改" comment="[增添]添加了datasource的setting数据库以及默认值">
<change beforePath="$PROJECT_DIR$/.idea/php.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/php.xml" afterDir="false" />
<list default="true" id="596fb1a0-d6fb-4db8-a922-13b01593ce79" name="更改" comment="[增添]添加了ManageDataSource管理页面">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@@ -352,7 +351,7 @@
<workItem from="1724721535300" duration="1534000" />
<workItem from="1724723119931" duration="37000" />
<workItem from="1724723165774" duration="1511000" />
<workItem from="1724724784154" duration="1091000" />
<workItem from="1724724784154" duration="1746000" />
</task>
<task id="LOCAL-00001" summary="[增添]添加注册">
<option name="closed" value="true" />
@@ -386,7 +385,15 @@
<option name="project" value="LOCAL" />
<updated>1724723944634</updated>
</task>
<option name="localTasksCounter" value="5" />
<task id="LOCAL-00005" summary="[增添]添加了ManageDataSource管理页面">
<option name="closed" value="true" />
<created>1724726078488</created>
<option name="number" value="00005" />
<option name="presentableId" value="LOCAL-00005" />
<option name="project" value="LOCAL" />
<updated>1724726078488</updated>
</task>
<option name="localTasksCounter" value="6" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@@ -406,6 +413,7 @@
<component name="VcsManagerConfiguration">
<MESSAGE value="[增添]添加注册" />
<MESSAGE value="[增添]添加了datasource的setting数据库以及默认值" />
<option name="LAST_COMMIT_MESSAGE" value="[增添]添加了datasource的setting数据库以及默认值" />
<MESSAGE value="[增添]添加了ManageDataSource管理页面" />
<option name="LAST_COMMIT_MESSAGE" value="[增添]添加了ManageDataSource管理页面" />
</component>
</project>

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';
}
}

View File

@@ -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');
}
};