[修改]修改文本 调整了布局
This commit is contained in:
@@ -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'])),
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user