/**
 * Formulář cíle cesty pro hosta
 * @param IEHost $host
 * @return \EaseTWBPanel
 */
function endRouteForm($host)
{
    $form = new EaseTWBForm('traceto');
    $form->addInput(new IEHostSelect('dest_host_id'), _('Gateway'), null, _('Zvolte již definovanou gateway, nabo zadejte konkrétní adresu.'));
    $form->addInput(new EaseHtmlInputTextTag('ip'), _('IP Adresa'), null, _('První pingnutelná veřejá adresa po cestě z hostu na monitorovací server'));
    $form->addItem(new EaseTWSubmitButton(_('Sledovat cestu'), 'success', array('onClick' => "\$('#preload').css('visibility', 'visible');")));
    EaseShared::webPage()->addItem(new EaseHtmlDivTag('preload', new IEFXPreloader(), array('class' => 'fuelux')));
    return new EaseTWBPanel(_('Volba cíle sledování') . ': ' . $host->getName(), 'default', $form, _('Vyberte hosta nebo zadejte IP adresu'));
}
Beispiel #2
0
if ($oPage->isPosted()) {
    $params = array();
    $public = $oPage->getRequestValue('public');
    if ($public) {
        $params['public'] = true;
    }
    $generate = $oPage->getRequestValue('generate');
    if ($public) {
        $params['generate'] = true;
    }
    $importer = new IEImporter($params);
    $cfgText = $oPage->getRequestValue('cfgtext');
    if ($cfgText) {
        $importer->importCfgText($cfgText, $params);
    }
    if (isset($_FILES['cfgfile']['tmp_name']) && strlen(trim($_FILES['cfgfile']['tmp_name']))) {
        $importer->importCfgFile($_FILES['cfgfile']['tmp_name']);
    }
} else {
    $oPage->addStatusMessage(_('Zadejte konfigurační fragment příkazu, nebo zvolte soubor k importu'));
}
$oPage->addItem(new IEPageTop(_('Import konfigurace')));
$importForm = new EaseTWBForm('CfgFileUp', null, 'POST', null, array('class' => 'form-horizontal', 'enctype' => 'multipart/form-data'));
$importForm->addInput(new EaseHtmlTextareaTag('cfgtext', ''), _('konfigurační fragment'));
$importForm->addInput(new EaseHtmlInputFileTag('cfgfile'), _('konfigurační soubor'));
$importForm->addInput(new IETWBSwitch('public'), _('Importovat data jako veřejná'));
$importForm->addInput(new IETWBSwitch('generate'), _('Generovat do konfigurace'));
$importForm->addItem(new EaseTWSubmitButton(_('importovat'), 'success', array('title' => _('zahájí import konfigurace'))));
$oPage->container->addItem(new EaseTWBPanel(_('Import konfigurace'), 'warning', $importForm));
$oPage->addItem(new IEPageBottom());
$oPage->draw();
 */
require_once 'includes/IEInit.php';
if ($oPage->isPosted()) {
    $importer = new IECommand();
    $success = 0;
    $cfgText = $oPage->getRequestValue('cfgtext');
    if ($cfgText) {
        $success += $importer->importText($cfgText, array('command_type' => $oPage->getRequestValue('type')));
    }
    if (isset($_FILES['cfgfile']['tmp_name']) && strlen(trim($_FILES['cfgfile']['tmp_name']))) {
        $success += $importer->importFile($_FILES['cfgfile']['tmp_name'], array('command_type' => $oPage->getRequestValue('type')));
    }
    if ($success) {
        $oPage->addStatusMessage(sprintf(_('Příkaz %s byl naimportován'), $importer->getName()), 'success');
    } else {
        $oPage->addStatusMessage(_('Příkaz nebyl naimportován'), 'warning');
    }
} else {
    $oPage->addStatusMessage(_('Zadejte konfigurační fragment příkazu, nebo zvolte soubor k importu'));
}
$oPage->addItem(new IEPageTop(_('Načtení příkazů ze souboru')));
$fileForm = new EaseTWBForm('CfgFileUp', null, 'POST', null, array('class' => 'form-horizontal', 'enctype' => 'multipart/form-data'));
$fileForm->addInput(new EaseHtmlTextareaTag('cfgtext', ''), _('konfigurační fragment'));
$fileForm->addInput(new EaseHtmlInputFileTag('cfgfile', null), _('konfigurační soubor'));
$typeSelector = new EaseHtmlSelect('type', 'check');
$typeSelector->addItems(array('check' => 'check', 'notify' => 'notify', 'handler' => 'handler'));
$fileForm->addInput($typeSelector, _('druh vkládaných příkazů'));
$fileForm->addItem(new EaseTWSubmitButton(_('importovat'), 'success'));
$oPage->container->addItem(new EaseTWBPanel(_('Import příkazu do konfigurace'), 'success', $fileForm));
$oPage->addItem(new IEPageBottom());
$oPage->draw();
Beispiel #4
0
 /**
  * Formulář pro přenos konfigurace
  *
  * @return \EaseTWBForm
  */
 public function &transferForm()
 {
     $exportForm = new EaseTWBForm('Export', $this->keyword . '.php');
     $exportForm->addItem(new EaseHtmlInputHiddenTag('action', 'export'));
     $exportForm->addItem(new EaseHtmlInputHiddenTag($this->myKeyColumn, $this->getId()));
     $exportForm->addInput(new EaseHtmlInputTextTag('destination', $this->user->getSettingValue('exporturl')), _('Cíl exportu'));
     $exportForm->addItem(new EaseHtmlH4Tag(_('Rekurzivní import')));
     foreach ($this->keywordsInfo as $columnName => $columnInfo) {
         if (isset($columnInfo['refdata']['table'])) {
             $exportForm->addInput(new EaseTWBSwitch('rels[' . $columnName . ']'), $columnInfo['title']);
         }
     }
     $exportForm->addInput(new EaseTWSubmitButton(_('Exportovat'), 'warning'));
     return $exportForm;
 }
Beispiel #5
0
$PocCommands = $command->getMyRecordsCount($userID);
if ($PocCommands) {
    $success = $oPage->columnIII->addItem(new EaseHtmlDivTag('Command', new EaseTWBLinkButton('commands.php', _('<i class="icon-list"></i>') . ' ' . sprintf(_('Definováno %s příkazů'), $PocCommands)), array('class' => 'alert alert-success')));
}
$pocServices = $service->getMyRecordsCount($userID);
if ($pocServices) {
    $success = $oPage->columnIII->addItem(new EaseHtmlDivTag('Service', new EaseTWBLinkButton('services.php', _('<i class="icon-list"></i>') . ' ' . sprintf(_('Definováno %s služeb'), $pocServices)), array('class' => 'alert alert-success')));
} else {
    if ($PocCommands) {
        if ($pocTimeperiods) {
            $warning = $oPage->columnIII->addItem(new EaseHtmlDivTag('Host', _('Nemáte definovaný žádné služby'), array('class' => 'alert alert-info')));
            $warning->addItem(new EaseTWBLinkButton('service.php', _('Založit první službu') . ' <i class="icon-edit"></i>'));
        }
    }
}
$pocServicegroups = $serviceGroup->getMyRecordsCount($userID);
if ($pocServicegroups) {
    $success = $oPage->columnIII->addItem(new EaseHtmlDivTag('Servicegroup', new EaseTWBLinkButton('servicegroups.php', _('<i class="icon-list"></i>') . ' ' . sprintf(_('Definováno %s skupin služeb'), $pocServicegroups)), array('class' => 'alert alert-success')));
}
if ($oUser->getSettingValue('admin')) {
    $oPage->columnI->addItem(new EaseTWBLinkButton('login.php?force_id=' . $userID, _('Přihlásit se jako uživatel <i class="icon-refresh"></i>')));
}
if ($oUser->getSettingValue('admin') || $oUser->getId() == $userID) {
    $ownershipForm = new EaseTWBForm('ownershipForm', null, 'POST');
    $ownershipForm->addInput(new IEUserSelect('ownership'), _('Nový vlastník'));
    $ownershipForm->addItem(new EaseTWSubmitButton(_('Předat'), 'warning'));
    $oPage->columnII->addItem(new EaseTWBPanel(_('Předat vlastnictví'), 'warning', $ownershipForm));
}
$oPage->columnIII->addItem($user->deleteButton());
$oPage->addItem(new IEPageBottom());
$oPage->draw();
Beispiel #6
0
        $host = new IEHost();
        $allHosts = $host->getListing();
        foreach ($allHosts as $hostId => $hostInfo) {
            $host->dataReset();
            $host->loadFromMySQL((int) $hostId);
            $host->setDataValue('config_hash', $host->getConfigHash());
            $host->saveToMySQL();
        }
        $oPage->addStatusMessage(sprintf(_('Stavy %s senzorů byly nastaveny'), count($allHosts)), 'success');
    }
}
$oPage->addItem(new IEPageTop(_('Reset objekt')));
$resetForm = new EaseTWBForm('reset');
$resetForm->addInput(new IEYesNoSwitch('host', FALSE), _('Hosti'), null, _('Smaže hosty, ale nechá předlohy'));
$resetForm->addInput(new IEYesNoSwitch('hostgroup', FALSE), _('Skupiny hostů'), null, _('Smaže skupiny hostů'));
$resetForm->addInput(new IEYesNoSwitch('contact', FALSE), _('Kontakty'), null, _('Smaže kontakty'));
$resetForm->addInput(new IEYesNoSwitch('contactgroup', FALSE), _('Skupiny kontaktů'), null, _('Smaže skupiny kontaktů'));
$resetForm->addInput(new IEYesNoSwitch('service', FALSE), _('Služby'), null, _('Smaže služby'));
$resetForm->addInput(new IEYesNoSwitch('servicegroup', FALSE), _('Skupiny služeb'), null, _('Smaže skupiny služeb'));
$resetForm->addItem(new EaseTWSubmitButton(_('Vymazat všechna data'), 'danger'));
$toolRow = new EaseTWBRow();
$toolRow->addColumn(6, new EaseTWBWell($resetForm));
$resyncForm = new EaseTWBForm('resync');
$resyncForm->addInput(new IEYesNoSwitch('desync', FALSE), _('Rozhodit Hash'), null, _('Všechny hosty s nasazeným senzorem budou hlásat zastaralou konfiguraci'));
$resyncForm->addInput(new IEYesNoSwitch('sync', FALSE), _('Nastavit Hash'), null, _('Všechny hosty s nasazeným senzorem budou hlásat aktuální konfiguraci'));
$resyncForm->addItem(new EaseTWSubmitButton(_('Provést operaci'), 'warning', array('onClick' => "\$('#preload').css('visibility', 'visible');")));
$toolRow->addColumn(6, new EaseTWBWell($resyncForm));
$oPage->container->addItem(new EaseTWBPanel(_('Pročištění databáze'), 'danger', $toolRow));
EaseShared::webPage()->addItem(new EaseHtmlDivTag('preload', new IEFXPreloader(), array('class' => 'fuelux')));
$oPage->addItem(new IEPageBottom());
$oPage->draw();