mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
Importsources: remove dummy, allow import / export
This commit is contained in:
parent
17321e4a5f
commit
5be3f092a9
@ -30,10 +30,10 @@ class ImportsourcesController extends ActionController
|
|||||||
if ($this->getRequest()->isApiRequest()) {
|
if ($this->getRequest()->isApiRequest()) {
|
||||||
switch (strtolower($this->getRequest()->getMethod())) {
|
switch (strtolower($this->getRequest()->getMethod())) {
|
||||||
case 'get':
|
case 'get':
|
||||||
throw new \RuntimeException('sdaf');
|
$this->sendExport();
|
||||||
break;
|
break;
|
||||||
case 'post':
|
case 'post':
|
||||||
$this->import($this->getRequest()->getRawBody());
|
$this->acceptImport($this->getRequest()->getRawBody());
|
||||||
break;
|
break;
|
||||||
// TODO: put / replace all?
|
// TODO: put / replace all?
|
||||||
default:
|
default:
|
||||||
@ -53,6 +53,15 @@ class ImportsourcesController extends ActionController
|
|||||||
(new ImportsourceTable($this->db()))->renderTo($this);
|
(new ImportsourceTable($this->db()))->renderTo($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $raw
|
||||||
|
* @throws \Icinga\Exception\ConfigurationError
|
||||||
|
*/
|
||||||
|
protected function acceptImport(& $raw)
|
||||||
|
{
|
||||||
|
(new ImportExport($this->db()))->unserializeImportSources(json_decode($raw));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Icinga\Exception\ConfigurationError
|
* @throws \Icinga\Exception\ConfigurationError
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user