Permalink
Browse files

Update views/cluster_info.php

  • Loading branch information...
1 parent 914a98e commit b620ab4cab4971dc8091ff085c47d752eaedfe25 FlashySearch committed Dec 26, 2012
Showing with 49 additions and 14 deletions.
  1. +49 −14 views/cluster_info.php
@@ -1,21 +1,32 @@
-<div id="cluster_selection">
- <?php if (count($cluster_details) > 1): ?>
- Select a cluster:
+<table id="navigation" class="table table-bordered table-striped">
+ <tr>
+ <td onclick="document.location.href='?nav=schema'"><a href="?nav=schema">Schema</a></td>
+ <td onclick="document.location.href='?nav=cluster'"><a href="?nav=cluster">Cluster</a></td>
+ </tr>
+</table>
+
+<?php echo $success_message; ?>
+<?php echo $error_message; ?>
+
+<?php
+if ($_GET['nav'] == "cluster") {
+?>
+
+<div id="cluster_info" class="well">
+
+ <div id="cluster_selection">
+ <font class="cluster_name">Cluster Name:</font>
<select name="cluster" id="cluster" onchange="applyClusterChange();">
<?php foreach ($cluster_details as $index => $one_cluster): ?>
<?php $current_cluster_name = $cluster_helper->getClusterNameForIndex($index); ?>
<?php if (!is_null($current_cluster_name)): ?><option value="<?php echo $index?>" <?php if ($cluster_helper->getClusterIndex() == $index): echo 'selected="selected"'; endif; ?>><?php echo $current_cluster_name?></option><?php endif; ?>
<?php endforeach; ?>
</select>
- <?php endif; ?>
-</div>
-
-<div id="cluster_info" class="well">
- <h3>Cluster Name: <?php echo $cluster_name; ?></h3>
+ </div>
Cluster Partitioner: <?php echo $partitioner; ?><br />
Cluster Snitch: <?php echo $snitch; ?><br />
- Thrift API Version: <?php echo $thrift_api_version; ?><br />
+ Thrift API Version: <?php echo $thrift_api_version; ?><br /><br />
Schema Versions: <br />
<table width="100%" class="cluster_status table table-bordered table-striped">
<?php
@@ -34,17 +45,35 @@
</table>
</div>
-<?php echo $success_message; ?>
-<?php echo $error_message; ?>
-
-<a href="keyspace_action.php?action=create" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Create New Keyspace</a>
+<?php
+} else {
+?>
<ul id="keyspaces" class="well">
<h3>Keyspaces and Column Families</h3>
+ <a href="keyspace_action.php?action=create" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Create New Keyspace</a>
+
+ <br /><br />
+
+ <table width="100%" class="table table-bordered table-striped kcfs">
<?php
$nb_ks = count($keyspaces_name);
for ($i = 0; $i < $nb_ks; $i++):
+ if ($i/2 == intval($i/2)) {
+ $beg = '<tr>';
+ $beg .= '<td>';
+
+ $end = '</td>';
+ } else {
+ $beg = '<td>';
+
+ $end = '</td>';
+ $end .= '</tr>';
+ }
+
+ echo $beg;
+
$keyspace_name = $keyspaces_name[$i];
echo '<li><a href="describe_keyspace.php?keyspace_name='.$keyspace_name.'">'.$keyspace_name.'</a>';
@@ -56,14 +85,20 @@
endfor;
echo '</ul>';
echo '</li>';
+
+ echo $end;
endfor;
?>
+ </table>
</ul>
+<?php
+}
+?>
+
<h3>JMX</h3>
<ul>
<li><a href="jmx.php">See Stats</a></li>
</ul>
-

0 comments on commit b620ab4

Please sign in to comment.