incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cr...@apache.org
Subject [4/4] git commit: Added the delete table logic and view schema views
Date Wed, 26 Mar 2014 22:31:08 GMT
Added the delete table logic and view schema views


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/ef5f913b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/ef5f913b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/ef5f913b

Branch: refs/heads/console-v2
Commit: ef5f913b4d44a9090f4292284677dc3e39b7a7f5
Parents: 5f50468
Author: Chris Rohr <crohr@nearinfinity.com>
Authored: Wed Mar 26 18:30:54 2014 -0400
Committer: Chris Rohr <crohr@nearinfinity.com>
Committed: Wed Mar 26 18:30:54 2014 -0400

----------------------------------------------------------------------
 contrib/blur-console/ui/app/index.html          |  26 +--
 .../ui/app/scripts/blurconsole.b_utils.js       |  63 ++++++-
 .../ui/app/scripts/blurconsole.fake.js          | 116 ++++++++++--
 .../ui/app/scripts/blurconsole.model.js         |  41 ++++-
 .../ui/app/scripts/blurconsole.schema.js        | 175 +++++++++++++++++++
 .../ui/app/scripts/blurconsole.shell.js         |  10 +-
 .../ui/app/scripts/blurconsole.tables.js        |  80 ++++++++-
 .../ui/app/styles/blurconsole.schema.scss       |  20 +++
 .../blur-console/ui/app/styles/blurconsole.scss |   8 +-
 9 files changed, 496 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/ef5f913b/contrib/blur-console/ui/app/index.html
----------------------------------------------------------------------
diff --git a/contrib/blur-console/ui/app/index.html b/contrib/blur-console/ui/app/index.html
index 0591ace..c9fc093 100644
--- a/contrib/blur-console/ui/app/index.html
+++ b/contrib/blur-console/ui/app/index.html
@@ -33,6 +33,7 @@ limitations under the License.
         <!-- build:css(.tmp) styles/main.css -->
         <link rel="stylesheet" href="styles/blurconsole.css">
         <link rel="stylesheet" href="styles/blurconsole.dashboard.css">
+        <link rel="stylesheet" href="styles/blurconsole.schema.css">
         <!-- endbuild -->
         <script src="bower_components/modernizr/modernizr.js"></script>
 
@@ -73,18 +74,18 @@ limitations under the License.
         <!-- endbuild -->
 
         <!-- build:js scripts/plugins.js -->
-        <script src="bower_components/sass-bootstrap/js/affix.js"></script>
-        <script src="bower_components/sass-bootstrap/js/alert.js"></script>
-        <script src="bower_components/sass-bootstrap/js/dropdown.js"></script>
-        <script src="bower_components/sass-bootstrap/js/tooltip.js"></script>
-        <script src="bower_components/sass-bootstrap/js/modal.js"></script>
-        <script src="bower_components/sass-bootstrap/js/transition.js"></script>
-        <script src="bower_components/sass-bootstrap/js/button.js"></script>
-        <script src="bower_components/sass-bootstrap/js/popover.js"></script>
-        <script src="bower_components/sass-bootstrap/js/carousel.js"></script>
-        <script src="bower_components/sass-bootstrap/js/scrollspy.js"></script>
-        <script src="bower_components/sass-bootstrap/js/collapse.js"></script>
-        <script src="bower_components/sass-bootstrap/js/tab.js"></script>
+        <script src="bower_components/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/affix.js"></script>
+        <script src="bower_components/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/alert.js"></script>
+        <script src="bower_components/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/dropdown.js"></script>
+        <script src="bower_components/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/tooltip.js"></script>
+        <script src="bower_components/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/modal.js"></script>
+        <script src="bower_components/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/transition.js"></script>
+        <script src="bower_components/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/button.js"></script>
+        <script src="bower_components/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/popover.js"></script>
+        <script src="bower_components/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/carousel.js"></script>
+        <script src="bower_components/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/scrollspy.js"></script>
+        <script src="bower_components/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/collapse.js"></script>
+        <script src="bower_components/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/tab.js"></script>
         <script src="bower_components/flot/jquery.flot.js"></script>
         <script src="bower_components/flot/jquery.flot.pie.js"></script>
         <script src="bower_components/flot/jquery.flot.categories.js"></script>
@@ -98,6 +99,7 @@ limitations under the License.
         <script src="scripts/blurconsole.shell.js"></script>
         <script src="scripts/blurconsole.dashboard.js"></script>
         <script src="scripts/blurconsole.tables.js"></script>
+        <script src="scripts/blurconsole.schema.js"></script>
         <script src="scripts/blurconsole.data.js"></script>
         <script src="scripts/blurconsole.fake.js"></script>
         <script src="scripts/blurconsole.model.js"></script>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/ef5f913b/contrib/blur-console/ui/app/scripts/blurconsole.b_utils.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/ui/app/scripts/blurconsole.b_utils.js b/contrib/blur-console/ui/app/scripts/blurconsole.b_utils.js
index 5f98e4e..ef65821 100644
--- a/contrib/blur-console/ui/app/scripts/blurconsole.b_utils.js
+++ b/contrib/blur-console/ui/app/scripts/blurconsole.b_utils.js
@@ -15,7 +15,7 @@ limitations under the License.
 /*global blurconsole:false */
 blurconsole.browserUtils = (function(){
 	'use strict';
-	var table;
+	var table, modal, cleanId, booleanImg;
 
 	table = function(def, data) {
 		var tableMarkup;
@@ -52,7 +52,66 @@ blurconsole.browserUtils = (function(){
 		return tableMarkup;
 	};
 
+	modal = function(id, title, content, buttons, size) {
+		var mSize, markup, mButtons = buttons;
+
+		switch(size) {
+			case 'large':
+				mSize = 'modal-lg';
+				break;
+			case 'medium':
+				mSize = 'modal-md';
+				break;
+			default:
+				mSize = 'modal-sm';
+		}
+
+		markup = '<div class="modal fade" id="' + id + '">';
+		markup += '<div class="modal-dialog ' + mSize + '">';
+		markup += '<div class="modal-content">';
+		markup += '<div class="modal-header"><button type="button" class="close" data-dismiss="modal">&times;</button><h4
class="modal-title">' + title + '</h4></div>';
+		markup += '<div class="modal-body">' + ($.type(content) === 'string' ? content :
$(content).html()) + '</div>';
+
+		if (mButtons) {
+			if (!$.isArray(mButtons)) {
+				mButtons = [mButtons];
+			}
+
+			markup += '<div class="modal-footer">';
+			$.each(mButtons, function(i, button) {
+				markup += '<button type="button" class="btn ' + button.classes + '" id="' + button.id
+ '" ';
+
+				if (button.data) {
+					$.each(button.data, function(key, dataAttr) {
+						markup += 'data-' + key + '="' + dataAttr + '" ';
+					});
+				}
+				
+				markup += '>' + button.label + '</button> ';
+			});
+			markup += '</div>';
+		}
+
+		markup += '</div></div></div>';
+
+		return markup;
+	};
+
+	cleanId = function(str) {
+		return str.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1');
+	};
+
+	booleanImg = function(val) {
+		if (val && (val === true || val === 'yes' || val === 'true')) {
+			return '<div class="label label-success"><i class="glyphicon glyphicon-ok-sign"></i></div>';
+		}
+		return '<div class="label label-danger"><i class="glyphicon glyphicon-minus-sign"></i></div>';
+	};
+
 	return {
-		table: table
+		table: table,
+		modal : modal,
+		cleanId : cleanId,
+		booleanImg : booleanImg
 	};
 }());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/ef5f913b/contrib/blur-console/ui/app/scripts/blurconsole.fake.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/ui/app/scripts/blurconsole.fake.js b/contrib/blur-console/ui/app/scripts/blurconsole.fake.js
index 2e90bd5..2719004 100644
--- a/contrib/blur-console/ui/app/scripts/blurconsole.fake.js
+++ b/contrib/blur-console/ui/app/scripts/blurconsole.fake.js
@@ -15,16 +15,18 @@ limitations under the License.
 /*global blurconsole:false */
 blurconsole.fake = (function() {
 	'use strict';
-	var getTableList, getNodeList, getQueryPerformance, getQueries;
+	var getTableList, getNodeList, getQueryPerformance, getQueries, disableTable, enableTable,
deleteTable, getSchema, findTerms,
+		randomNumber, randomBoolean, randomString;
 
 	getTableList = function() {
+		console.log('getting fake table list');
 		var clusters = ['prodA', 'prodB'], data = [], i, cluster, rows, records, enabled;
 
 		for (i = 0; i < 5; i++) {
-			cluster = clusters[Math.floor(Math.random()*2)];
-			rows = Math.floor(Math.random()*1000+1);
-			records = Math.floor(Math.random()*10000+1001);
-			enabled = Math.floor(Math.random()*2) === 1;
+			cluster = clusters[randomNumber(2, true)];
+			rows = randomNumber(1000);
+			records = randomNumber(10000)+1000;
+			enabled = randomBoolean();
 
 			data.push({cluster:cluster, name:'testtable'+i, enabled:enabled, rows:rows, records:records});
 
@@ -33,14 +35,15 @@ blurconsole.fake = (function() {
 	};
 
 	getNodeList = function() {
+		console.log('getting fake node list');
 		var controllers = {online:[], offline:[]},
 			clusters = [{name:'prodA', online:[], offline:[]}, {name:'prodB', online:[], offline:[]}],
 			zookeepers = {online: [], offline:[]},
 			i, state;
 
 		for(i = 0; i < 3; i++) {
-			state = Math.floor(Math.random()*2);
-			if (state === 0) {
+			state = randomBoolean();
+			if (state) {
 				controllers.online.push('controller' + i + '.localhost');
 				clusters[0].online.push('prodA.shard' + i + '.localhost');
 				clusters[1].online.push('prodB.shard' + i + '.localhost');
@@ -56,19 +59,112 @@ blurconsole.fake = (function() {
 	};
 
 	getQueryPerformance = function() {
-		return Math.floor((Math.random()*1000) + 1);
+		console.log('getting fake query performance');
+		return randomNumber(1000);
 	};
 
 	getQueries = function() {
+		console.log('getting fake queries');
 		return {
-			slowQueries : Math.floor((Math.random()*100) + 1) % 10 === 0
+			slowQueries : randomNumber(100) % 10 === 0
 		};
 	};
 
+	disableTable = function(table) {
+		console.log('Fake sending request to disable table [' + table + ']');
+	};
+
+	enableTable = function(table) {
+		console.log('Fake sending request to enable table [' + table + ']');
+	};
+
+	deleteTable = function(table, includeFiles) {
+		console.log('Fake sending request to delete table [' + table + '] with files [' + includeFiles
+ ']');
+	};
+
+	getSchema = function(table) {
+		console.log('getting fake schema for table [' + table + ']');
+		var f, schema = {}, familyCount = randomNumber(20), types = ['string', 'long', 'int', 'date',
'stored', 'customType'];
+
+		for(f=0; f < familyCount; f++) {
+			var c, fam = {}, columnCount = randomNumber(30);
+			for(c=0; c < columnCount; c++) {
+				fam['col'+c] = {
+					'fieldLess' : randomBoolean(),
+					'type' : types[randomNumber(6, true)],
+					'extra' : null
+				};
+
+				if (randomBoolean()) {
+					var e, extraPropCount = randomNumber(3), props = {};
+					for (e=0; e < extraPropCount; e++) {
+						props['extra'+e] = 'val'+e;
+					}
+					fam['col'+c].extra = props;
+				}
+			}
+			schema['fam'+f] = fam;
+		}
+
+		return schema;
+	};
+
+	findTerms = function(table, family, column, startsWith, callback) {
+		console.log('getting fake terms from [' + table + '] for family [' + family + '] and column
[' + column + '] starting with [' + startsWith + ']');
+
+		var terms = [];
+
+		for (var i = 0; i < 10; i++) {
+			var randStr = randomString();
+			if (startsWith) {
+				randStr = startsWith + randStr;
+			}
+			terms.push(randStr);
+		}
+
+		console.log(terms.length);
+
+		terms = terms.sort(function (a, b) {
+			return a.toLowerCase().localeCompare(b.toLowerCase());
+		});
+
+		callback(terms);
+	};
+
+	randomNumber = function(max, includeZero) {
+		var random = Math.random()*max;
+
+		if (!includeZero) {
+			random++;
+		}
+
+		return Math.floor(random);
+	};
+
+	randomBoolean = function() {
+		return randomNumber(2) % 2 === 0;
+	};
+
+	randomString = function() {
+		var text = '';
+		var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
+
+		for( var i=0; i < Math.floor(Math.random() * 30 + 1); i++ ) {
+			text += possible.charAt(Math.floor(Math.random() * possible.length));
+		}
+
+		return text;
+	};
+
 	return {
 		getTableList : getTableList,
 		getNodeList : getNodeList,
 		getQueryPerformance : getQueryPerformance,
-		getQueries : getQueries
+		getQueries : getQueries,
+		disableTable : disableTable,
+		enableTable : enableTable,
+		deleteTable : deleteTable,
+		getSchema : getSchema,
+		findTerms : findTerms
 	};
 }());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/ef5f913b/contrib/blur-console/ui/app/scripts/blurconsole.model.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/ui/app/scripts/blurconsole.model.js b/contrib/blur-console/ui/app/scripts/blurconsole.model.js
index 834a5dc..e36266e 100644
--- a/contrib/blur-console/ui/app/scripts/blurconsole.model.js
+++ b/contrib/blur-console/ui/app/scripts/blurconsole.model.js
@@ -29,13 +29,13 @@ blurconsole.model = (function() {
 		tables, metrics, nodes, initModule, nodePoller, tablePoller, queryPerformancePoller, queryPoller;
 
 	tables = (function() {
-		var getClusters, getEnabledTables, getDisabledTables, isDataLoaded;
+		var getClusters, getEnabledTables, getDisabledTables, isDataLoaded, disableTable, enableTable,
deleteTable, getSchema, findTerms;
 
 		getClusters = function() {
-			if (stateMap.tableNameMap == null) {
+			if (stateMap.tableNameMap === null) {
 				return [];
 			}
-			
+
 			return blurconsole.utils.unique($.map(stateMap.tableNameMap, function(table){
 				return table.cluster;
 			}), true);
@@ -66,14 +66,41 @@ blurconsole.model = (function() {
 		};
 
 		isDataLoaded = function() {
-			return stateMap.tableNameMap != null;
+			return stateMap.tableNameMap !== null;
+		};
+
+		disableTable = function(tableName) {
+			configMap.poller.disableTable(tableName);
+		};
+
+		enableTable = function(tableName) {
+			configMap.poller.enableTable(tableName);
+		};
+
+		deleteTable = function(tableName, includeFiles) {
+			configMap.poller.deleteTable(tableName, includeFiles);
+		};
+
+		getSchema = function(tableName) {
+			return configMap.poller.getSchema(tableName);
+		};
+
+		findTerms = function(table, family, column, startsWith) {
+			configMap.poller.findTerms(table, family, column, startsWith, function(terms) {
+				$.gevent.publish('terms-updated', terms);
+			});
 		};
 
 		return {
 			getClusters : getClusters,
 			getEnabledTables : getEnabledTables,
 			getDisabledTables : getDisabledTables,
-			isDataLoaded : isDataLoaded
+			isDataLoaded : isDataLoaded,
+			disableTable : disableTable,
+			enableTable : enableTable,
+			deleteTable : deleteTable,
+			getSchema : getSchema,
+			findTerms : findTerms
 		};
 	}());
 
@@ -100,7 +127,7 @@ blurconsole.model = (function() {
 		};
 
 		isDataLoaded = function() {
-			return stateMap.nodeMap != null;
+			return stateMap.nodeMap !== null;
 		};
 
 		return {
@@ -271,7 +298,7 @@ blurconsole.model = (function() {
 
 		stateMap.queryPerformance.push(configMap.poller.getQueryPerformance());
 		$.gevent.publish('query-perf-updated');
-		setTimeout(queryPerformancePoller, 1000);
+		setTimeout(queryPerformancePoller, 5000);
 	};
 
 	queryPoller = function() {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/ef5f913b/contrib/blur-console/ui/app/scripts/blurconsole.schema.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/ui/app/scripts/blurconsole.schema.js b/contrib/blur-console/ui/app/scripts/blurconsole.schema.js
new file mode 100644
index 0000000..e270cca
--- /dev/null
+++ b/contrib/blur-console/ui/app/scripts/blurconsole.schema.js
@@ -0,0 +1,175 @@
+/*
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+/*jshint laxbreak: true */
+/*global blurconsole:false */
+blurconsole.schema = (function () {
+	'use strict';
+	var
+		configMap = {
+			mainHtml: String()
+				+ '<div class="container-fluid">'
+					+ '<div class="row">'
+						+ '<div class="col-md-6">'
+							+ '<div class="panel-group schemaList">'
+							+ '</div>'
+						+ '</div>'
+						+ '<div class="col-md-6">'
+							+ '<div class="row">'
+								+ '<div class="col-md-12 schemaColumnInfo">'
+									+ '<div class="schemaColumnDef in">'
+										+ '<strong>Choose a column on the left to see def</strong>'
+									+ '</div>'
+								+ '</div>'
+							+ '</div>'
+							+ '<div class="row">'
+								+ '<div class="col-md-12 schemaColumnTerms">'
+									+ '<div class="input-group">'
+										+ '<input class="form-control termSearch" placeholder="Starts With" type="text">'
+										+ '<span class="input-group-btn">'
+											+ '<button class="btn btn-default" type="button">Go!</button>'
+										+ '</span>'
+									+ '</div>'
+									+ '<ul class="list-group termList"></ul>'
+								+ '</div>'
+							+ '</div>'
+						+ '</div>'
+					+ '</div>'
+				+ '</div>'
+		},
+		stateMap = {},
+		jqueryMap = {},
+		initModule, showSchema, buildTreeSection, buildInfoSection, viewTerms, findTerms, loadTerms,
switchToSearch;
+
+	showSchema = function(event, table) {
+		stateMap.table = table;
+		stateMap.modalId = stateMap.table + '_modal';
+		stateMap.schema = blurconsole.model.tables.getSchema(stateMap.table);
+
+		jqueryMap.contentHolder = $(configMap.mainHtml);
+		jqueryMap.contentHolder.find('.schemaList').html(buildTreeSection());
+		jqueryMap.contentHolder.find('.schemaColumnInfo').append(buildInfoSection());
+
+		jqueryMap.modal = $(blurconsole.browserUtils.modal(stateMap.modalId, 'Schema Definition
for ' + stateMap.table, jqueryMap.contentHolder, null, 'large'));
+		jqueryMap.modal.modal()
+		.on('shown.bs.modal', function(e){
+			jqueryMap.columnTermsSection = $('.schemaColumnTerms', jqueryMap.modal);
+			jqueryMap.termSearch = $('.termSearch', jqueryMap.modal);
+			jqueryMap.termList = $('.termList', jqueryMap.modal);
+			jqueryMap.termSearchButton = $('.schemaColumnTerms button', jqueryMap.modal);
+			$('.collapse', e.currentTarget).collapse({ toggle: false });
+		})
+		.on('hidden.bs.modal', function(e) {
+			$(e.currentTarget).remove();
+			jqueryMap.contentHolder.remove();
+			jqueryMap = {};
+			stateMap = {};
+		})
+		.on('click', 'li.schemaColumn', function() {
+			var defId = $(this).find('a').attr('href');
+			$('div.schemaColumnDef').removeClass('in');
+			$(defId).addClass('in');
+			jqueryMap.columnTermsSection.hide();
+			return false;
+		})
+		.on('click', 'a.termsTrigger', viewTerms)
+		.on('click', '.schemaColumnTerms button', findTerms)
+		.on('click', '.searchTrigger', switchToSearch);
+	};
+
+	buildTreeSection = function() {
+		var tree = '';
+		$.each(stateMap.schema, function(family, cols){
+			var famId = blurconsole.browserUtils.cleanId(family);
+			tree += '<div class="panel panel-default"><div class="panel-heading">';
+			tree += '<h4 class="panel-title"><a data-toggle="collapse" data-parent=".schemaList"
href="#' + famId + '">' + family + '</a></h4></div>';
+			tree += '<div id="' + famId + '" class="panel-collapse collapse"><div class="panel-body"><ul
class="list-group">';
+			$.each(cols, function(col, def) {
+				var colId = blurconsole.browserUtils.cleanId(col);
+				tree += '<li class="list-group-item schemaColumn"><a href="#' + famId + '_'
+ colId + '">' + col + '';
+				if (def.type !== 'stored') {
+					tree += ' <span class="badge">searchable</span>';
+				}
+				tree += '</a><div class="pull-right"><i class="glyphicon glyphicon-chevron-right"></i></div></li>';
+			});
+			tree += '</ul></div></div></div>';
+		});
+		return tree;
+	};
+
+	buildInfoSection = function() {
+		var info = '';
+		$.each(stateMap.schema, function(family, cols){
+			var famId = blurconsole.browserUtils.cleanId(family);
+			$.each(cols, function(col, def){
+				var colId = blurconsole.browserUtils.cleanId(col);
+				info += '<div class="schemaColumnDef" id="' + famId + '_' + colId + '"><ul class="list-group">';
+				info += '<li class="list-group-item"><strong>Fieldless Searching:</strong>
' + blurconsole.browserUtils.booleanImg(def.fieldLess) + '</li>';
+				info += '<li class="list-group-item"><strong>Field Type:</strong> '
+ def.type + '</li>';
+				if (def.extra) {
+					$.each(def.extra, function(key, value) {
+						info += '<li class="list-group-item"><strong>' + key + ':</strong>
' + value + '</li>';
+					});
+				}
+				if (def.type !== 'stored') {
+					info += '<li class="list-group-item"><a href="#" class="termsTrigger" data-fam="'
+ family + '" data-col="' + col + '">View Terms</a></li>';
+				}
+				info += '</ul></div>';
+			});
+		});
+		return info;
+	};
+
+	viewTerms = function() {
+		jqueryMap.termList.html('<div class="center-block"><img src="images/ajax-loader.gif"></div>');
+		jqueryMap.termSearch.val('');
+		jqueryMap.columnTermsSection.show();
+		var $this = $(this);
+
+		stateMap.termFamily = $this.data('fam');
+		stateMap.termColumn = $this.data('col');
+
+		jqueryMap.termSearchButton.trigger('click');
+	};
+
+	findTerms = function() {
+		blurconsole.model.tables.findTerms(stateMap.table, stateMap.termFamily, stateMap.termColumn,
jqueryMap.termSearch.val());
+	};
+
+	loadTerms = function() {
+		var terms = Array.prototype.slice.call(arguments, 1);
+		jqueryMap.termList.html('');
+		$.each(terms, function(i, term){
+			jqueryMap.termList.append('<li class="list-group-item">' + term + ' <span class="badge
badge-success searchTrigger" title="Search for this value" data-value="' + term + '"><i
class="glyphicon glyphicon-search"></i></span></li>');
+		});
+	};
+
+	switchToSearch = function(){
+		blurconsole.shell.changeAnchorPart({
+			tab: 'search',
+			_tab: {
+				query: stateMap.termFamily + '.' + stateMap.termColumn + ':' + $(this).data('value')
+			}
+		});
+	};
+
+	initModule = function() {
+		$.gevent.subscribe($(document), 'schema-show', showSchema);
+		$.gevent.subscribe($(document), 'terms-updated', loadTerms);
+	};
+
+	return {
+		initModule : initModule
+	};
+}());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/ef5f913b/contrib/blur-console/ui/app/scripts/blurconsole.shell.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/ui/app/scripts/blurconsole.shell.js b/contrib/blur-console/ui/app/scripts/blurconsole.shell.js
index 7aa2a7f..29cf639 100644
--- a/contrib/blur-console/ui/app/scripts/blurconsole.shell.js
+++ b/contrib/blur-console/ui/app/scripts/blurconsole.shell.js
@@ -22,7 +22,8 @@ blurconsole.shell = (function () {
 	'use strict';
 	var configMap = {
 		anchorSchemaMap : {
-			tab : { dashboard : true, tables : true, queries : true, search : true }
+			tab : { dashboard : true, tables : true, queries : true, search : true },
+			_tab : { query: true }
 		},
 		defaultTab : 'dashboard',
 		allTabs : ['dashboard', 'tables', 'queries', 'search']
@@ -144,6 +145,8 @@ blurconsole.shell = (function () {
 		stateMap.$container = $container;
 		setJqueryMap();
 
+		blurconsole.schema.initModule();
+
 		$('.side-nav li').tooltip();
 
 		jqueryMap.$sideNavTabs.click( onClickTab );
@@ -163,5 +166,8 @@ blurconsole.shell = (function () {
 		}
 	};
 
-	return { initModule: initModule };
+	return {
+		initModule: initModule,
+		changeAnchorPart : changeAnchorPart
+	};
 }());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/ef5f913b/contrib/blur-console/ui/app/scripts/blurconsole.tables.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/ui/app/scripts/blurconsole.tables.js b/contrib/blur-console/ui/app/scripts/blurconsole.tables.js
index 57193a0..7d56145 100644
--- a/contrib/blur-console/ui/app/scripts/blurconsole.tables.js
+++ b/contrib/blur-console/ui/app/scripts/blurconsole.tables.js
@@ -22,16 +22,26 @@ blurconsole.tables = (function () {
 			{label:'Table Name', key:'name'},
 			{label:'Row Count', key: 'rowCount'},
 			{label:'Record Count', key: 'recordCount'},
-			{label:'Actions', key: function(){ return ''; }}
+			{label:'Actions', key: function(row) {
+				var actions = '', table = row.name;
+				actions += '<a href="#" class="schemaTrigger btn btn-default" data-name="' + table
+ '"><i class="glyphicon glyphicon-list-alt"></i> Schema</a> ';
+				actions += '<a href="#" class="disableTrigger btn btn-danger" data-name="' + table
+ '"><i class="glyphicon glyphicon-cloud-download"></i> Disable</a> ';
+				return actions;
+			}}
 		],
 		disabledDef : [
 			{label:'Table Name', key:'name'},
-			{label:'Actions', key: function(){ return ''; }}
+			{label:'Actions', key: function(row) {
+				var actions = '', table = row.name;
+				actions += '<a href="#" class="enableTrigger btn btn-default" data-name="' + table
+ '"><i class="glyphicon glyphicon-cloud-upload"></i> Enable</a> ';
+				actions += '<a href="#" class="deleteTrigger btn btn-danger" data-name="' + table
+ '"><i class="glyphicon glyphicon-trash"></i> Delete</a> ';
+				return actions;
+			}}
 		]
 	},
 	stateMap = { $container : null },
 	jqueryMap = {},
-	setJqueryMap, initModule, unloadModule, updateTableList, buildTabs, waitForData;
+	setJqueryMap, initModule, unloadModule, updateTableList, buildTabs, waitForData, registerPageEvents,
unregisterPageEvents;
 
 	setJqueryMap = function() {
 		var $container = stateMap.$container;
@@ -44,6 +54,7 @@ blurconsole.tables = (function () {
 
 	unloadModule = function() {
 		$.gevent.unsubscribe(jqueryMap.$container, 'tables-updated');
+		unregisterPageEvents();
 	};
 
 	initModule = function($container) {
@@ -52,10 +63,7 @@ blurconsole.tables = (function () {
 			setJqueryMap();
 			$.gevent.subscribe(jqueryMap.$container, 'tables-updated', updateTableList);
 			waitForData();
-			jqueryMap.$tableInfoHolder.on('click', 'ul.nav a', function(e) {
-				e.preventDefault();
-				$(this).tab('show');
-			});
+			registerPageEvents();
 		});
 		return true;
 	};
@@ -99,7 +107,7 @@ blurconsole.tables = (function () {
 		$.each(clusters, function(idx, cluster){
 			var clusterPane = $('#' + cluster + '_pane');
 			clusterPane.find('.enabledSection').html(blurconsole.browserUtils.table(configMap.enabledDef,
blurconsole.model.tables.getEnabledTables(cluster)));
-			clusterPane.find('.disabledSection').html(blurconsole.browserUtils.table(configMap.enabledDef,
blurconsole.model.tables.getDisabledTables(cluster)));
+			clusterPane.find('.disabledSection').html(blurconsole.browserUtils.table(configMap.disabledDef,
blurconsole.model.tables.getDisabledTables(cluster)));
 		});
 	};
 
@@ -120,6 +128,62 @@ blurconsole.tables = (function () {
 		});
 	};
 
+	registerPageEvents = function() {
+		// Tab control
+		jqueryMap.$tableInfoHolder.on('click', 'ul.nav a', function(e) {
+			e.preventDefault();
+			$(this).tab('show');
+		});
+
+		// View Schema
+		jqueryMap.$tableInfoHolder.on('click', 'a.schemaTrigger', function() {
+			$.gevent.publish('schema-show', $(this).data('name'));
+			return false;
+		});
+
+		// Disable Table
+		jqueryMap.$tableInfoHolder.on('click', 'a.disableTrigger', function() {
+			blurconsole.model.tables.disableTable($(this).data('name'));
+			return false;
+		});
+
+		// Enable Table
+		jqueryMap.$tableInfoHolder.on('click', 'a.enableTrigger', function() {
+			blurconsole.model.tables.enableTable($(this).data('name'));
+			return false;
+		});
+
+		// Delete Table
+		jqueryMap.$tableInfoHolder.on('click', 'a.deleteTrigger', function() {
+			var tableName = $(this).data('name');
+			console.log('delete:' + tableName);
+			var modalContent = blurconsole.browserUtils.modal('confirmDelete', 'Confirm Table Deletion',
'You are about to delete table ' + tableName + '.  Are you sure you want to do this? If so,
do you also want to delete the underlying table data?', [
+				{classes: 'btn-warning tableOnly', label: 'Table Only'},
+				{classes: 'btn-danger tableAndData', label: 'Table And Data'},
+				{classes: 'btn-default cancel', label: 'Cancel', data: {dismiss:'modal'}}
+			], 'medium');
+
+			var modal = $(modalContent).modal().on('shown.bs.modal', function(e){
+				$(e.currentTarget).on('click', '.tableOnly', function() {
+					blurconsole.model.tables.deleteTable(tableName, false);
+					modal.modal('hide');
+				}).on('click', '.tableAndData', function() {
+					blurconsole.model.tables.deleteTable(tableName, true);
+					modal.modal('hide');
+				});
+			}).on('hidden.bs.modal', function(e) {
+				$(e.currentTarget).remove();
+			});
+			return false;
+		});
+	};
+
+	unregisterPageEvents = function() {
+		if (jqueryMap.$tableInfoHolder) {
+			jqueryMap.$tableInfoHolder.off();
+		}
+	};
+
 	return {
 		initModule : initModule,
 		unloadModule : unloadModule

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/ef5f913b/contrib/blur-console/ui/app/styles/blurconsole.schema.scss
----------------------------------------------------------------------
diff --git a/contrib/blur-console/ui/app/styles/blurconsole.schema.scss b/contrib/blur-console/ui/app/styles/blurconsole.schema.scss
new file mode 100644
index 0000000..fd58790
--- /dev/null
+++ b/contrib/blur-console/ui/app/styles/blurconsole.schema.scss
@@ -0,0 +1,20 @@
+.modal .schemaColumnDef {
+	display: none;
+	&.in {
+		display: block;
+	}
+	strong {
+		width: 140px;
+		display: inline-block;
+	}
+}
+
+.modal .schemaColumnTerms {
+	display: none;
+	.termList {
+		margin-top: 5px;
+		.searchTrigger {
+			cursor: pointer;
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/ef5f913b/contrib/blur-console/ui/app/styles/blurconsole.scss
----------------------------------------------------------------------
diff --git a/contrib/blur-console/ui/app/styles/blurconsole.scss b/contrib/blur-console/ui/app/styles/blurconsole.scss
index e50c1f3..350f664 100644
--- a/contrib/blur-console/ui/app/styles/blurconsole.scss
+++ b/contrib/blur-console/ui/app/styles/blurconsole.scss
@@ -13,9 +13,9 @@ See the License for the specific language governing permissions and
 limitations under the License.
  */
 
-$icon-font-path: "/bower_components/sass-bootstrap/fonts/";
+$icon-font-path: "/bower_components/twbs-bootstrap-sass/vendor/assets/fonts/bootstrap/";
 
-@import 'sass-bootstrap/lib/bootstrap';
+@import 'twbs-bootstrap-sass/vendor/assets/stylesheets/bootstrap';
 
 .browsehappy {
     margin: 0.2em 0;
@@ -24,6 +24,10 @@ $icon-font-path: "/bower_components/sass-bootstrap/fonts/";
     padding: 0.2em 0;
 }
 
+.input-group-btn > .btn {
+  height: $input-height-base;
+}
+
 /* Space out content a bit */
 body {
     padding: 70px 10px 20px 50px;


Mime
View raw message