Permalink
Browse files

Better page titles

  • Loading branch information...
1 parent 2b7fd3e commit 1bff5def047bfd853519f465432fdb8b9ea7b46e @sebgiroux committed Jul 9, 2011
Showing with 76 additions and 28 deletions.
  1. +1 −0 cluster_info.php
  2. +30 −14 columnfamily_action.php
  3. +12 −8 describe_columnfamily.php
  4. +5 −4 describe_keyspace.php
  5. +8 −0 include/kernel.inc.php
  6. +8 −0 keyspace_action.php
  7. +2 −0 login.php
  8. +9 −1 views/cluster_info.php
  9. +1 −1 views/header.php
View
1 cluster_info.php
@@ -12,6 +12,7 @@
$vw_vars['partitioner'] = $sys_manager->describe_partitioner();
$vw_vars['snitch'] = $sys_manager->describe_snitch();
$vw_vars['thrift_api_version'] = $sys_manager->describe_version();
+ $vw_vars['schema_version'] = $sys_manager->describe_schema_versions();
$keyspaces = $sys_manager->describe_keyspaces();
$keyspaces_name = array();
View
44 columnfamily_action.php
@@ -96,6 +96,8 @@
$cf = getCFInKeyspace($keyspace_name,$columnfamily_name);
+ $current_page_title = 'Cassandra Cluster Admin > '.$keyspace_name.' > '.$columnfamily_name.' > Edit Column Family';
+
$included_header = true;
echo getHTML('header.php');
@@ -147,6 +149,8 @@
$columnfamily_name = $_GET['columnfamily_name'];
}
+ $current_page_title = 'Cassandra Cluster Admin > '.$keyspace_name.' > '.$columnfamily_name.' > Drop Column Family';
+
$included_header = true;
echo getHTML('header.php');
@@ -216,6 +220,8 @@
if (!isset($vw_vars['error_message'])) $vw_vars['error_message'] = '';
$included_header = true;
+ $current_page_title = 'Cassandra Cluster Admin > '.$keyspace_name.' > '.$columnfamily_name.' > Create Secondary Index';
+
echo getHTML('header.php');
echo getHTML('create_edit_secondary_index.php',$vw_vars);
}
@@ -236,13 +242,15 @@
if (isset($_GET['columnfamily_name'])) {
$columnfamily_name = $_GET['columnfamily_name'];
}
-
- $pool = new ConnectionPool($keyspace_name, $CASSANDRA_SERVERS);
- $column_family = new ColumnFamily($pool, $columnfamily_name);
- $vw_vars['results'] = '';
-
- try {
+ $cf = getCFInKeyspace($keyspace_name,$columnfamily_name);
+
+ try {
+ $pool = new ConnectionPool($keyspace_name, $CASSANDRA_SERVERS);
+ $column_family = new ColumnFamily($pool, $columnfamily_name);
+
+ $vw_vars['results'] = '';
+
$output = $column_family->get($key);
$vw_row_vars['key'] = $key;
@@ -296,6 +304,8 @@
if (!isset($vw_vars['success_message'])) $vw_vars['success_message'] = '';
if (!isset($vw_vars['error_message'])) $vw_vars['error_message'] = '';
+ $current_page_title = 'Cassandra Cluster Admin > '.$keyspace_name.' > '.$columnfamily_name.' > Get Key';
+
$included_header = true;
echo getHTML('header.php');
echo getHTML('columnfamily_getkey.php',$vw_vars);
@@ -421,6 +431,8 @@
$vw_vars['mode'] = 'insert';
$vw_vars['super_key'] = '';
+ $current_page_title = 'Cassandra Cluster Admin > '.$keyspace_name.' > '.$columnfamily_name.' > Insert a Row';
+
$included_header = true;
echo getHTML('header.php');
echo getHTML('columnfamily_insert_edit_row.php',$vw_vars);
@@ -564,6 +576,8 @@
$vw_vars['show_next_page_link'] = false;
}
+ $current_page_title = 'Cassandra Cluster Admin > '.$keyspace_name.' > '.$columnfamily_name.' > Browse Data';
+
$included_header = true;
echo getHTML('header.php');
echo getHTML('columnfamily_browse_data.php',$vw_vars);
@@ -618,20 +632,22 @@
$vw_vars['mode'] = 'edit';
- $pool = new ConnectionPool($keyspace_name, $CASSANDRA_SERVERS);
- $column_family = new ColumnFamily($pool, $columnfamily_name);
-
- $vw_vars['results'] = '';
- $vw_vars['output'] = '';
-
- try {
+ try {
+ $pool = new ConnectionPool($keyspace_name, $CASSANDRA_SERVERS);
+ $column_family = new ColumnFamily($pool, $columnfamily_name);
+
+ $vw_vars['results'] = '';
+ $vw_vars['output'] = '';
+
$output = $column_family->get($key);
$vw_vars['output'] = $output;
}
catch(Exception $e) {
echo 'Something went wrong '.$e->getMessage();
}
+ $current_page_title = 'Cassandra Cluster Admin > '.$keyspace_name.' > '.$columnfamily_name.' > Edit Row';
+
$included_header = true;
echo getHTML('header.php');
echo getHTML('columnfamily_insert_edit_row.php',$vw_vars);
@@ -669,7 +685,7 @@
catch (cassandra_NotFoundException $e) {
echo displayErrorMessage('columnfamily_doesnt_exists',array('column_name' => $columnfamily_name));
}
- catch(Exception $e) {
+ catch (Exception $e) {
echo 'Something wrong happened '.$e->getMessage();
}
}
View
20 describe_columnfamily.php
@@ -7,24 +7,28 @@
*/
require('include/kernel.inc.php');
- require('include/verify_login.inc.php');
-
- echo getHTML('header.php');
-
+ require('include/verify_login.inc.php');
+
$keyspace_name = '';
if (isset($_GET['keyspace_name'])) {
$keyspace_name = $_GET['keyspace_name'];
}
+ $columnfamily_name = '';
+ if (isset($_GET['columnfamily_name'])) {
+ $columnfamily_name = $_GET['columnfamily_name'];
+ }
+
+ $current_page_title = 'Cassandra Cluster Admin > Column Family Details > '.$keyspace_name.' > '.$columnfamily_name;
+
+ echo getHTML('header.php');
+
// Make sure a keyspace name has been specified
if ($keyspace_name == '') {
echo displayErrorMessage('keyspace_name_must_be_specified');
}
else {
- $columnfamily_name = '';
- if (isset($_GET['columnfamily_name'])) {
- $columnfamily_name = $_GET['columnfamily_name'];
- }
+
if ($columnfamily_name == '') {
echo displayErrorMessage('columnfamily_name_must_be_specified');
View
9 describe_keyspace.php
@@ -9,15 +9,16 @@
require('include/kernel.inc.php');
require('include/verify_login.inc.php');
- echo getHTML('header.php');
-
- $vw_vars = array();
-
$keyspace_name = '';
if (isset($_GET['keyspace_name'])) {
$keyspace_name = $_GET['keyspace_name'];
}
+ $current_page_title = 'Cassandra Cluster Admin > Keyspace Details > '.$keyspace_name;
+ echo getHTML('header.php');
+
+ $vw_vars = array();
+
if ($keyspace_name == '') {
echo displayErrorMessage('keyspace_name_must_be_specified');
}
View
8 include/kernel.inc.php
@@ -193,5 +193,13 @@ function displaySCFRow($row) {
return $output;
}
+ $current_page_title = 'Cassandra Cluster Admin';
+
+ function getPageTitle() {
+ global $current_page_title;
+
+ return $current_page_title;
+ }
+
session_start();
?>
View
8 keyspace_action.php
@@ -133,6 +133,9 @@
if (!isset($vw_vars['error_message'])) $vw_vars['error_message'] = '';
$included_header = true;
+
+ $current_page_title = 'Cassandra Cluster Admin > '.$keyspace_name.' > Create Column Family';
+
echo getHTML('header.php');
echo getHTML('create_edit_columnfamily.php',$vw_vars);
}
@@ -174,6 +177,9 @@
if (!isset($vw_vars['error_message'])) $vw_vars['error_message'] = '';
$included_header = true;
+
+ $current_page_title = 'Cassandra Cluster Admin > Create Keyspace';
+
echo getHTML('header.php');
echo getHTML('create_edit_keyspace.php',$vw_vars);
}
@@ -225,6 +231,8 @@
$keyspace_name = $_GET['keyspace_name'];
}
+ $current_page_title = 'Cassandra Cluster Admin > Edit Keyspace '.$keyspace_name;
+
$included_header = true;
echo getHTML('header.php');
View
2 login.php
@@ -38,6 +38,8 @@
$vw_vars['you_must_be_logged'] = displayErrorMessage('you_must_be_logged');
}
+ $current_page_title = 'Cassandra Cluster Admin > Login';
+
echo getHTML('header.php');
echo getHTML('login.php',$vw_vars);
echo getHTML('footer.php');
View
10 views/cluster_info.php
@@ -3,7 +3,15 @@
Cluster Partitioner: <?=$partitioner;?><br />
Cluster Snitch: <?=$snitch;?><br />
- Thrift API Version: <?=$thrift_api_version?>
+ Thrift API Version: <?=$thrift_api_version?><br />
+ Schema Version:
+ <?php
+ foreach ($schema_version as $version => $servers) {
+ foreach ($servers as $one_server) {
+ echo $version.' ';
+ }
+ }
+ ?>
</div>
<?=$success_message?>
View
2 views/header.php
@@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <title>Cassandra Cluster Admin</title>
+ <title><?=getPageTitle();?></title>
<meta name="title" content="Cassandra Cluster Admin" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>

0 comments on commit 1bff5de

Please sign in to comment.