Esempio n. 1
0
        if (strlen($ID) <= 0) {
            continue;
        }
        $ID = IntVal($ID);
        switch ($_REQUEST['action']) {
            case "delete":
                $arNode = CClusterDBNode::GetByID($ID);
                if (is_array($arNode) && ($arNode["ROLE_ID"] == "SLAVE" || $arNode["ROLE_ID"] == "MASTER") && ($arNode["STATUS"] == "READY" || $arNode["STATUS"] == "PAUSED")) {
                    CClusterDBNode::Delete($arNode["ID"]);
                }
                break;
            case "pause":
                CClusterSlave::Pause($ID);
                break;
            case "resume":
                CClusterSlave::Resume($ID);
                break;
            case "stop":
                CClusterSlave::Stop($ID);
                break;
            case "skip_sql_error":
                CClusterSlave::SkipSQLError($ID);
                break;
        }
    }
}
$arHeaders = array(array("id" => "ID", "content" => GetMessage("CLU_SLAVE_LIST_ID"), "align" => "right", "default" => true), array("id" => "FLAG", "content" => GetMessage("CLU_SLAVE_LIST_FLAG"), "align" => "center", "default" => true), array("id" => "NAME", "content" => GetMessage("CLU_SLAVE_LIST_NAME"), "align" => "left", "default" => true), array("id" => "BEHIND", "content" => GetMessage("CLU_SLAVE_LIST_BEHIND"), "align" => "right", "default" => true), array("id" => "STATUS", "content" => GetMessage("CLU_SLAVE_LIST_STATUS"), "align" => "center", "default" => true), array("id" => "WEIGHT", "content" => GetMessage("CLU_SLAVE_LIST_WEIGHT"), "align" => "right", "default" => true), array("id" => "DESCRIPTION", "content" => GetMessage("CLU_SLAVE_LIST_DESCRIPTION"), "align" => "left", "default" => false), array("id" => "DB_HOST", "content" => GetMessage("CLU_SLAVE_LIST_DB_HOST"), "align" => "left", "default" => false), array("id" => "DB_NAME", "content" => GetMessage("CLU_SLAVE_LIST_DB_NAME"), "align" => "left", "default" => false), array("id" => "DB_LOGIN", "content" => GetMessage("CLU_SLAVE_LIST_DB_LOGIN"), "align" => "left", "default" => false));
$lAdmin->AddHeaders($arHeaders);
$arFilter = array("=ROLE_ID" => array("MAIN", "SLAVE", "MASTER"));
if ($group_id > 0) {
    $arFilter["=GROUP_ID"] = $group_id;