Esempio n. 1
0
function log_list() {
    $ajax = new AjaxFilter("modules/imaging/imaging/ajaxLogs.php", "container", getParams());
    //$ajax->setRefresh(10000);
    $ajax->display();
    echo '<br/><br/><br/>';
    $ajax->displayDivToUpdate();
}
Esempio n. 2
0
    function service_list($type, $target_uuid, $target_name) {
        $params = getParams();
        $params['target_uuid'] = $target_uuid;
        $params['target_type'] = $type;
        $params['target_name'] = $target_name;

        $ajax = new AjaxFilter("modules/imaging/imaging/ajaxServices.php", "Level2", $params, "Level2");
        //$ajax->setRefresh(10000);
        $ajax->display();
        echo '<br/><br/><br/>';
        $ajax->displayDivToUpdate();
    }
Esempio n. 3
0
foreach (getPolicies() as $policy) {
    if (startsWith($policy[0], $src) && startsWith($policy[1], $dst)) {
        $label = sprintf("%s (%s) → %s (%s)", getZoneType($policy[0]), $policy[0], getZoneType($policy[1]), $policy[1]);
        $decisionTpl = new SelectItem($policy[0] . "_" . $policy[1] . "_policy");
        $decisionTpl->setElements(array(_T("Accept"), _T("Drop")));
        $decisionTpl->setElementsVal(array("ACCEPT", "DROP"));
        $decisionTpl->setSelected($policy[2]);
        $f->add(new TrFormElement($label, $decisionTpl));
    }
}
$f->pop();
$f->addButton("bpolicy", _T("Save"));
$f->display();
print '<br />';
// Rules list display
$ajax = new AjaxFilter(urlStrRedirect("shorewall/shorewall/ajax_" . $page));
$ajax->display();
$t = new TitleElement(_T("Port forwarding rules"), 2);
$t->display();
$ajax->displayDivToUpdate();
// Add rule form
print '<script type="text/javascript" src="modules/shorewall/includes/functions.js"></script><br />';
$t = new TitleElement(_T("Add port forwarding rule"), 2);
$t->display();
$f = new ValidatingForm(array("id" => "rule"));
$f->push(new Table());
$macros = getServices();
$services = array("", _T("Custom...")) + $macros;
$servicesVals = array("", "custom") + $macros;
$serviceTpl = new SelectItem("service", "toggleCustom");
$serviceTpl->setElements($services);
Esempio n. 4
0
$p->display();

if (isset($_POST["bconfirm"])) {
    $ret = msc_download_file($_GET['objectUUID']);
    if (is_array($ret) && ($ret[0] === True)) {
        new NotifyWidgetSuccess(_T('The download is in progress.', 'msc'));
    } else {
        if ($ret[1] == 1) {
            new NotifyWidgetFailure(_T("A file is already being downloaded.", "msc"));
        } else {
            new NotifyWidgetFailure(_T("The download has failed.", "msc"));
        }
    }
}

$ajax = new AjaxFilter(urlStrRedirect('base/computers/ajaxDownloadFile', array('objectUUID' => $_GET['objectUUID'])));
$ajax->setRefresh(web_def_refresh_time());
$ajax->display();

$f = new Form(array('id' => 'dl'));
$f->addSummary(_T('Click below to start downloading file from this computer. Warning: the download may last a long time', 'msc'));
$computer = getMachine(array('uuid'=>$_GET['objectUUID']), $ping = False);
$f->addButton('bconfirm', sprintf(_T('Start download from computer %s', 'msc'), $computer->hostname));
$f->display();

print '<br />';

$ajax->displayDivToUpdate();

?>
Esempio n. 5
0
function image_list($type, $title, $actions=true) {
    $params = getParams();
    $params['target_uuid'] = $_GET['target_uuid'];
    if (!$actions) {
        $params['master'] = True;
    }

    // show title
    if($title) {
        $t = new TitleElement($title);
        $t->display();
    }

    $ajax = new AjaxFilter("modules/imaging/imaging/ajaxImages.php", "container".($actions?'image':'master'), $params, "form".($actions?'image':'master'));
    //$ajax->setRefresh(10000);
    $ajax->display();
    echo '<br/><br/><br/>';
    $ajax->displayDivToUpdate();
}