mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
parent
4590a9d174
commit
2cdba2aa65
@ -20,6 +20,15 @@ class ImportSourceForm extends DirectorObjectForm
|
|||||||
'required' => true,
|
'required' => true,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$this->addElement('textarea', 'description', array(
|
||||||
|
'label' => $this->translate('Description'),
|
||||||
|
'description' => $this->translate(
|
||||||
|
'An extended description for this Import Source. This should explain'
|
||||||
|
. " what kind of data you're going to import from this source."
|
||||||
|
),
|
||||||
|
'rows' => '3',
|
||||||
|
));
|
||||||
|
|
||||||
$this->addElement('select', 'provider_class', array(
|
$this->addElement('select', 'provider_class', array(
|
||||||
'label' => $this->translate('Source Type'),
|
'label' => $this->translate('Source Type'),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
|
@ -29,6 +29,15 @@ class SyncRuleForm extends DirectorObjectForm
|
|||||||
'required' => true,
|
'required' => true,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$this->addElement('textarea', 'description', array(
|
||||||
|
'label' => $this->translate('Description'),
|
||||||
|
'description' => $this->translate(
|
||||||
|
'An extended description for this Sync Rule. This should explain'
|
||||||
|
. ' what this Rule is going to accomplish.'
|
||||||
|
),
|
||||||
|
'rows' => '3',
|
||||||
|
));
|
||||||
|
|
||||||
$this->addElement('select', 'object_type', array(
|
$this->addElement('select', 'object_type', array(
|
||||||
'label' => $this->translate('Object Type'),
|
'label' => $this->translate('Object Type'),
|
||||||
'description' => $this->translate('Choose an object type'),
|
'description' => $this->translate('Choose an object type'),
|
||||||
|
@ -21,6 +21,8 @@ class ImportsourceTable extends QuickTable
|
|||||||
'provider_class' => 's.provider_class',
|
'provider_class' => 's.provider_class',
|
||||||
'import_state' => 's.import_state',
|
'import_state' => 's.import_state',
|
||||||
'last_error_message' => 's.last_error_message',
|
'last_error_message' => 's.last_error_message',
|
||||||
|
'description' => 'CASE WHEN s.description IS NULL THEN s.source_name'
|
||||||
|
. " ELSE s.source_name || ': ' || s.description END",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,7 +35,7 @@ class ImportsourceTable extends QuickTable
|
|||||||
{
|
{
|
||||||
$view = $this->view();
|
$view = $this->view();
|
||||||
return array(
|
return array(
|
||||||
'source_name' => $view->translate('Source name'),
|
'description' => $view->translate('Source name'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +20,8 @@ class SyncruleTable extends QuickTable
|
|||||||
'purge_existing' => 's.purge_existing',
|
'purge_existing' => 's.purge_existing',
|
||||||
'filter_expression' => 's.filter_expression',
|
'filter_expression' => 's.filter_expression',
|
||||||
'last_error_message' => 's.last_error_message',
|
'last_error_message' => 's.last_error_message',
|
||||||
|
'description' => 'CASE WHEN s.description IS NULL THEN s.rule_name'
|
||||||
|
. " ELSE s.rule_name || ': ' || s.description END",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,7 +48,7 @@ class SyncruleTable extends QuickTable
|
|||||||
{
|
{
|
||||||
$view = $this->view();
|
$view = $this->view();
|
||||||
return array(
|
return array(
|
||||||
'rule_name' => $view->translate('Rule name'),
|
'description' => $view->translate('Rule name'),
|
||||||
'object_type' => $view->translate('Object type'),
|
'object_type' => $view->translate('Object type'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
<p><?= $this->escape($source->description) ?></p>
|
||||||
<?php if ($source->import_state === 'unknown'): ?>
|
<?php if ($source->import_state === 'unknown'): ?>
|
||||||
<p><?= $this->translate(
|
<p><?= $this->translate(
|
||||||
"It's currently unknown whether we are in sync with this Import Source."
|
"It's currently unknown whether we are in sync with this Import Source."
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
<p><?= $this->escape($rule->description) ?></p>
|
||||||
<?php if (! $rule->hasSyncProperties()): ?>
|
<?php if (! $rule->hasSyncProperties()): ?>
|
||||||
<p class="warning">
|
<p class="warning">
|
||||||
<?= sprintf(
|
<?= sprintf(
|
||||||
|
@ -27,6 +27,7 @@ class ImportSource extends DbObjectWithSettings
|
|||||||
'import_state' => 'unknown',
|
'import_state' => 'unknown',
|
||||||
'last_error_message' => null,
|
'last_error_message' => null,
|
||||||
'last_attempt' => null,
|
'last_attempt' => null,
|
||||||
|
'description' => null,
|
||||||
);
|
);
|
||||||
|
|
||||||
protected $settingsTable = 'import_source_setting';
|
protected $settingsTable = 'import_source_setting';
|
||||||
|
@ -27,6 +27,7 @@ class SyncRule extends DbObject
|
|||||||
'sync_state' => 'unknown',
|
'sync_state' => 'unknown',
|
||||||
'last_error_message' => null,
|
'last_error_message' => null,
|
||||||
'last_attempt' => null,
|
'last_attempt' => null,
|
||||||
|
'description' => null,
|
||||||
);
|
);
|
||||||
|
|
||||||
private $sync;
|
private $sync;
|
||||||
|
9
schema/mysql-migrations/upgrade_137.sql
Normal file
9
schema/mysql-migrations/upgrade_137.sql
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
ALTER TABLE import_source
|
||||||
|
ADD COLUMN description TEXT DEFAULT NULL;
|
||||||
|
|
||||||
|
ALTER TABLE sync_rule
|
||||||
|
ADD COLUMN description TEXT DEFAULT NULL;
|
||||||
|
|
||||||
|
INSERT INTO director_schema_migration
|
||||||
|
(schema_version, migration_time)
|
||||||
|
VALUES (137, NOW());
|
@ -1246,6 +1246,7 @@ CREATE TABLE import_source (
|
|||||||
) NOT NULL DEFAULT 'unknown',
|
) NOT NULL DEFAULT 'unknown',
|
||||||
last_error_message TEXT DEFAULT NULL,
|
last_error_message TEXT DEFAULT NULL,
|
||||||
last_attempt DATETIME DEFAULT NULL,
|
last_attempt DATETIME DEFAULT NULL,
|
||||||
|
description TEXT DEFAULT NULL,
|
||||||
PRIMARY KEY (id),
|
PRIMARY KEY (id),
|
||||||
INDEX search_idx (key_column)
|
INDEX search_idx (key_column)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
@ -1390,6 +1391,7 @@ CREATE TABLE sync_rule (
|
|||||||
) NOT NULL DEFAULT 'unknown',
|
) NOT NULL DEFAULT 'unknown',
|
||||||
last_error_message TEXT DEFAULT NULL,
|
last_error_message TEXT DEFAULT NULL,
|
||||||
last_attempt DATETIME DEFAULT NULL,
|
last_attempt DATETIME DEFAULT NULL,
|
||||||
|
description TEXT DEFAULT NULL,
|
||||||
PRIMARY KEY (id)
|
PRIMARY KEY (id)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
@ -1559,4 +1561,4 @@ CREATE TABLE icinga_user_resolved_var (
|
|||||||
|
|
||||||
INSERT INTO director_schema_migration
|
INSERT INTO director_schema_migration
|
||||||
(schema_version, migration_time)
|
(schema_version, migration_time)
|
||||||
VALUES (136, NOW());
|
VALUES (137, NOW());
|
||||||
|
9
schema/pgsql-migrations/upgrade_137.sql
Normal file
9
schema/pgsql-migrations/upgrade_137.sql
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
ALTER TABLE import_source
|
||||||
|
ADD COLUMN description text DEFAULT NULL;
|
||||||
|
|
||||||
|
ALTER TABLE sync_rule
|
||||||
|
ADD COLUMN description text DEFAULT NULL;
|
||||||
|
|
||||||
|
INSERT INTO director_schema_migration
|
||||||
|
(schema_version, migration_time)
|
||||||
|
VALUES (137, NOW());
|
@ -1377,6 +1377,7 @@ CREATE TABLE import_source (
|
|||||||
import_state enum_sync_state NOT NULL DEFAULT 'unknown',
|
import_state enum_sync_state NOT NULL DEFAULT 'unknown',
|
||||||
last_error_message text NULL DEFAULT NULL,
|
last_error_message text NULL DEFAULT NULL,
|
||||||
last_attempt timestamp with time zone NULL DEFAULT NULL,
|
last_attempt timestamp with time zone NULL DEFAULT NULL,
|
||||||
|
description text DEFAULT NULL,
|
||||||
PRIMARY KEY (id)
|
PRIMARY KEY (id)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1529,6 +1530,7 @@ CREATE TABLE sync_rule (
|
|||||||
sync_state enum_sync_state NOT NULL DEFAULT 'unknown',
|
sync_state enum_sync_state NOT NULL DEFAULT 'unknown',
|
||||||
last_error_message text NULL DEFAULT NULL,
|
last_error_message text NULL DEFAULT NULL,
|
||||||
last_attempt timestamp with time zone NULL DEFAULT NULL,
|
last_attempt timestamp with time zone NULL DEFAULT NULL,
|
||||||
|
description text DEFAULT NULL,
|
||||||
PRIMARY KEY (id)
|
PRIMARY KEY (id)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1836,4 +1838,4 @@ CREATE INDEX user_resolved_var_schecksum ON icinga_user_resolved_var (checksum);
|
|||||||
|
|
||||||
INSERT INTO director_schema_migration
|
INSERT INTO director_schema_migration
|
||||||
(schema_version, migration_time)
|
(schema_version, migration_time)
|
||||||
VALUES (136, NOW());
|
VALUES (137, NOW());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user