Ejemplo n.º 1
0
    function ShowStepNoError()
    {
        $wizard =& $this->GetWizard();
        $to_node_id = $wizard->GetVar('to_node_id');
        if ($wizard->GetVar('module')) {
            $module = $wizard->GetVar('module');
            $from_node_id = intval(COption::GetOptionString($module, "dbnode_id"));
            if ($from_node_id <= 0) {
                $from_node_id = 1;
            }
        } else {
            $from_node_id = $wizard->GetVar('from_node_id');
            $arNodeModules = CClusterDBNode::GetModules($wizard->GetVar('from_node_id'));
            $module = key($arNodeModules);
        }
        $path = $wizard->package->path;
        $this->content = '';
        $this->content .= '<div style="padding: 20px;">';
        $this->content .= '<div id="output"><br /></div>';
        $this->content .= '</div>';
        $this->content .= '<script type="text/javascript" src="' . $path . '/js/import.js?rand=' . mt_rand() . '"></script>';
        $this->content .= '<script type="text/javascript">

var nextButtonID = "' . $wizard->GetNextButtonID() . '";
var formID = "' . $wizard->GetFormName() . '";
var LANG = \'' . LANG . '\';
var from_node_id = "' . CUtil::JSEscape($from_node_id) . '";
var to_node_id = "' . CUtil::JSEscape($to_node_id) . '";
var module = "' . CUtil::JSEscape($module) . '";
var status = "' . CUtil::JSEscape($wizard->GetVar('status')) . '";
var path = "' . CUtil::JSEscape($path) . '";
var sessid = "' . bitrix_sessid() . '";

if (window.addEventListener)
{
	window.addEventListener("load", DisableButton, false);
	window.addEventListener("load", MoveTables, false);
}
else if (window.attachEvent)
{
	window.attachEvent("onload", DisableButton);
	window.attachEvent("onload", MoveTables);
}
</script>';
    }
Ejemplo n.º 2
0
    function ShowStepNoError()
    {
        global $APPLICATION;
        $wizard =& $this->GetWizard();
        $path = $wizard->package->path;
        $to_node_id = $wizard->GetVar('to_node_id');
        if ($wizard->GetVar('module')) {
            $module = $wizard->GetVar('module');
            $from_node_id = intval(COption::GetOptionString($module, "dbnode_id"));
            if ($from_node_id <= 0) {
                $from_node_id = 1;
            }
        } else {
            $from_node_id = $wizard->GetVar('from_node_id');
            $arNodeModules = CClusterDBNode::GetModules($wizard->GetVar('from_node_id'));
            $module = key($arNodeModules);
        }
        CJSCore::Init(array("ajax"));
        $APPLICATION->AddHeadScript($path . '/js/import.js');
        $this->content = '';
        $this->content .= '<div style="padding: 20px;">';
        $this->content .= '<div id="output"><br /></div>';
        $this->content .= '</div>';
        if ($wizard->GetPrevStepID() == 'step1' || $wizard->GetPrevStepID() == 'step2') {
            $this->content .= '
				<script type="text/javascript">
					var nextButtonID = "' . $wizard->GetNextButtonID() . '";
					var formID = "' . $wizard->GetFormName() . '";
					var LANG = \'' . LANG . '\';
					var from_node_id = "' . CUtil::JSEscape($from_node_id) . '";
					var to_node_id = "' . CUtil::JSEscape($to_node_id) . '";
					var module = "' . CUtil::JSEscape($module) . '";
					var status = "' . CUtil::JSEscape($wizard->GetVar('status')) . '";
					var path = "' . CUtil::JSEscape($path) . '";
					var sessid = "' . bitrix_sessid() . '";
					BX.ready(DisableButton);
					BX.ready(MoveTables);
				</script>
			';
        }
    }
Ejemplo n.º 3
0
                    CClusterDBNode::Delete($arNode["ID"]);
                }
                break;
        }
    }
}
$arHeaders = array(array("id" => "ID", "content" => GetMessage("CLU_DBNODE_LIST_ID"), "align" => "right", "default" => true), array("id" => "FLAG", "content" => GetMessage("CLU_DBNODE_LIST_FLAG"), "align" => "center", "default" => true), array("id" => "ACTIVE", "content" => GetMessage("CLU_DBNODE_LIST_ACTIVE"), "align" => "center", "default" => true), array("id" => "STATUS", "content" => GetMessage("CLU_DBNODE_LIST_STATUS"), "align" => "center", "default" => true), array("id" => "NAME", "content" => GetMessage("CLU_DBNODE_LIST_NAME"), "align" => "left", "default" => true), array("id" => "MODULES", "content" => GetMessage("CLU_DBNODE_LIST_MODULES"), "align" => "left", "default" => true), array("id" => "DESCRIPTION", "content" => GetMessage("CLU_DBNODE_LIST_DESCRIPTION"), "align" => "left", "default" => false), array("id" => "DB_HOST", "content" => GetMessage("CLU_DBNODE_LIST_DB_HOST"), "align" => "left", "default" => false), array("id" => "DB_NAME", "content" => GetMessage("CLU_DBNODE_LIST_DB_NAME"), "align" => "left", "default" => false), array("id" => "DB_LOGIN", "content" => GetMessage("CLU_DBNODE_LIST_DB_LOGIN"), "align" => "left", "default" => false));
$lAdmin->AddHeaders($arHeaders);
$strUptimeError = "";
$cData = new CClusterDBNode();
$rsData = $cData->GetList(array("ID" => "ASC"), array("=ROLE_ID" => array("MAIN", "MODULE"), "=MASTER_ID" => false));
$rsData = new CAdminResult($rsData, $sTableID);
while ($arRes = $rsData->Fetch()) {
    $row =& $lAdmin->AddRow($arRes["ID"], $arRes);
    $uptime = CClusterDBNode::GetUpTime($arRes["ID"]);
    $arModules = CClusterDBNode::GetModules($arRes["ID"]);
    if ($arRes["ACTIVE"] == "Y") {
        if ($arRes["STATUS"] == "OFFLINE" && $uptime !== false) {
            CClusterDBNode::SetOnline($arRes["ID"]);
            $arRes["STATUS"] = "ONLINE";
        } elseif ($arRes["STATUS"] == "ONLINE" && count($arModules) <= 0 && $arRes["ROLE_ID"] == "MODULE") {
            $ob = new CClusterDBNode();
            $ob->Update($arRes["ID"], array("STATUS" => "READY"));
            $arRes["STATUS"] = "READY";
        } elseif ($arRes["STATUS"] == "READY" && count($arModules) > 0) {
            $ob = new CClusterDBNode();
            $ob->Update($arRes["ID"], array("STATUS" => "ONLINE"));
            $arRes["STATUS"] = "ONLINE";
        } elseif ($arRes["STATUS"] == "READY" && $arRes["ROLE_ID"] == "MAIN") {
            $ob = new CClusterDBNode();
            $ob->Update($arRes["ID"], array("STATUS" => "ONLINE"));