Skip to content

Commit

Permalink
Merge pull request #28 from FlashySearch/master
Browse files Browse the repository at this point in the history
Mostly UI/navigation changes and minor fixes
  • Loading branch information
Sébastien Giroux committed Dec 27, 2012
2 parents 9334654 + ea838de commit d6d63a6
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 30 deletions.
8 changes: 4 additions & 4 deletions README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Cassandra Cluster Admin is a GUI tool to help people administrate their Apache C

If you're like me and used MySQL for a while (and still using it!), you get used to phpMyAdmin and its simple and easy to use user interface. I thought it would be nice to have a similar tool for Cassandra and I couldn't find any, so I build my own!

With Cassandra Cluster Admin, you can create/edit/drop keyspace and column family, truncate a column family, create secondary indexes, display a row, browse data (get range slice), insert a row and much more!
With Cassandra Cluster Admin, you can create/edit/drop keyspaces and column families, truncate a column family, create secondary indexes, display a row, browse data (get range slice), insert a row and much more!

Bug report and/or pull request are always welcome!

Screenshots
------------------------------------------------

[![Cassandra Cluster Admin Homepage](http://img708.imageshack.us/img708/7939/screenshot1kk.th.png)](http://img708.imageshack.us/img708/7939/screenshot1kk.png) [![Cassandra Cluster Admin Column family Definition and Actions](http://img24.imageshack.us/img24/7249/screenshot2po.th.png)](http://img24.imageshack.us/img24/7249/screenshot2po.png) [![Cassandra Cluster Admin List of Column Families in a Keyspace](http://img855.imageshack.us/img855/3512/screenshot3tc.th.png)](http://img855.imageshack.us/img855/3512/screenshot3tc.png) [![Cassandra Cluster Admin Edit a Column Family](http://img52.imageshack.us/img52/6885/screenshot4kr.th.png)](http://img52.imageshack.us/img52/6885/screenshot4kr.png)
[![Viewing Keyspaces and Column Families](http://www.flashy.cc/cassandra-cluster-admin/1_small.png)](http://www.flashy.cc/cassandra-cluster-admin/1.png) [![Viewing Cluster](http://www.flashy.cc/cassandra-cluster-admin/2_small.png)](http://www.flashy.cc/cassandra-cluster-admin/2.png) [![Cassandra Cluster Admin Column family Definition and Actions](http://www.flashy.cc/cassandra-cluster-admin/4_small.png)](http://www.flashy.cc/cassandra-cluster-admin/4.png) [![Cassandra Cluster Admin List of Column Families in a Keyspace](http://www.flashy.cc/cassandra-cluster-admin/5_small.png)](http://www.flashy.cc/cassandra-cluster-admin/5.png)

Supported actions
------------------------------------------------
Expand Down Expand Up @@ -57,11 +57,11 @@ Add the following line to your php.ini file:

Disclaimer
------------------------------------------------
This software is still in beta so always be careful when using it on a production cluster. I won't take any responsability if for some reason this tool drop all your keyspaces and wipe all your data, althought I really doubt it will happen =)
This software is still in beta so always be careful when using it on a production cluster. I won't take any responsability if for some reason this tool drops all your keyspaces and wipes all your data, although I really doubt it will happen =)


Credits
------------------------------------------------
* The Apache Cassandra project - http://cassandra.apache.org/
* Tyler Hobbs (thobbs) - phpcassa - https://github.com/thobbs/phpcassa
* Twitter Bootstrap - https://github.com/twitter/bootstrap/
* Twitter Bootstrap - https://github.com/twitter/bootstrap/
4 changes: 2 additions & 2 deletions columnfamily_action.php
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@
$column_name = $_POST['column_name_'.$no_scf.'_'.$no_column];
$column_value = $_POST['column_value_'.$no_scf.'_'.$no_column];

if (!empty($_POST['column_name_'.$no_scf.'_'.$no_column]) && !empty($_POST['column_value_'.$no_scf.'_'.$no_column])) {
if ($_POST['column_name_'.$no_scf.'_'.$no_column] != '' && $_POST['column_value_'.$no_scf.'_'.$no_column] != '') {
// CF
if ($column_key_name == '') {
$data[$column_name] = $column_value;
Expand Down Expand Up @@ -1034,4 +1034,4 @@
}

echo getHTML('footer.php');
?>
?>
9 changes: 9 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,12 @@ table.kcfs a {
table.kcfs a:hover {
text-decoration: underline;
}

#describe_columnfamily_navigation td {
width: 33%;
cursor: pointer;
}

#keyspace_navigation td {
cursor: pointer;
}
8 changes: 4 additions & 4 deletions describe_keyspace.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@
for ($i = 0; $i < $nb_cfs; $i++) {
$one_cf = $describe_keyspace->cf_defs[$i];

$vw_vars['cf_def'] = $one_cf;
$vw_vars['cf_def'] = $one_cf;
$vw_vars['columnfamily_name'] = $one_cf->name;
$vw_vars['show_edit_link'] = true;
$vw_vars['list_column_families'] .= getHTML('columnfamily_details.php',$vw_vars);
$vw_vars['show_edit_link'] = true;
$vw_vars['list_column_families'] .= getHTML('columnfamily_short_details.php',$vw_vars);
}
}

Expand All @@ -96,4 +96,4 @@
}

echo getHTML('footer.php');
?>
?>
5 changes: 2 additions & 3 deletions views/cluster_info.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<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='./'"><a href="./">Schema</a></td>
<td onclick="document.location.href='?nav=cluster'"><a href="?nav=cluster">Cluster</a></td>
</tr>
</table>
Expand All @@ -9,7 +9,7 @@
<?php echo $error_message; ?>

<?php
if ($_GET['nav'] == 'cluster'):
if (isset($_GET['nav']) && $_GET['nav'] == 'cluster'):
?>

<div id="cluster_info" class="well">
Expand Down Expand Up @@ -106,4 +106,3 @@
<ul>
<li><a href="jmx.php">See Stats</a></li>
</ul>

1 change: 1 addition & 0 deletions views/columnfamily_short_details.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<tr><td onclick='document.location.href="describe_columnfamily.php?keyspace_name=<?php echo $keyspace_name; ?>&columnfamily_name=<?php echo $columnfamily_name; ?>"'><a href='describe_columnfamily.php?keyspace_name=<?php echo $keyspace_name; ?>&columnfamily_name=<?php echo $columnfamily_name; ?>'><?php echo $columnfamily_name; ?></a></td></tr>
45 changes: 34 additions & 11 deletions views/describe_columnfamily.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,36 @@
</li>
</ul>

<a href="columnfamily_action.php?action=browse_data&amp;keyspace_name=<?php echo $keyspace_name; ?>&amp;columnfamily_name=<?php echo $columnfamily_name; ?>" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Browse Data</a>
<table id="describe_columnfamily_navigation" class="table table-bordered table-striped">
<tr>
<td onclick="document.location.href='describe_columnfamily.php?keyspace_name=<?php echo $keyspace_name; ?>&amp;columnfamily_name=<?php echo $columnfamily_name; ?>'"><a href="describe_columnfamily.php?keyspace_name=<?php echo $keyspace_name; ?>&amp;columnfamily_name=<?php echo $columnfamily_name; ?>"><?php echo $columnfamily_name; ?></a></td>

<?php if (!$is_read_only_keyspace): ?>
<a href="columnfamily_action.php?action=create_secondary_index&amp;keyspace_name=<?php echo $keyspace_name; ?>&amp;columnfamily_name=<?php echo $columnfamily_name; ?>" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Create Secondary Index</a>
<td onclick="document.location.href='describe_columnfamily.php?view=details&amp;keyspace_name=<?php echo $keyspace_name; ?>&amp;columnfamily_name=<?php echo $columnfamily_name; ?>'"><a href="describe_columnfamily.php?view=details&amp;keyspace_name=<?php echo $keyspace_name; ?>&amp;columnfamily_name=<?php echo $columnfamily_name; ?>">Details</a></td>
<?php endif; ?>
</tr>
</table>

<div class="well">

<?php
if (isset($_GET['view']) && $_GET['view'] == 'details' and !$is_read_only_keyspace):
?>

<a href="columnfamily_action.php?action=edit&amp;keyspace_name=<?php echo $keyspace_name; ?>&amp;columnfamily_name=<?php echo $columnfamily_name; ?>" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Edit Column Family</a>

<a href="#" onclick="return truncateColumnFamily('<?php echo $keyspace_name; ?>','<?php echo $columnfamily_name; ?>');" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Truncate Column Family</a>

<a href="#" onclick="return dropColumnFamily('<?php echo $keyspace_name; ?>','<?php echo $columnfamily_name; ?>');" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Drop Column Family</a>

<h3>Column Family Details</h3>
<?php echo $columnfamily_def; ?>

<?php
else:
?>

<a href="columnfamily_action.php?action=browse_data&amp;keyspace_name=<?php echo $keyspace_name; ?>&amp;columnfamily_name=<?php echo $columnfamily_name; ?>" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Browse Data</a>

<a href="columnfamily_action.php?action=get_key&amp;keyspace_name=<?php echo $keyspace_name; ?>&amp;columnfamily_name=<?php echo $columnfamily_name; ?>" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Get Key</a>

Expand All @@ -27,16 +52,9 @@
<?php endif; ?>

<?php if (!$is_read_only_keyspace): ?>
<a href="columnfamily_action.php?action=edit&amp;keyspace_name=<?php echo $keyspace_name; ?>&amp;columnfamily_name=<?php echo $columnfamily_name; ?>" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Edit Column Family</a>

<a href="#" onclick="return truncateColumnFamily('<?php echo $keyspace_name; ?>','<?php echo $columnfamily_name; ?>');" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Truncate Column Family</a>

<a href="#" onclick="return dropColumnFamily('<?php echo $keyspace_name; ?>','<?php echo $columnfamily_name; ?>');" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Drop Column Family</a>
<a href="columnfamily_action.php?action=create_secondary_index&amp;keyspace_name=<?php echo $keyspace_name; ?>&amp;columnfamily_name=<?php echo $columnfamily_name; ?>" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Create Secondary Index</a>
<?php endif; ?>

<h3>Column Family Details</h3>
<?php echo $columnfamily_def; ?>

<?php if (count($secondary_indexes) > 0): ?>
<h3>Secondary Indexes</h3>

Expand All @@ -47,4 +65,9 @@
'columnfamily_name' => $columnfamily_name));
endforeach;
?>
<?php endif; ?>
<?php
endif;
endif;
?>

</div>
42 changes: 36 additions & 6 deletions views/describe_keyspace.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,30 @@
</li>
</ul>

<table id="describe_columnfamily_navigation" class="table table-bordered table-striped">
<tr>
<td onclick="document.location.href='describe_keyspace.php?keyspace_name=<?php echo $keyspace_name; ?>'"><a href="describe_keyspace.php?keyspace_name=<?php echo $keyspace_name; ?>"><?php echo $keyspace_name; ?></a></td>

<?php if (!$is_read_only_keyspace): ?>
<a href="keyspace_action.php?action=create_cf&amp;keyspace_name=<?php echo $keyspace_name; ?>" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Create New Column Family</a>
<a href="keyspace_action.php?action=edit&amp;keyspace_name=<?php echo $keyspace_name; ?>" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Edit Keyspace</a>
<a href="#" onclick="return dropKeyspace('<?php echo $keyspace_name; ?>');" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Drop Keyspace</a>
<td onclick="document.location.href='describe_keyspace.php?view=details&amp;keyspace_name=<?php echo $keyspace_name; ?>'"><a href="describe_keyspace.php?view=details&amp;keyspace_name=<?php echo $keyspace_name; ?>">Details</a></td>
<?php endif; ?>
</tr>
</table>

<div class="well">

<?php echo $added_cf; ?>
<?php echo $deleted_cf; ?>

<?php
if (isset($_GET['view']) && $_GET['view'] == 'details'):
?>

<?php if (!$is_read_only_keyspace): ?>
<a href="keyspace_action.php?action=edit&amp;keyspace_name=<?php echo $keyspace_name; ?>" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Edit Keyspace</a>
<a href="#" onclick="return dropKeyspace('<?php echo $keyspace_name; ?>');" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Drop Keyspace</a>
<?php endif; ?>

<h3>Keyspace Details</h3>
<div>
<table>
Expand All @@ -43,9 +57,6 @@
</table>
</div>

<h3>List of Column Families in Keyspace</h3>
<?php echo $list_column_families; ?>

<h3>Ring</h3>

<?php
Expand All @@ -63,3 +74,22 @@
}

?>

<?php
else:
?>

<?php if (!$is_read_only_keyspace): ?>
<a href="keyspace_action.php?action=create_cf&amp;keyspace_name=<?php echo $keyspace_name; ?>" class="btn btn-large btn-primary" style="color: #fff; text-decoration: none;">Create New Column Family</a>
<?php endif; ?>

<h3>Column Families in Keyspace <?php echo $keyspace_name; ?></h3>
<table id="keyspace_navigation" class="cluster_status table table-bordered table-striped">
<?php echo $list_column_families; ?>
</table>

<?php
endif;
?>

</div>

0 comments on commit d6d63a6

Please sign in to comment.