mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
sysutils/beats: Refactor namespace (#4633)
* sysutils/beats: Refactor namespace * Update sysutils/beats/src/opnsense/mvc/app/models/OPNsense/Beats/ACL/ACL.xml --------- Co-authored-by: Franco Fichtner <franco@lastsummer.de>
This commit is contained in:
co-authored by
Franco Fichtner
parent
9e420dde80
commit
82a0b947d9
+5
-5
@@ -26,20 +26,20 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
namespace OPNsense\Filebeat\Api;
|
||||
namespace OPNsense\Beats\Api;
|
||||
|
||||
use OPNsense\Base\ApiMutableServiceControllerBase;
|
||||
|
||||
/**
|
||||
* Class ServiceController
|
||||
* @package OPNsense\Filebeat
|
||||
* @package OPNsense\Beats
|
||||
*/
|
||||
class ServiceController extends ApiMutableServiceControllerBase
|
||||
{
|
||||
protected static $internalServiceClass = '\OPNsense\Beats8\Filebeat';
|
||||
protected static $internalServiceTemplate = 'OPNsense/Filebeat';
|
||||
protected static $internalServiceClass = '\OPNsense\Beats\Filebeat';
|
||||
protected static $internalServiceTemplate = 'OPNsense/Beats';
|
||||
protected static $internalServiceEnabled = 'enabled';
|
||||
protected static $internalServiceName = 'filebeat';
|
||||
protected static $internalServiceName = 'beats';
|
||||
protected function reconfigureForceRestart()
|
||||
{
|
||||
return 0;
|
||||
+3
-3
@@ -26,16 +26,16 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
namespace OPNsense\Filebeat\Api;
|
||||
namespace OPNsense\Beats\Api;
|
||||
|
||||
use OPNsense\Base\ApiMutableModelControllerBase;
|
||||
|
||||
/**
|
||||
* Class SettingsController Handles settings related API actions for the HelloWorld module
|
||||
* @package OPNsense\Filebeat
|
||||
* @package OPNsense\Beats
|
||||
*/
|
||||
class SettingsController extends ApiMutableModelControllerBase
|
||||
{
|
||||
protected static $internalModelClass = 'OPNsense\Beats8\Filebeat';
|
||||
protected static $internalModelClass = 'OPNsense\Beats\Filebeat';
|
||||
protected static $internalModelName = 'filebeat';
|
||||
}
|
||||
+2
-2
@@ -26,7 +26,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
namespace OPNsense\Filebeat;
|
||||
namespace OPNsense\Beats;
|
||||
|
||||
/**
|
||||
* Class IndexController
|
||||
@@ -37,7 +37,7 @@ class IndexController extends \OPNsense\Base\IndexController
|
||||
public function indexAction()
|
||||
{
|
||||
// pick the template to serve to our users.
|
||||
$this->view->pick('OPNsense/Beats8/filebeat');
|
||||
$this->view->pick('OPNsense/Beats/filebeat');
|
||||
// fetch form data "general" in
|
||||
$this->view->generalForm = $this->getForm("filebeat");
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<acl>
|
||||
<page-services-beats>
|
||||
<name>Services: Beats</name>
|
||||
<patterns>
|
||||
<pattern>ui/beats</pattern>
|
||||
<pattern>api/beats/*</pattern>
|
||||
</patterns>
|
||||
</page-services-beats>
|
||||
</acl>
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
namespace OPNsense\Beats8;
|
||||
namespace OPNsense\Beats;
|
||||
|
||||
use OPNsense\Base\BaseModel;
|
||||
use OPNsense\Base\Messages\Message;
|
||||
@@ -0,0 +1,7 @@
|
||||
<menu>
|
||||
<Services>
|
||||
<Beats cssClass="fa fa-heartbeat fa-fw">
|
||||
<Filebeat url="/ui/beats"/>
|
||||
</Beats>
|
||||
</Services>
|
||||
</menu>
|
||||
@@ -1,9 +0,0 @@
|
||||
<acl>
|
||||
<page-services-beats8>
|
||||
<name>Services: Beats8</name>
|
||||
<patterns>
|
||||
<pattern>ui/filebeat/*</pattern>
|
||||
<pattern>api/filebeat/*</pattern>
|
||||
</patterns>
|
||||
</page-services-beats8>
|
||||
</acl>
|
||||
@@ -1,7 +0,0 @@
|
||||
<menu>
|
||||
<Services>
|
||||
<Beats8 cssClass="fa fa-heartbeat fa-fw">
|
||||
<Filebeat url="/ui/filebeat"/>
|
||||
</Beats8>
|
||||
</Services>
|
||||
</menu>
|
||||
+5
-5
@@ -26,19 +26,19 @@
|
||||
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
mapDataToFormUI({'frm_GeneralSettings':"/api/filebeat/settings/get"}).done(function(data){
|
||||
updateServiceControlUI('filebeat');
|
||||
mapDataToFormUI({'frm_GeneralSettings':"/api/beats/settings/get"}).done(function(data){
|
||||
updateServiceControlUI('beats');
|
||||
$('.selectpicker').selectpicker('refresh');
|
||||
});
|
||||
|
||||
$("#reconfigureAct").SimpleActionButton({
|
||||
onPreAction: function() {
|
||||
const dfObj = new $.Deferred();
|
||||
saveFormToEndpoint("/api/filebeat/settings/set", 'frm_GeneralSettings', function () { dfObj.resolve(); }, true, function () { dfObj.reject(); });
|
||||
saveFormToEndpoint("/api/beats/settings/set", 'frm_GeneralSettings', function () { dfObj.resolve(); }, true, function () { dfObj.reject(); });
|
||||
return dfObj;
|
||||
},
|
||||
onAction: function(data, status) {
|
||||
updateServiceControlUI('filebeat');
|
||||
updateServiceControlUI('beats');
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -48,4 +48,4 @@
|
||||
{{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_GeneralSettings'])}}
|
||||
</div>
|
||||
|
||||
{{ partial('layout_partials/base_apply_button', {'data_endpoint': '/api/filebeat/service/reconfigure'}) }}
|
||||
{{ partial('layout_partials/base_apply_button', {'data_endpoint': '/api/beats/service/reconfigure'}) }}
|
||||
Reference in New Issue
Block a user