Permalink
Browse files

Merge pull request #27 from FlashySearch/master

More structured UI
  • Loading branch information...
sebgiroux committed Dec 26, 2012
2 parents 055f3a9 + 7e49162 commit 9334654f3a8ad7fc0c8d082deed301b3f8020cbe
Showing with 84 additions and 19 deletions.
  1. +28 −3 css/style.css
  2. +54 −14 views/cluster_info.php
  3. +2 −2 views/header.php
View
@@ -32,6 +32,10 @@ td {
margin-bottom: 5px;
}
+#cca_title a {
+ text-decoration: none;
+}
+
.small_horizontal_spacer {
float: left;
width: 5px;
@@ -188,8 +192,7 @@ select {
}
#cluster_info {
- width: 500px;
- padding-top: 10px;
+ width: 100% -50px;
}
a, a:visited {
@@ -233,7 +236,7 @@ a, a:visited {
.composite_value b {color:blue;}
#keyspaces {
- width: 500px;
+ width: 100% -50px;
}
#keyspaces li {
@@ -242,3 +245,25 @@ a, a:visited {
margin: 3px;
padding: 3px;
}
+
+#navigation td {
+ width: 50%;
+ cursor: pointer;
+}
+
+font.cluster_name {
+ font-weight: bold;
+ font-size: 16px;
+}
+
+table.kcfs td {
+ width: 50%;
+}
+
+table.kcfs a {
+ text-decoration: none;
+}
+
+table.kcfs a:hover {
+ text-decoration: underline;
+}
View
@@ -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,40 @@
</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) and $i == $nb_ks-1):
+ $beg = '<tr>';
+ $beg .= '<td colspan="2">';
+
+ $end = '</td>';
+ $end .= '</tr>';
+ elseif ($i/2 == intval($i/2)):
+ $beg = '<td>';
+
+ $end = '</td>';
+ else:
+ $beg = '<td>';
+
+ $end = '</td>';
+ $end .= '</tr>';
+ endif;
+
+ echo $beg;
+
$keyspace_name = $keyspaces_name[$i];
echo '<li><a href="describe_keyspace.php?keyspace_name='.$keyspace_name.'">'.$keyspace_name.'</a>';
@@ -56,14 +90,20 @@
endfor;
echo '</ul>';
echo '</li>';
+
+ echo $end;
endfor;
?>
+ </table>
</ul>
+<?php
+endif;
+?>
+
<h3>JMX</h3>
<ul>
<li><a href="jmx.php">See Stats</a></li>
</ul>
-
View
@@ -18,6 +18,6 @@
</head>
<body>
- <h1 id="cca_title">Cassandra Cluster Admin</h1>
+ <h1 id="cca_title"><a href="./">Cassandra Cluster Admin</a></h1>
<?php if (CCA_LOGIN_REQUIRED && isset($_SESSION['cca_login'])): ?><div class="float_right"><a href="logout.php">Logout</a></div><?php endif; ?>
- <div class="clear_both"></div>
+ <div class="clear_both"></div>

0 comments on commit 9334654

Please sign in to comment.