diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 87fde7f..c6f0290 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,9 +4,16 @@
-
+
+
+
+
+
+
+
+
@@ -360,7 +367,7 @@
-
+
@@ -450,7 +457,15 @@
1724743728810
-
+
+
+ 1724745600949
+
+
+
+ 1724745600949
+
+
@@ -507,6 +522,7 @@
-
+
+
\ No newline at end of file
diff --git a/management-panel/app/Filament/Pages/ManageDataSource.php b/management-panel/app/Filament/Pages/ManageDataSource.php
index 1a3878e..bd2c44c 100644
--- a/management-panel/app/Filament/Pages/ManageDataSource.php
+++ b/management-panel/app/Filament/Pages/ManageDataSource.php
@@ -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'])),
+
]);
}
}
diff --git a/management-panel/app/Filament/Pages/ManageExporter.php b/management-panel/app/Filament/Pages/ManageExporter.php
index ade1b13..ae93c0c 100644
--- a/management-panel/app/Filament/Pages/ManageExporter.php
+++ b/management-panel/app/Filament/Pages/ManageExporter.php
@@ -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(),
]),
diff --git a/management-panel/app/Filament/Pages/UpdateToEtcd.php b/management-panel/app/Filament/Pages/UpdateToEtcd.php
index 84e5e51..86b73e7 100644
--- a/management-panel/app/Filament/Pages/UpdateToEtcd.php
+++ b/management-panel/app/Filament/Pages/UpdateToEtcd.php
@@ -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()
{
diff --git a/management-panel/app/Filament/Resources/MetricResource.php b/management-panel/app/Filament/Resources/MetricResource.php
index f983beb..709ec4a 100644
--- a/management-panel/app/Filament/Resources/MetricResource.php
+++ b/management-panel/app/Filament/Resources/MetricResource.php
@@ -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([
//
diff --git a/management-panel/app/Filament/Resources/MetricResource/Pages/CreateMetric.php b/management-panel/app/Filament/Resources/MetricResource/Pages/CreateMetric.php
index 89c6dd7..d160741 100644
--- a/management-panel/app/Filament/Resources/MetricResource/Pages/CreateMetric.php
+++ b/management-panel/app/Filament/Resources/MetricResource/Pages/CreateMetric.php
@@ -8,5 +8,7 @@ use Filament\Resources\Pages\CreateRecord;
class CreateMetric extends CreateRecord
{
+ protected static ?string $title = '测点配置管理'; // 自定义页面标题
+
protected static string $resource = MetricResource::class;
}
diff --git a/management-panel/app/Filament/Resources/MetricResource/Pages/EditMetric.php b/management-panel/app/Filament/Resources/MetricResource/Pages/EditMetric.php
index 5d00ba1..46a455e 100644
--- a/management-panel/app/Filament/Resources/MetricResource/Pages/EditMetric.php
+++ b/management-panel/app/Filament/Resources/MetricResource/Pages/EditMetric.php
@@ -10,6 +10,8 @@ class EditMetric extends EditRecord
{
protected static string $resource = MetricResource::class;
+ protected static ?string $title = '测点配置管理'; // 自定义页面标题
+
protected function getHeaderActions(): array
{
return [
diff --git a/management-panel/app/Filament/Resources/MetricResource/Pages/ListMetrics.php b/management-panel/app/Filament/Resources/MetricResource/Pages/ListMetrics.php
index fd9454e..5d10eba 100644
--- a/management-panel/app/Filament/Resources/MetricResource/Pages/ListMetrics.php
+++ b/management-panel/app/Filament/Resources/MetricResource/Pages/ListMetrics.php
@@ -10,6 +10,8 @@ class ListMetrics extends ListRecords
{
protected static string $resource = MetricResource::class;
+ protected static ?string $title = '测点配置管理'; // 自定义页面标题
+
protected function getHeaderActions(): array
{
return [
diff --git a/management-panel/app/Settings/DataSourceSettings.php b/management-panel/app/Settings/DataSourceSettings.php
index 4f94822..1dadf38 100644
--- a/management-panel/app/Settings/DataSourceSettings.php
+++ b/management-panel/app/Settings/DataSourceSettings.php
@@ -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;
//缓存更新
diff --git a/management-panel/database/settings/2024_08_27_015013_data_source_settings.php b/management-panel/database/settings/2024_08_27_015013_data_source_settings.php
index 0769a2d..7838e0c 100644
--- a/management-panel/database/settings/2024_08_27_015013_data_source_settings.php
+++ b/management-panel/database/settings/2024_08_27_015013_data_source_settings.php
@@ -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);