Skip to content

Commit

Permalink
Added Switch "Host is Server" to New host wizard
Browse files Browse the repository at this point in the history
Host Page switched to english language
  • Loading branch information
Vitexus committed Aug 17, 2016
1 parent 86495b0 commit e9f0da2
Show file tree
Hide file tree
Showing 17 changed files with 252 additions and 206 deletions.
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,24 @@ Gui for generating Icinga configuration files and much more...
[![Build Status](https://img.shields.io/travis/Vitexus/icinga_configurator/master.svg?style=flat-square)](https://travis-ci.org/Vitexus/icinga_configurator)
[![Coverage Status](https://img.shields.io/coveralls/Vitexus/icinga_configurator/master.svg?style=flat-square)](https://coveralls.io/r/Vitexus/icinga_configurator?branch=master)

Instalation:
Features
--------

* Generate configuration for multiplete users
* Provide deploy scripts for auto configure NSClient++
* Scannig tcp ports for known services
* Outdated sensors overview
* Recursive import configuration form icinga/nagios config files
* Export configurations to another instance Icinga-editor using HTTP
* Network topology map
* Tool to watch traceroute ping
* Automatic Downtime Schedule for devices every night down (Host is server switch)
* Host icon downloader

Instalation
-----------

(Please run sql server first)
Please make sure you run sql server first

wget -O - http://v.s.cz/info@vitexsoftware.cz.gpg.key|sudo apt-key add -
echo deb http://v.s.cz/ stable main > /etc/apt/sources.list.d/ease.list
Expand All @@ -23,7 +38,7 @@ Sorry
=====

* We support only Icinga 1.x configuration yet ...
* Current Default localization is CZECH. (English translation is almost finished.)
* English translation is under progress. But some pages localization is still in CZECH language.

Screenshots
-----------
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vitexsoftware/icinga-editor",
"description": "Editor of Icinga Configuration files",
"license": "GPL-2.0",
"version": "1.1.2",
"version": "1.2.1",
"authors": [
{
"name": "vitex",
Expand Down
8 changes: 6 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
icinga-editor (1.1.2-25) UNRELEASED; urgency=medium
icinga-editor (1.1.2-26) UNRELEASED; urgency=medium

[ dvorak ]
* Initial release. (Closes: #XXXXXX)
Expand Down Expand Up @@ -119,5 +119,9 @@ icinga-editor (1.1.2-25) UNRELEASED; urgency=medium
* Fixed Scripts Edit/Upload Switching strings to English
* Fixed Scripts Edit/Upload Switching strings to English
* Support for ShutDown & Up scripts to start/stop icinga
* Deploy script for Windows now use PowerShell Automatic icinga reload
after successfull Configuration files generation Deploying new
script C:\Program Files\NSClient++\refresh.ps1 Main page switched to
English language

-- vitex <vitex@developer.kancl.brevnov.czf> Tue, 16 Aug 2016 19:03:04 +0200
-- vitex <vitex@developer.kancl.brevnov.czf> Wed, 17 Aug 2016 15:03:07 +0200
2 changes: 1 addition & 1 deletion debian/conf/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vitexsoftware/icinga-editor",
"description": "Editor of Icinga Configuration files (debianized)",
"version": "1.1.2.25",
"version": "1.1.2.26",
"license": "GPL-2.0",
"authors": [
{
Expand Down
2 changes: 1 addition & 1 deletion debian/revison
Original file line number Diff line number Diff line change
@@ -1 +1 @@
25
26
Binary file modified doc/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 8 additions & 9 deletions src/classes/UI/ContactSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
namespace Icinga\Editor\UI;

/**
* Volba contactů sledovaných danou službou
* Select contacts for service
*
* @package IcingaEditor
* @subpackage WebUI
* @author Vitex <vitex@hippy.cz>
* @copyright 2012 Vitex@hippy.cz (G)
* @copyright 2012-2016 Vitex@hippy.cz (G)
*/
class ContactSelector extends \Ease\Container
{
Expand All @@ -24,11 +23,11 @@ public function __construct($holder)
$contactsAssigned = [];
parent::__construct();
$fieldName = $holder->getmyKeyColumn();
$initialContent = new \Ease\TWB\Panel(_('Cíle notifikací'));
$initialContent = new \Ease\TWB\Panel(_('Contacts'));
$initialContent->setTagCss(['width' => '100%']);

if (is_null($holder->getMyKey())) {
$initialContent->addItem(_('Nejprve je potřeba uložit záznam'));
$initialContent->addItem(_('Please saver record first'));
} else {
$serviceName = $holder->getName();
$contact = new \Icinga\Editor\Engine\Contact();
Expand Down Expand Up @@ -63,9 +62,9 @@ public function __construct($holder)
$contactInfo[$contact->nameColumn], 'inverse', 'xs',
[
new \Ease\Html\ATag('contacttweak.php?contact_id='.$contactInfo['parent_id'].'&amp;service_id='.$holder->getId(),
\Ease\TWB\Part::GlyphIcon('wrench').' '._('Editace')),
\Ease\TWB\Part::GlyphIcon('wrench').' '._('Edit')),
new \Ease\Html\ATag('?addcontact='.$contactInfo[$contact->nameColumn].'&amp;contact_id='.$contactID.'&amp;'.$holder->getmyKeyColumn().'='.$holder->getMyKey().'&amp;'.$holder->nameColumn.'='.$holder->getName(),
\Ease\TWB\Part::GlyphIcon('plus').' '._('Začít obesílat'))
\Ease\TWB\Part::GlyphIcon('plus').' '._('Start notifing'))
]));
}
}
Expand All @@ -80,9 +79,9 @@ public function __construct($holder)
[
new \Ease\Html\ATag(
'?delcontact='.$contactInfo[$contact->nameColumn].'&amp;contact_id='.$contactID.'&amp;'.$holder->getmyKeyColumn().'='.$holder->getMyKey().'&amp;'.$holder->nameColumn.'='.$holder->getName(),
\Ease\TWB\Part::GlyphIcon('remove').' '._('Přestat obesílat'))
\Ease\TWB\Part::GlyphIcon('remove').' '._('Stop notifing'))
, new \Ease\Html\ATag('contacttweak.php?contact_id='.$contactInfo['parent_id'].'&amp;service_id='.$holder->getId(),
\Ease\TWB\Part::GlyphIcon('wrench').' '._('Editace'))
\Ease\TWB\Part::GlyphIcon('wrench').' '._('Edit'))
]
)
);
Expand Down
2 changes: 1 addition & 1 deletion src/classes/UI/InfoBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class InfoBox extends \Ease\TWB\Panel
/**
* Infopanel objektu
*
* @param IEcfg $subject
* @param \Icinga\Editor\Engine\Configurator $subject
*/
public function __construct($subject)
{
Expand Down
21 changes: 13 additions & 8 deletions src/classes/UI/PassiveCheckedHostForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
namespace Icinga\Editor\UI;

/**
* Formulář průvodce založením nového hosta
* New Passive Host Wizard Form
*
* @package IcingaEditor
* @subpackage WebUI
* @author Vitex <vitex@hippy.cz>
* @copyright 2015 Vitex@hippy.cz (G)
* @copyright 2015-2016 Vitex@hippy.cz (G)
*/

/**
Expand All @@ -24,11 +23,17 @@ function afterAdd()
$this->addItem(new \Ease\TWB\FormGroup(_('Jméno'),
new \Ease\Html\InputTextTag('host_name',
\Ease\Shared::webPage()->getRequestValue('host_name')),
_('hostname'), _('DOMAIN\machine'), _('Název sledovaného stroje')));
$this->addItem(new \Ease\TWB\FormGroup(_('Platforma'),
new PlatformSelector('platform'), null,
_('Platforma sledovaného stroje')));
$this->addItem(new \Ease\TWB\SubmitButton(_('Založit').'&nbsp'.\Ease\TWB\Part::GlyphIcon('forward'),
_('hostname'), _('DOMAIN\machine'), _('Watched host name')));
$this->addItem(new \Ease\TWB\FormGroup(_('Platform'),
new PlatformSelector('platform'), null, _('Watched host platform')));

$this->addInput(new UI\TWBSwitch('host_is_server', $check_method, true,
['handleWidth' => '200px', 'onText' => _('Yes'), 'offText' => _('No')]),
_('Still running'), _('Still running ?'),
_('<strong>Yes</strong> host is still Up. <br><strong>No</strong> device every night down (notebook or PC etc.)'));


$this->addItem(new \Ease\TWB\SubmitButton(_('Create').'&nbsp'.\Ease\TWB\Part::GlyphIcon('forward'),
'success'));
$this->addItem(new \Ease\Html\InputHiddenTag('host_group',
\Ease\Shared::webPage()->getRequestValue('host_group')));
Expand Down
2 changes: 1 addition & 1 deletion src/classes/UI/StemplateSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class StemplateSelect extends \Ease\Html\Select

function loadItems()
{
$tpls = ['' => _('zvol ze seznamu')];
$tpls = ['' => _('choose ...')];
$stemplate = new \Icinga\Editor\Stemplate();
$templates = $stemplate->getColumnsFromSQL([$stemplate->getmyKeyColumn(),
$stemplate->nameColumn]);
Expand Down
31 changes: 15 additions & 16 deletions src/classes/UI/UsedServiceSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,37 @@
namespace Icinga\Editor\UI;

/**
* Volba služeb patřičných k hostu
* Host services selected
*
* @package IcingaEditor
* @subpackage WebUI
* @author Vitex <vitex@hippy.cz>
* @copyright 2012 Vitex@hippy.cz (G)
* @copyright 2012-2016 Vitex@hippy.cz (G)
*/
class UsedServiceSelector extends \Ease\Container
{

/**
* Editor k přidávání členů skupiny
* Editor for services on Host
*
* @param IEHost $host
* @param \Icinga\Editor\Engine\Host $host
*/
public function __construct($host)
{
parent::__construct();

if ($host->getDataValue('platform') == 'generic') {
$note = '<small><span class="label label-info">Tip:</span> '._('Další sledovatelné služby budou nabídnuty po nastavení platformy hosta a vzdáleného senzoru.').'</small>';
$note = '<small><span class="label label-info">Tip:</span> '._('Choose Host platform to choose from more services').'</small>';
} else {
$note = [];
}


$initialContent = new \Ease\TWB\Panel(_('Sledované služby'), 'default',
$initialContent = new \Ease\TWB\Panel(_('Services watched'), 'default',
null, $note);
$initialContent->setTagCss(['width' => '100%']);

if (is_null($host->getMyKey())) {
$initialContent->addItem(_('Nejprve je potřeba uložit záznam'));
$initialContent->addItem(_('Please save record first'));
} else {
$hostName = $host->getName();
$service = new \Icinga\Editor\Engine\Service();
Expand Down Expand Up @@ -114,7 +113,7 @@ public function __construct($host)

if (count($servicesAssigned)) {
$saveAsTemplateButton = new \Ease\TWB\LinkButton('stemplate.php?action=copyhost&host_id='.$host->getId(),
_('Uložit zvolene jako sadu sledovanych sluzeb'), 'success');
_('Save selected services as Preset'), 'success');
$initialContent->footer($saveAsTemplateButton);

$initialContent->addItem('</br>');
Expand All @@ -131,7 +130,7 @@ public function __construct($host)
[
new \Ease\Html\ATag(
'?delservice='.$serviceInfo[$service->nameColumn].'&amp;service_id='.$serviceID.'&amp;'.$host->getmyKeyColumn().'='.$host->getMyKey().'&amp;'.$host->nameColumn.'='.$host->getName(),
\Ease\TWB\Part::GlyphIcon('remove').' '._('Přestat sledovat'))
\Ease\TWB\Part::GlyphIcon('remove').' '._('Stop watching'))
, new \Ease\Html\ATag('servicetweak.php?service_id='.$serviceID.'&amp;host_id='.$host->getId(),
\Ease\TWB\Part::GlyphIcon('wrench').' '._('Editace'))
], ['title' => $serviceInfo['service_description']]
Expand All @@ -145,7 +144,7 @@ public function __construct($host)
$presetSelForm->addItem(new \Ease\Html\InputHiddenTag('action',
'applystemplate'));
$presetSelForm->addItem(new StemplateSelect('stemplate_id'));
$presetSelForm->addItem(new \Ease\TWB\SubmitButton(_('Aplikovat sadu sluzeb'),
$presetSelForm->addItem(new \Ease\TWB\SubmitButton(_('Apply services Preset'),
'success'));
$presetSelForm->setTagClass('form-inline');
$initialContent->footer($presetSelForm);
Expand All @@ -168,27 +167,27 @@ public static function saveMembers($request)
$service->addMember('host_name', $request['host_id'],
$request['host_name']);
if ($service->saveToSQL()) {
$service->addStatusMessage(sprintf(_('položka %s byla přidána'),
$service->addStatusMessage(sprintf(_('item %s was added'),
$request['addservice']), 'success');
if ($service->getDataValue('autocfg') == '1') {
$service->addStatusMessage(sprintf(_('Službu %s je nutné nejprve zkonfigurovat'),
$service->addStatusMessage(sprintf(_('Please save service %s first'),
$request['addservice']), 'warning');
\Ease\Shared::webPage()->redirect('servicetweak.php?host_id='.$request ['host_id'].'&service_id='.$request[$service->myKeyColumn]);
exit();
}
} else {
$service->addStatusMessage(sprintf(_('položka %s nebyla přidána'),
$service->addStatusMessage(sprintf(_('item %s was not added'),
$request['addservice']), 'warning');
}
}
if (isset($request['delservice'])) {
$service->delMember('host_name', $request['host_id'],
$request['host_name']);
if ($service->saveToSQL()) {
$service->addStatusMessage(sprintf(_('položka %s byla odebrána'),
$service->addStatusMessage(sprintf(_('item %s was assigned'),
$request['delservice']), 'success');
} else {
$service->addStatusMessage(sprintf(_('položka %s nebyla odebrána'),
$service->addStatusMessage(sprintf(_('item %s was not assigned'),
$request['delservice']), 'warning');
}
}
Expand Down
Loading

0 comments on commit e9f0da2

Please sign in to comment.