Skip to content
This repository
Browse code

Better page titles

  • Loading branch information...
commit 1bff5def047bfd853519f465432fdb8b9ea7b46e 1 parent 2b7fd3e
Sébastien Giroux authored
1  cluster_info.php
@@ -12,6 +12,7 @@
12 12 $vw_vars['partitioner'] = $sys_manager->describe_partitioner();
13 13 $vw_vars['snitch'] = $sys_manager->describe_snitch();
14 14 $vw_vars['thrift_api_version'] = $sys_manager->describe_version();
  15 + $vw_vars['schema_version'] = $sys_manager->describe_schema_versions();
15 16
16 17 $keyspaces = $sys_manager->describe_keyspaces();
17 18 $keyspaces_name = array();
44 columnfamily_action.php
@@ -96,6 +96,8 @@
96 96
97 97 $cf = getCFInKeyspace($keyspace_name,$columnfamily_name);
98 98
  99 + $current_page_title = 'Cassandra Cluster Admin > '.$keyspace_name.' > '.$columnfamily_name.' > Edit Column Family';
  100 +
99 101 $included_header = true;
100 102 echo getHTML('header.php');
101 103
@@ -147,6 +149,8 @@
147 149 $columnfamily_name = $_GET['columnfamily_name'];
148 150 }
149 151
  152 + $current_page_title = 'Cassandra Cluster Admin > '.$keyspace_name.' > '.$columnfamily_name.' > Drop Column Family';
  153 +
150 154 $included_header = true;
151 155 echo getHTML('header.php');
152 156
@@ -216,6 +220,8 @@
216 220 if (!isset($vw_vars['error_message'])) $vw_vars['error_message'] = '';
217 221
218 222 $included_header = true;
  223 + $current_page_title = 'Cassandra Cluster Admin > '.$keyspace_name.' > '.$columnfamily_name.' > Create Secondary Index';
  224 +
219 225 echo getHTML('header.php');
220 226 echo getHTML('create_edit_secondary_index.php',$vw_vars);
221 227 }
@@ -236,13 +242,15 @@
236 242 if (isset($_GET['columnfamily_name'])) {
237 243 $columnfamily_name = $_GET['columnfamily_name'];
238 244 }
239   -
240   - $pool = new ConnectionPool($keyspace_name, $CASSANDRA_SERVERS);
241   - $column_family = new ColumnFamily($pool, $columnfamily_name);
242 245
243   - $vw_vars['results'] = '';
244   -
245   - try {
  246 + $cf = getCFInKeyspace($keyspace_name,$columnfamily_name);
  247 +
  248 + try {
  249 + $pool = new ConnectionPool($keyspace_name, $CASSANDRA_SERVERS);
  250 + $column_family = new ColumnFamily($pool, $columnfamily_name);
  251 +
  252 + $vw_vars['results'] = '';
  253 +
246 254 $output = $column_family->get($key);
247 255
248 256 $vw_row_vars['key'] = $key;
@@ -296,6 +304,8 @@
296 304 if (!isset($vw_vars['success_message'])) $vw_vars['success_message'] = '';
297 305 if (!isset($vw_vars['error_message'])) $vw_vars['error_message'] = '';
298 306
  307 + $current_page_title = 'Cassandra Cluster Admin > '.$keyspace_name.' > '.$columnfamily_name.' > Get Key';
  308 +
299 309 $included_header = true;
300 310 echo getHTML('header.php');
301 311 echo getHTML('columnfamily_getkey.php',$vw_vars);
@@ -421,6 +431,8 @@
421 431 $vw_vars['mode'] = 'insert';
422 432 $vw_vars['super_key'] = '';
423 433
  434 + $current_page_title = 'Cassandra Cluster Admin > '.$keyspace_name.' > '.$columnfamily_name.' > Insert a Row';
  435 +
424 436 $included_header = true;
425 437 echo getHTML('header.php');
426 438 echo getHTML('columnfamily_insert_edit_row.php',$vw_vars);
@@ -564,6 +576,8 @@
564 576 $vw_vars['show_next_page_link'] = false;
565 577 }
566 578
  579 + $current_page_title = 'Cassandra Cluster Admin > '.$keyspace_name.' > '.$columnfamily_name.' > Browse Data';
  580 +
567 581 $included_header = true;
568 582 echo getHTML('header.php');
569 583 echo getHTML('columnfamily_browse_data.php',$vw_vars);
@@ -618,13 +632,13 @@
618 632
619 633 $vw_vars['mode'] = 'edit';
620 634
621   - $pool = new ConnectionPool($keyspace_name, $CASSANDRA_SERVERS);
622   - $column_family = new ColumnFamily($pool, $columnfamily_name);
623   -
624   - $vw_vars['results'] = '';
625   - $vw_vars['output'] = '';
626   -
627   - try {
  635 + try {
  636 + $pool = new ConnectionPool($keyspace_name, $CASSANDRA_SERVERS);
  637 + $column_family = new ColumnFamily($pool, $columnfamily_name);
  638 +
  639 + $vw_vars['results'] = '';
  640 + $vw_vars['output'] = '';
  641 +
628 642 $output = $column_family->get($key);
629 643 $vw_vars['output'] = $output;
630 644 }
@@ -632,6 +646,8 @@
632 646 echo 'Something went wrong '.$e->getMessage();
633 647 }
634 648
  649 + $current_page_title = 'Cassandra Cluster Admin > '.$keyspace_name.' > '.$columnfamily_name.' > Edit Row';
  650 +
635 651 $included_header = true;
636 652 echo getHTML('header.php');
637 653 echo getHTML('columnfamily_insert_edit_row.php',$vw_vars);
@@ -669,7 +685,7 @@
669 685 catch (cassandra_NotFoundException $e) {
670 686 echo displayErrorMessage('columnfamily_doesnt_exists',array('column_name' => $columnfamily_name));
671 687 }
672   - catch(Exception $e) {
  688 + catch (Exception $e) {
673 689 echo 'Something wrong happened '.$e->getMessage();
674 690 }
675 691 }
20 describe_columnfamily.php
@@ -7,24 +7,28 @@
7 7 */
8 8
9 9 require('include/kernel.inc.php');
10   - require('include/verify_login.inc.php');
11   -
12   - echo getHTML('header.php');
13   -
  10 + require('include/verify_login.inc.php');
  11 +
14 12 $keyspace_name = '';
15 13 if (isset($_GET['keyspace_name'])) {
16 14 $keyspace_name = $_GET['keyspace_name'];
17 15 }
18 16
  17 + $columnfamily_name = '';
  18 + if (isset($_GET['columnfamily_name'])) {
  19 + $columnfamily_name = $_GET['columnfamily_name'];
  20 + }
  21 +
  22 + $current_page_title = 'Cassandra Cluster Admin > Column Family Details > '.$keyspace_name.' > '.$columnfamily_name;
  23 +
  24 + echo getHTML('header.php');
  25 +
19 26 // Make sure a keyspace name has been specified
20 27 if ($keyspace_name == '') {
21 28 echo displayErrorMessage('keyspace_name_must_be_specified');
22 29 }
23 30 else {
24   - $columnfamily_name = '';
25   - if (isset($_GET['columnfamily_name'])) {
26   - $columnfamily_name = $_GET['columnfamily_name'];
27   - }
  31 +
28 32
29 33 if ($columnfamily_name == '') {
30 34 echo displayErrorMessage('columnfamily_name_must_be_specified');
9 describe_keyspace.php
@@ -9,15 +9,16 @@
9 9 require('include/kernel.inc.php');
10 10 require('include/verify_login.inc.php');
11 11
12   - echo getHTML('header.php');
13   -
14   - $vw_vars = array();
15   -
16 12 $keyspace_name = '';
17 13 if (isset($_GET['keyspace_name'])) {
18 14 $keyspace_name = $_GET['keyspace_name'];
19 15 }
20 16
  17 + $current_page_title = 'Cassandra Cluster Admin > Keyspace Details > '.$keyspace_name;
  18 + echo getHTML('header.php');
  19 +
  20 + $vw_vars = array();
  21 +
21 22 if ($keyspace_name == '') {
22 23 echo displayErrorMessage('keyspace_name_must_be_specified');
23 24 }
8 include/kernel.inc.php
@@ -193,5 +193,13 @@ function displaySCFRow($row) {
193 193 return $output;
194 194 }
195 195
  196 + $current_page_title = 'Cassandra Cluster Admin';
  197 +
  198 + function getPageTitle() {
  199 + global $current_page_title;
  200 +
  201 + return $current_page_title;
  202 + }
  203 +
196 204 session_start();
197 205 ?>
8 keyspace_action.php
@@ -133,6 +133,9 @@
133 133 if (!isset($vw_vars['error_message'])) $vw_vars['error_message'] = '';
134 134
135 135 $included_header = true;
  136 +
  137 + $current_page_title = 'Cassandra Cluster Admin > '.$keyspace_name.' > Create Column Family';
  138 +
136 139 echo getHTML('header.php');
137 140 echo getHTML('create_edit_columnfamily.php',$vw_vars);
138 141 }
@@ -174,6 +177,9 @@
174 177 if (!isset($vw_vars['error_message'])) $vw_vars['error_message'] = '';
175 178
176 179 $included_header = true;
  180 +
  181 + $current_page_title = 'Cassandra Cluster Admin > Create Keyspace';
  182 +
177 183 echo getHTML('header.php');
178 184 echo getHTML('create_edit_keyspace.php',$vw_vars);
179 185 }
@@ -225,6 +231,8 @@
225 231 $keyspace_name = $_GET['keyspace_name'];
226 232 }
227 233
  234 + $current_page_title = 'Cassandra Cluster Admin > Edit Keyspace '.$keyspace_name;
  235 +
228 236 $included_header = true;
229 237 echo getHTML('header.php');
230 238
2  login.php
@@ -38,6 +38,8 @@
38 38 $vw_vars['you_must_be_logged'] = displayErrorMessage('you_must_be_logged');
39 39 }
40 40
  41 + $current_page_title = 'Cassandra Cluster Admin > Login';
  42 +
41 43 echo getHTML('header.php');
42 44 echo getHTML('login.php',$vw_vars);
43 45 echo getHTML('footer.php');
10 views/cluster_info.php
@@ -3,7 +3,15 @@
3 3
4 4 Cluster Partitioner: <?=$partitioner;?><br />
5 5 Cluster Snitch: <?=$snitch;?><br />
6   - Thrift API Version: <?=$thrift_api_version?>
  6 + Thrift API Version: <?=$thrift_api_version?><br />
  7 + Schema Version:
  8 + <?php
  9 + foreach ($schema_version as $version => $servers) {
  10 + foreach ($servers as $one_server) {
  11 + echo $version.' ';
  12 + }
  13 + }
  14 + ?>
7 15 </div>
8 16
9 17 <?=$success_message?>
2  views/header.php
@@ -4,7 +4,7 @@
4 4 <head>
5 5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6 6
7   - <title>Cassandra Cluster Admin</title>
  7 + <title><?=getPageTitle();?></title>
8 8
9 9 <meta name="title" content="Cassandra Cluster Admin" />
10 10 <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.
Something went wrong with that request. Please try again.