diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/KeyController.php b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/KeyController.php new file mode 100644 index 000000000..a60c33101 --- /dev/null +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/KeyController.php @@ -0,0 +1,64 @@ + + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +namespace OPNsense\Telegraf\Api; + +use \OPNsense\Base\ApiMutableModelControllerBase; + +class KeyController extends ApiMutableModelControllerBase +{ + static protected $internalModelName = 'key'; + static protected $internalModelClass = '\OPNsense\Telegraf\Key'; + + public function searchKeyAction() + { + return $this->searchBase('keys.key', array("enabled", "name", "value")); + } + public function getKeyAction($uuid = null) + { + $this->sessionClose(); + return $this->getBase('key', 'keys.key', $uuid); + } + public function addKeyAction() + { + return $this->addBase('key', 'keys.key'); + } + public function delKeyAction($uuid) + { + return $this->delBase('keys.key', $uuid); + } + public function setKeyAction($uuid) + { + return $this->setBase('key', 'keys.key', $uuid); + } + public function toggleKeyAction($uuid) + { + return $this->toggleBase('keys.key', $uuid); + } +} diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/GeneralController.php b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/GeneralController.php index 8e4ae931d..b77ff77ce 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/GeneralController.php +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/GeneralController.php @@ -33,6 +33,7 @@ class GeneralController extends \OPNsense\Base\IndexController public function indexAction() { $this->view->generalForm = $this->getForm("general"); + $this->view->formDialogEditTelegrafKey = $this->getForm("dialogEditTelegrafKey"); $this->view->pick('OPNsense/Telegraf/general'); } } diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/dialogEditTelegrafKey.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/dialogEditTelegrafKey.xml new file mode 100644 index 000000000..ce7b19d0e --- /dev/null +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/dialogEditTelegrafKey.xml @@ -0,0 +1,20 @@ +
diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Key.php b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Key.php new file mode 100644 index 000000000..9eee9e90d --- /dev/null +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Key.php @@ -0,0 +1,31 @@ + + All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +namespace OPNsense\Telegraf; + +use OPNsense\Base\BaseModel; + +class Key extends BaseModel +{ +} diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Key.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Key.xml new file mode 100644 index 000000000..f1ed05a5d --- /dev/null +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Key.xml @@ -0,0 +1,25 @@ +| {{ lang._('Enabled') }} | +{{ lang._('Name') }} | +{{ lang._('Value') }} | +{{ lang._('ID') }} | +{{ lang._('Commands') }} | +|
|---|---|---|---|---|---|
| + | + + | +||||