[修改]修改文本 调整了布局

This commit is contained in:
makotocc0107
2024-08-27 17:02:16 +08:00
parent 016e6b215d
commit 90b0ebaf93
10 changed files with 98 additions and 44 deletions

24
.idea/workspace.xml generated
View File

@@ -4,9 +4,16 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="596fb1a0-d6fb-4db8-a922-13b01593ce79" name="更改" comment="[修改]修改了Exporter变量名称及页面配置">
<list default="true" id="596fb1a0-d6fb-4db8-a922-13b01593ce79" name="更改" comment="[增添]增添了datasource中的配置参数及对应页面">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/app/Filament/Pages/ManageDataSource.php" beforeDir="false" afterPath="$PROJECT_DIR$/management-panel/app/Filament/Pages/ManageDataSource.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/app/Filament/Pages/ManageExporter.php" beforeDir="false" afterPath="$PROJECT_DIR$/management-panel/app/Filament/Pages/ManageExporter.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/app/Filament/Pages/UpdateToEtcd.php" beforeDir="false" afterPath="$PROJECT_DIR$/management-panel/app/Filament/Pages/UpdateToEtcd.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/app/Filament/Resources/MetricResource.php" beforeDir="false" afterPath="$PROJECT_DIR$/management-panel/app/Filament/Resources/MetricResource.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/app/Filament/Resources/MetricResource/Pages/CreateMetric.php" beforeDir="false" afterPath="$PROJECT_DIR$/management-panel/app/Filament/Resources/MetricResource/Pages/CreateMetric.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/app/Filament/Resources/MetricResource/Pages/EditMetric.php" beforeDir="false" afterPath="$PROJECT_DIR$/management-panel/app/Filament/Resources/MetricResource/Pages/EditMetric.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/app/Filament/Resources/MetricResource/Pages/ListMetrics.php" beforeDir="false" afterPath="$PROJECT_DIR$/management-panel/app/Filament/Resources/MetricResource/Pages/ListMetrics.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/app/Services/EtcdService.php" beforeDir="false" afterPath="$PROJECT_DIR$/management-panel/app/Services/EtcdService.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/app/Settings/DataSourceSettings.php" beforeDir="false" afterPath="$PROJECT_DIR$/management-panel/app/Settings/DataSourceSettings.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/database/settings/2024_08_27_015013_data_source_settings.php" beforeDir="false" afterPath="$PROJECT_DIR$/management-panel/database/settings/2024_08_27_015013_data_source_settings.php" afterDir="false" />
</list>
@@ -360,7 +367,7 @@
<workItem from="1724723165774" duration="1511000" />
<workItem from="1724724784154" duration="12793000" />
<workItem from="1724743649380" duration="22000" />
<workItem from="1724743707590" duration="1543000" />
<workItem from="1724743707590" duration="5557000" />
</task>
<task id="LOCAL-00001" summary="[增添]添加注册">
<option name="closed" value="true" />
@@ -450,7 +457,15 @@
<option name="project" value="LOCAL" />
<updated>1724743728810</updated>
</task>
<option name="localTasksCounter" value="12" />
<task id="LOCAL-00012" summary="[增添]增添了datasource中的配置参数及对应页面">
<option name="closed" value="true" />
<created>1724745600949</created>
<option name="number" value="00012" />
<option name="presentableId" value="LOCAL-00012" />
<option name="project" value="LOCAL" />
<updated>1724745600949</updated>
</task>
<option name="localTasksCounter" value="13" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@@ -507,6 +522,7 @@
<MESSAGE value="[增添]添加了etcd服务与对应页面" />
<MESSAGE value="[增添]在初始仪表盘添加了用于导出etcd配置的widget" />
<MESSAGE value="[修改]修改了Exporter变量名称及页面配置" />
<option name="LAST_COMMIT_MESSAGE" value="[修改]修改了Exporter变量名称及页面配置" />
<MESSAGE value="[增添]增添了datasource中的配置参数及对应页面" />
<option name="LAST_COMMIT_MESSAGE" value="[增添]增添了datasource中的配置参数及对应页面" />
</component>
</project>

View File

@@ -22,6 +22,11 @@ class ManageDataSource extends SettingsPage
protected static string $settings = DataSourceSettings::class;
protected static ?string $navigationLabel = '数据源配置管理'; // 设置侧边栏的中文名称
protected static ?string $title = '数据源配置管理'; // 自定义页面标题
public function form(Form $form): Form
{
return $form
@@ -60,19 +65,10 @@ class ManageDataSource extends SettingsPage
'Monitor' => '监控模式',
])
->required(),
TextInput::make('cache_update')
->label("缓存更新时间")
->suffix("ms")
->required(),
TextInput::make('cache_timeout')
->label("缓存超时时间")
->suffix("ms")
->required()
])
->visible(fn($get) => in_array($get('data_source_type'), ['opcua'])),
Fieldset::make()
->schema([
Select::make('security_mode')
@@ -128,21 +124,36 @@ class ManageDataSource extends SettingsPage
->visible(fn($get) => $get('security_mode') === 'OpensslMbedtls'),
// Anonymous mode: Shows 'measurement_point_address' and 'interface_address'
TextInput::make('measurement_point_address')
->label('测点地址')
->required()
->visible(fn($get) => in_array($get('security_mode'), ['Anonymous', 'Certificate', 'UsernamePassword', 'CertificateAndUsernamePassword', 'OpensslMbedtls'])),
TextInput::make('interface_address')
->label('接口地址')
->required()
->visible(fn($get) => in_array($get('security_mode'), ['Anonymous', 'Certificate', 'UsernamePassword', 'CertificateAndUsernamePassword', 'OpensslMbedtls'])),
Toggle::make('state')
->label('启用')
->onColor('success'),
// TextInput::make('measurement_point_address')
// ->label('测点地址')
// ->required()
// ->visible(fn($get) => in_array($get('security_mode'), ['Anonymous', 'Certificate', 'UsernamePassword', 'CertificateAndUsernamePassword', 'OpensslMbedtls'])),
//
// TextInput::make('interface_address')
// ->label('接口地址')
// ->required()
// ->visible(fn($get) => in_array($get('security_mode'), ['Anonymous', 'Certificate', 'UsernamePassword', 'CertificateAndUsernamePassword', 'OpensslMbedtls'])),
//
// Toggle::make('state')
// ->label('启用')
// ->onColor('success'),
])
->visible(fn($get) => in_array($get('data_source_type'), ['opcua'])),
Fieldset::make()
->schema([
TextInput::make('cache_update')
->label("缓存更新时间")
->suffix("ms")
->required(),
TextInput::make('cache_timeout')
->label("缓存超时时间")
->suffix("ms")
->required()
])
->visible(fn($get) => in_array($get('data_source_type'), ['opcua'])),
]);
}
}

View File

@@ -21,6 +21,11 @@ class ManageExporter extends SettingsPage
protected static string $settings = ExporterSettings::class;
protected static ?string $navigationLabel = 'Exporter配置管理'; // 设置侧边栏的中文名称
protected static ?string $title = 'Exporter配置管理'; // 自定义页面标题
public function form(Form $form): Form
{
return $form
@@ -28,10 +33,10 @@ class ManageExporter extends SettingsPage
Fieldset::make()
->schema([
TextInput::make('exposer_bind')
->label('bind')
->label('端口')
->required(),
TextInput::make('exposer_thread')
->label('thread')
->label('线程')
->required(),
]),

View File

@@ -13,6 +13,12 @@ class UpdateToEtcd extends Page
protected static string $view = 'filament.pages.update-to-etcd';
protected static ?string $navigationLabel = '导出至ETCD'; // 设置侧边栏的中文名称
protected static ?string $title = '导出至ETCD'; // 自定义页面标题
protected static ?int $navigationSort = 99999;
public function updateSettingsToEtcd()
{

View File

@@ -23,17 +23,31 @@ class MetricResource extends Resource
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
protected static ?string $navigationLabel = '测点配置管理'; // 设置侧边栏的中文名称
protected static ?string $label = '测点';
protected static ?string $pluralLabel = '测点';
public static function getBreadcrumb(): string
{
return '测点配置管理'; // 修改最外层面包屑标题为 "测点配置管理"
}
public static function form(Form $form): Form
{
return $form
->schema([
TextInput::make('name')
->label('名称')
->required()
->maxLength(255),
TextInput::make('help')
->label('帮助')
->maxLength(255),
Section::make('Node ID')
Section::make('节点 ID')
->description('节点设置必须唯一')
->columns([
'default' => 3
@@ -47,17 +61,17 @@ class MetricResource extends Resource
3 => 'GUID',
])
->default(1)
->label('Identifier Type')
->label('标识符类型')
->required()
->reactive(), // 确保当选择的值变化时触发其他字段的重新渲染
TextInput::make('namespace_index')
->label('Namespace')
->label('命名空间')
->required(),
// 数值型标识符字段
TextInput::make('numeric_id')
->label('Numeric ID')
->label('数值 ID')
->required()
->visible(fn($get) => $get('identifier_type') == Metric::TYPE_NUMERIC),
@@ -80,9 +94,10 @@ class MetricResource extends Resource
{
return $table
->columns([
TextColumn::make('name'),
TextColumn::make('name')
->label('名称'),
TextColumn::make('nodeid')
->label('Node ID')
->label('节点 ID')
->state(function ($record) {
switch ($record->identifier_type) {
case 1: // Numeric
@@ -96,6 +111,7 @@ class MetricResource extends Resource
}
}),
TextColumn::make('help')
->label('帮助')
])
->filters([
//

View File

@@ -8,5 +8,7 @@ use Filament\Resources\Pages\CreateRecord;
class CreateMetric extends CreateRecord
{
protected static ?string $title = '测点配置管理'; // 自定义页面标题
protected static string $resource = MetricResource::class;
}

View File

@@ -10,6 +10,8 @@ class EditMetric extends EditRecord
{
protected static string $resource = MetricResource::class;
protected static ?string $title = '测点配置管理'; // 自定义页面标题
protected function getHeaderActions(): array
{
return [

View File

@@ -10,6 +10,8 @@ class ListMetrics extends ListRecords
{
protected static string $resource = MetricResource::class;
protected static ?string $title = '测点配置管理'; // 自定义页面标题
protected function getHeaderActions(): array
{
return [

View File

@@ -26,18 +26,12 @@ class DataSourceSettings extends Settings
public ?string $certificate_authentication_file;
//信任列表
public ?string $trusted_list;
//测点地址
public string $measurement_point_address;
//接口地址
public string $interface_address;
public ?string $username;
public ?string $password;
//证书身份验证文件
public string $certificate_identity_file;
//密钥身份验证文件
public string $key_identity_file;
//启用
public bool $state;
//读取模式
public ?string $read_mode;
//缓存更新

View File

@@ -15,13 +15,13 @@ return new class extends SettingsMigration
$this->migrator->add('datasource.key_authentication_file', '');
$this->migrator->add('datasource.certificate_authentication_file', '');
$this->migrator->add('datasource.trusted_list', '');
$this->migrator->add('datasource.measurement_point_address', '');
$this->migrator->add('datasource.interface_address', '');
// $this->migrator->add('datasource.measurement_point_address', '');
// $this->migrator->add('datasource.interface_address', '');
$this->migrator->add('datasource.username', '');
$this->migrator->add('datasource.password', '');
$this->migrator->add('datasource.certificate_identity_file', '');
$this->migrator->add('datasource.key_identity_file', '');
$this->migrator->add('datasource.state', false);
// $this->migrator->add('datasource.state', false);
$this->migrator->add('datasource.read_mode', "sync");
$this->migrator->add('datasource.cache_update', 500);