chg: [localTools:local_tool_connectors] Added support of CodeMirror placeholder
parent
aeaa833f64
commit
f18307b3cb
|
@ -122,6 +122,11 @@ class MispConnector extends CommonConnectorTools
|
|||
'type' => 'boolean'
|
||||
],
|
||||
];
|
||||
public $settingsPlaceholder = [
|
||||
'url' => 'https://your.misp.intance',
|
||||
'authkey' => '',
|
||||
'skip_ssl' => '0',
|
||||
];
|
||||
|
||||
public function addSettingValidatorRules($validator)
|
||||
{
|
||||
|
|
|
@ -46,6 +46,22 @@ class SkeletonConnector extends CommonConnectorTools
|
|||
'redirect' => 'serverSettingsAction'
|
||||
]
|
||||
];
|
||||
public $settings = [
|
||||
'url' => [
|
||||
'type' => 'text'
|
||||
],
|
||||
'authkey' => [
|
||||
'type' => 'text'
|
||||
],
|
||||
'skip_ssl' => [
|
||||
'type' => 'boolean'
|
||||
],
|
||||
];
|
||||
public $settingsPlaceholder = [
|
||||
'url' => 'https://your.url',
|
||||
'authkey' => '',
|
||||
'skip_ssl' => '0',
|
||||
];
|
||||
|
||||
public function health(Object $connection): array
|
||||
{
|
||||
|
|
|
@ -143,7 +143,8 @@ class LocalToolsTable extends AppTable
|
|||
'connector' => $connector_type,
|
||||
'connector_version' => $connector_class->version,
|
||||
'connector_description' => $connector_class->description,
|
||||
'connector_settings' => $connector_class->settings ?? []
|
||||
'connector_settings' => $connector_class->settings ?? [],
|
||||
'connector_settings_placeholder' => $connector_class->settingsPlaceholder ?? [],
|
||||
];
|
||||
if ($includeConnections) {
|
||||
$connector['connections'] = $this->healthCheck($connector_type, $connector_class);
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
'codemirror' => [
|
||||
'height' => '10rem',
|
||||
'hints' => $connectors[0]['connector_settings']
|
||||
]
|
||||
],
|
||||
'placeholder' => json_encode($connectors[0]['connector_settings_placeholder'], JSON_FORCE_OBJECT | JSON_PRETTY_PRINT)
|
||||
],
|
||||
[
|
||||
'field' => 'description',
|
||||
|
|
Loading…
Reference in New Issue