Return-Path: X-Original-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DBDF9C998 for ; Tue, 5 Jun 2012 23:08:52 +0000 (UTC) Received: (qmail 61811 invoked by uid 500); 5 Jun 2012 23:08:52 -0000 Delivered-To: apmail-incubator-ambari-commits-archive@incubator.apache.org Received: (qmail 61791 invoked by uid 500); 5 Jun 2012 23:08:52 -0000 Mailing-List: contact ambari-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@incubator.apache.org Delivered-To: mailing list ambari-commits@incubator.apache.org Received: (qmail 61783 invoked by uid 99); 5 Jun 2012 23:08:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jun 2012 23:08:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jun 2012 23:08:49 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 9253623888CD; Tue, 5 Jun 2012 23:08:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1346649 - in /incubator/ambari/branches/ambari-186: CHANGES.txt hmc/css/common.css hmc/html/head.inc Date: Tue, 05 Jun 2012 23:08:28 -0000 To: ambari-commits@incubator.apache.org From: vikram@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120605230828.9253623888CD@eris.apache.org> Author: vikram Date: Tue Jun 5 23:08:28 2012 New Revision: 1346649 URL: http://svn.apache.org/viewvc?rev=1346649&view=rev Log: AMBARI-352. Add flow control - force redirects to appropriate pages based on cluster configuration status for better usability (Contributed by Yusaku) Added: incubator/ambari/branches/ambari-186/hmc/html/head.inc Modified: incubator/ambari/branches/ambari-186/CHANGES.txt incubator/ambari/branches/ambari-186/hmc/css/common.css Modified: incubator/ambari/branches/ambari-186/CHANGES.txt URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/CHANGES.txt?rev=1346649&r1=1346648&r2=1346649&view=diff ============================================================================== --- incubator/ambari/branches/ambari-186/CHANGES.txt (original) +++ incubator/ambari/branches/ambari-186/CHANGES.txt Tue Jun 5 23:08:28 2012 @@ -6,6 +6,8 @@ characters wide. Release 0.1.x - unreleased + AMBARI-352. Add flow control - force redirects to appropriate pages based on cluster configuration status for better usability (Yusaku via Vikram) + AMBARI-351. Monitoring dashboard should auto refresh as regular interval (Vitthal Gogate via Vikram) AMBARI-349. Logging in case of error during uninstall needs to be fixed. (Vikram) Modified: incubator/ambari/branches/ambari-186/hmc/css/common.css URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/css/common.css?rev=1346649&r1=1346648&r2=1346649&view=diff ============================================================================== --- incubator/ambari/branches/ambari-186/hmc/css/common.css (original) +++ incubator/ambari/branches/ambari-186/hmc/css/common.css Tue Jun 5 23:08:28 2012 @@ -276,6 +276,10 @@ td { margin:40px 0 0 40px; } +div.formElement { + clear:both; +} + #configureClusterAdvancedCoreDivId label, #deployDynamicRenderDivId label, #deployCoreDivId label { Added: incubator/ambari/branches/ambari-186/hmc/html/head.inc URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/html/head.inc?rev=1346649&view=auto ============================================================================== --- incubator/ambari/branches/ambari-186/hmc/html/head.inc (added) +++ incubator/ambari/branches/ambari-186/hmc/html/head.inc Tue Jun 5 23:08:28 2012 @@ -0,0 +1,52 @@ +getAllClusters(); +$clusters = $res['clusters']; +$baseUrl = basename(preg_replace('/\?.*/', '', $_SERVER['REQUEST_URI'])); +$logger->log_trace('basename='.$baseUrl); +$appDir = "/hmc/html"; + +$logger->log_trace('basename='.$baseUrl); +if (sizeof($clusters) == 0) { + if ($baseUrl != 'welcome.php' && $baseUrl != 'initializeCluster.php') { + header("Location: $appDir/welcome.php"); + return; + } +} else { + foreach ($clusters as $cluster) { + $state = json_decode($cluster['state'], true); + $logger->log_trace('cluster state='.print_r($state,1)); + switch ($state['state']) { + case 'DEPLOYED': + if ($state['context']['status']) { + return; + } else { + if ($baseUrl != "reinstall.php" && $baseUrl != "uninstallWizard.php") { + header("Location: $appDir/reinstall.php"); + return; + } + } + break; + case 'CONFIGURATION_IN_PROGRESS': + if ($baseUrl != 'initializeCluster.php') { + header("Location: $appDir/initializeCluster.php"); + } + break; + case 'DEPLOYMENT_IN_PROGRESS': + if ($baseUrl != 'showDeployProgress.php') { + header("Location: $appDir/showDeployProgress.php?clusterName=" . $cluster['clusterName']); + } + break; + } + } +} +?> \ No newline at end of file