Skip to content
This repository was archived by the owner on Oct 14, 2021. It is now read-only.

Commit 7b6894e

Browse files
committed
Added start/stop and settings placeholder
1 parent 39687ef commit 7b6894e

File tree

6 files changed

+217
-3
lines changed

6 files changed

+217
-3
lines changed

controllers/elasticsearch.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ function index()
6363
// Load views
6464
//-----------
6565

66-
$this->page->view_form('elasticsearch', NULL, lang('elasticsearch_app_name'));
66+
$views = array('elasticsearch/server', 'elasticsearch/settings');
67+
68+
$this->page->view_forms($views, lang('elasticsearch_app_name'));
6769
}
6870
}

controllers/server.php

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
3+
/**
4+
* Elasticsearch daemon controller.
5+
*
6+
* @category apps
7+
* @package elasticsearch
8+
* @subpackage controllers
9+
* @author eGloo <[email protected]>
10+
* @copyright 2016 eGloo
11+
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 3 or later
12+
* @link https://www.egloo.ca/netify/community
13+
*/
14+
15+
///////////////////////////////////////////////////////////////////////////////
16+
//
17+
// This program is free software: you can redistribute it and/or modify
18+
// it under the terms of the GNU General Public License as published by
19+
// the Free Software Foundation, either version 3 of the License, or
20+
// (at your option) any later version.
21+
//
22+
// This program is distributed in the hope that it will be useful,
23+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
24+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25+
// GNU General Public License for more details.
26+
//
27+
// You should have received a copy of the GNU General Public License
28+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
29+
//
30+
///////////////////////////////////////////////////////////////////////////////
31+
32+
///////////////////////////////////////////////////////////////////////////////
33+
// B O O T S T R A P
34+
///////////////////////////////////////////////////////////////////////////////
35+
36+
$bootstrap = getenv('CLEAROS_BOOTSTRAP') ? getenv('CLEAROS_BOOTSTRAP') : '/usr/clearos/framework/shared';
37+
require_once $bootstrap . '/bootstrap.php';
38+
39+
///////////////////////////////////////////////////////////////////////////////
40+
// D E P E N D E N C I E S
41+
///////////////////////////////////////////////////////////////////////////////
42+
43+
require clearos_app_base('base') . '/controllers/daemon.php';
44+
45+
///////////////////////////////////////////////////////////////////////////////
46+
// C L A S S
47+
///////////////////////////////////////////////////////////////////////////////
48+
49+
/**
50+
* Elasticsearch daemon controller.
51+
*
52+
* @category apps
53+
* @package elasticsearch
54+
* @subpackage controllers
55+
* @author eGloo <[email protected]>
56+
* @copyright 2016 eGloo
57+
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 3 or later
58+
* @link https://www.egloo.ca/netify/community
59+
*/
60+
61+
class Server extends Daemon
62+
{
63+
function __construct()
64+
{
65+
parent::__construct('elasticsearch', 'elasticsearch');
66+
}
67+
}

controllers/settings.php

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<?php
2+
3+
/**
4+
* Elasticsearch settings controller.
5+
*
6+
* @category apps
7+
* @package elasticsearch
8+
* @subpackage controllers
9+
* @author eGloo <[email protected]>
10+
* @copyright 2016 eGloo
11+
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 3 or later
12+
* @link https://www.egloo.ca/netify/community
13+
*/
14+
15+
///////////////////////////////////////////////////////////////////////////////
16+
//
17+
// This program is free software: you can redistribute it and/or modify
18+
// it under the terms of the GNU General Public License as published by
19+
// the Free Software Foundation, either version 3 of the License, or
20+
// (at your option) any later version.
21+
//
22+
// This program is distributed in the hope that it will be useful,
23+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
24+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25+
// GNU General Public License for more details.
26+
//
27+
// You should have received a copy of the GNU General Public License
28+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
29+
//
30+
///////////////////////////////////////////////////////////////////////////////
31+
32+
///////////////////////////////////////////////////////////////////////////////
33+
// C L A S S
34+
///////////////////////////////////////////////////////////////////////////////
35+
36+
/**
37+
* Elasticsearch settings controller.
38+
*
39+
* @category apps
40+
* @package elasticsearch
41+
* @subpackage controllers
42+
* @author eGloo <[email protected]>
43+
* @copyright 2016 eGloo
44+
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 3 or later
45+
* @link https://www.egloo.ca/netify/community
46+
*/
47+
48+
class Settings extends ClearOS_Controller
49+
{
50+
/**
51+
* Elasticsearch settings controller
52+
*
53+
* @return view
54+
*/
55+
56+
function index()
57+
{
58+
$this->_common('view');
59+
}
60+
61+
/**
62+
* Edit view.
63+
*
64+
* @return view
65+
*/
66+
67+
function edit()
68+
{
69+
$this->_common('edit');
70+
}
71+
72+
/**
73+
* View view.
74+
*
75+
* @return view
76+
*/
77+
78+
function view()
79+
{
80+
$this->_common('view');
81+
}
82+
83+
/**
84+
* Common view/edit handler.
85+
*
86+
* @param string $form_type form type
87+
*
88+
* @return view
89+
*/
90+
91+
function _common($form_type)
92+
{
93+
// Load dependencies
94+
//------------------
95+
96+
$this->lang->load('elasticsearch');
97+
98+
// Load view data
99+
//---------------
100+
101+
try {
102+
} catch (Exception $e) {
103+
$this->page->view_exception($e);
104+
return;
105+
}
106+
107+
// Load views
108+
//-----------
109+
110+
$this->page->view_form('elasticsearch/settings', $data, lang('base_settings'));
111+
}
112+
}

htdocs/elasticsearch.svg

+33
Loading

language/en_US/elasticsearch_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
22

33
$lang['elasticsearch_app_name'] = 'Elasticsearch';
4-
$lang['elasticsearch_app_description'] = 'Elasticsearch - a description goes here.';
4+
$lang['elasticsearch_app_description'] = 'Elasticsearch is a flexible and powerful free / libre / open source, distributed, real-time search and analytics engine. It is super fast, RESTful, based on Apache Lucene.';

views/elasticsearch.php views/settings.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
// Form
4040
///////////////////////////////////////////////////////////////////////////////
4141

42-
echo infobox_highlight(lang('elasticsearch_app_name'), '...');
42+
echo infobox_highlight(lang('elasticsearch_app_name'), 'Nothing to see hear yet.');

0 commit comments

Comments
 (0)