incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cr...@apache.org
Subject [49/58] [partial] Initial setup of new console
Date Tue, 08 Oct 2013 17:59:57 GMT
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/688e9d08/contrib/blur-console-old/blur-admin/app/assets/javascripts/hdfs.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console-old/blur-admin/app/assets/javascripts/hdfs.js b/contrib/blur-console-old/blur-admin/app/assets/javascripts/hdfs.js
new file mode 100644
index 0000000..a879d16
--- /dev/null
+++ b/contrib/blur-console-old/blur-admin/app/assets/javascripts/hdfs.js
@@ -0,0 +1,937 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+//= require jquery.contextMenu
+//= require jquery.osxFinder
+//= require d3/d3
+//= require flot/flot
+//= require_self
+
+$(document).ready(function() {
+  //document varss
+  var delete_file, draw_radial_graph, finishUploading, make_dir, navigateUsingPath, paste_buffer, rightClicked,
+    perform_action, reload_hdfs, show_dir_props, show_hdfs_props, pre_cut_file, cut_file, upload, uploadFailed, in_file = [],
+    allSelected = [], columnSelected = [], lastClicked, ctrlHeld = false, shiftHeld = false, historyUndef = false;
+
+  //TODO: figure out why this doesn't work
+  // Old browser support for history push state
+  if (typeof history.pushState === 'undefined') {
+    history.pushState = function() {
+      historyUndef = true;
+    };
+  }
+
+  // One time use page variable initialization
+  (function() {
+    var headerHeight = 0;
+    var footerHeight = 0;
+    window.onload = function() {
+      headerHeight = parseInt($('.navbar').css('height'), 10);
+      footerHeight = parseInt($('#ft').css('height'), 15);
+      var newHeight = window.innerHeight - (footerHeight + headerHeight) - 20;
+      $('#hdfs_wrapper').animate({height: newHeight + 'px'}, 400);
+    };
+    $(window).resize(function() {
+      $('#hdfs_wrapper').css('height', window.innerHeight - (footerHeight + headerHeight) - 15);
+    });
+  })();
+
+  /*
+   * Page Widget Setup Methods
+  */
+
+  var setup_context_menus = function() {
+    $('#hdfs_browser li.hdfs_instance').contextMenu(
+      { menu: 'hdfs-root-context-menu' },
+      function(action, el, pos) {
+        perform_action(action, el);
+        return false;
+      }
+    );
+    $('#hdfs_browser li.folder').contextMenu(
+      { menu: 'hdfs-dir-context-menu' },
+      function(action, el, pos) {
+        perform_action(action, el);
+        return false;
+      }
+    );
+    $('#hdfs_browser li.file').contextMenu(
+      {menu: 'hdfs-file-context-menu'},
+      function(action, el, pos) {
+        perform_action(action, el);
+        return false;
+      }
+    );
+    $('#hdfs_browser .innerWindow').contextMenu(
+      {menu: 'hdfs-whitespace-context-menu'},
+      function(action, el, pos) {
+        var prev = el.prev().find('.osxSelected');
+        perform_action(action, prev);
+        return false;
+      }
+    );
+    $('#hdfs-dir-context-menu, #hdfs-whitespace-context-menu').disableContextMenuItems('#paste');
+    if ($('#hdfs_browser').attr('hdfs_editor') === 'false') {
+      $('.contextMenu').disableContextMenuItems('#paste,#mkdir,#cut,#rename,#delete');
+    }
+  };
+
+  var tree_context_menu = function() {
+    return $(["<div class='context_menus'>",
+        "<ul id='hdfs-root-context-menu' class='contextMenu'>",
+          "<li class='mkdir'><a href='#mkdir'>New Folder</a></li>",
+          "<li class='edit'><a href='#upload'>Upload File</a></li>",
+          "<li class='props separator'><a href='#props'>Properties</a></li>",
+        "</ul>",
+        "<ul id='hdfs-dir-context-menu' class='contextMenu'>",
+          "<li class='mkdir'><a href='#mkdir'>New Folder</a></li>",
+          "<li class='edit'><a href='#upload'>Upload File</a></li>",
+          "<li class='rename'><a href='#rename'>Rename</a></li>",
+          "<li class='cut'><a href='#cut'>Cut</a></li>",
+          "<li class='paste'><a href='#paste'>Paste</a></li>",
+          "<li class='delete'><a href='#delete'>Delete</a></li>",
+          "<li class='props separator'><a href='#dirprops'>Properties</a></li>",
+        "</ul>",
+        "<ul id='hdfs-file-context-menu' class='contextMenu'>",
+          "<li class='rename'><a href='#rename'>Rename</a></li>",
+          "<li class='cut'><a href='#cut'>Cut</a></li>",
+          "<li class='delete'><a href='#delete'>Delete</a></li>",
+          "<li class='props separator'><a href='#dirprops'>Properties</a></li>",
+        "</ul>",
+        "<ul id='hdfs-whitespace-context-menu' class='contextMenu'>",
+          "<li class='mkdir'><a href='#mkdir'>New Folder</a></li>",
+          "<li class='edit'><a href='#upload'>Upload File</a></li>",
+          "<li class='paste'><a href='#paste'>Paste</a></li>",
+          "<li class='props separator'><a href='#dirprops'>Properties</a></li>",
+        "</ul>",
+      "</div>"].join('\n'));
+  };
+
+  var draw_radial_graph = function(width, height, json) {
+    var showGraphTooltip = function(graph, tipContent) {
+      var tooltip = $('<div class="graphtip" ><div id="tipcontent">' + tipContent + '</div></div>');
+      $('.radial-graph').append(tooltip);
+      var graphWidth = graph.outerWidth();
+      var graphHeight = graph.outerHeight();
+      var tipWidth = tooltip.outerWidth();
+      var tipHeight = tooltip.outerHeight();
+      var drawPositionX = (graphWidth / 2) - (tipWidth / 2);
+      var drawPositionY = (graphHeight / 2) - (tipHeight / 2);
+      tooltip.css({
+        top: drawPositionY + 'px',
+        left: drawPositionX + 'px'
+      });
+      tooltip.fadeIn(400);
+    };
+    var radius = Math.min(width, height) / 2;
+    var color = d3.scale.category20c();
+    var selector = ".radial-graph";
+    $(selector).empty();
+    var vis = d3.select(selector).append("svg").attr("width", width).attr("height", height).append("g").attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");
+    var partition = d3.layout.partition().sort(function(a, b) {
+      return b.size - a.size;
+    }).size([2 * Math.PI, radius * radius]).value(function(d) {
+      return d.size;
+    });
+    var arc = d3.svg.arc().startAngle(function(d) {
+      return d.x;
+    }).endAngle(function(d) {
+      return d.x + d.dx;
+    }).innerRadius(function(d) {
+      return Math.sqrt(d.y);
+    }).outerRadius(function(d) {
+      return Math.sqrt(d.y + d.dy);
+    });
+    var path = vis.data([json]).selectAll("path").data(partition.nodes).enter().append("path").attr("display", function(d) {
+      if (d.depth) {
+        return null;
+      } else {
+        return "none";
+      }
+    }).attr("d", arc).attr("fill-rule", "evenodd").style("stroke", "#fff").style("fill", function(d) {
+      return color((d.children ? d : d.parent).name);
+    }).attr("title", function(d) {
+      return d.name;
+    });
+    var timeoutShowVar = null;
+    $('path').hover(function() {
+      var title = $(this).attr('title') || "No path name found!";
+      $('.graphtip').remove();
+      clearTimeout(timeoutShowVar);
+      timeoutShowVar = setTimeout((function() {
+        showGraphTooltip($('.radial-graph'), title);
+      }), 500);
+    }, function() {
+      clearTimeout(timeoutShowVar);
+      $('.graphtip').remove();
+    });
+  };
+
+  /*
+   * HDFS Actions
+  */
+
+  var pre_cut_file = function(action, el) {
+    if (paste_buffer.multiple) {
+      $.each(paste_buffer.multiple, function(index, value) {
+        $(value).removeClass('to-cut');
+      });
+    }
+    if (paste_buffer.location) {
+      $(paste_buffer.location).removeClass('to-cut');
+    }
+    paste_buffer.location = el;
+    paste_buffer.action = action;
+    paste_buffer.multiple = columnSelected;
+    $('#hdfs-dir-context-menu, #hdfs-whitespace-context-menu').enableContextMenuItems('#paste');
+    if (paste_buffer.multiple.length > 0) {
+      $.each(paste_buffer.multiple, function(index, value) {
+        $(value).addClass('to-cut');
+      });
+    }
+    else {
+      $(paste_buffer.location).addClass('to-cut');
+    }
+  };
+
+  var cut_file = function(file, location) {
+    var from_id = file.attr('hdfs_id');
+    var from_path = file.attr('hdfs_path');
+    var to_id = location.attr('hdfs_id');
+    var to_path = location.attr('hdfs_path');
+    if (from_id === to_id) {
+      $.ajax({
+        url: Routes.move_hdfs_path(to_id, {format: 'json'}),
+        type: 'POST',
+        data: {
+          from: from_path,
+          to: to_path
+        },
+        success: function(){
+          $('#hdfs-dir-context-menu, #hdfs-whitespace-context-menu').disableContextMenuItems('#paste');
+          if (!historyUndef) {
+            reload_hdfs();
+          }
+          else {
+            reload_hdfs_ff(to_path, to_id);
+          }
+        },
+        error: function(xhr, status, error){
+          console.log(status + "  " + error);
+        }
+      });
+    }
+  };
+
+  var rename = function(el) {
+    var id = el.attr('hdfs_id');
+    var from_path = el.attr('hdfs_path');
+    $('<div id="newName"><lable>New name for '+ from_path.split('/').pop() +'</label><br/><br/><input></input></div>').popup({
+      title: 'New Name',
+      titleClass: 'title',
+      shown: function() {
+        $('#newName input').focus();
+      },
+      onEnter: true,
+      btns: {
+        "Create": {
+          "class": "primary",
+          func: function() {
+            var newName = $('#newName input').val();
+            var newFullPath = "" + (from_path.substring(0, from_path.lastIndexOf('/') + 1)) + newName;
+            var unique = true;
+            $.each(el.siblings(), function(index, value){
+              if(newFullPath == $(value).attr('hdfs_path')) unique = false;
+            });
+            if (newName == '') {
+              $().closePopup();
+              errorPopup("Name was not entered.");
+            }
+            else if (!unique){
+              $().closePopup();
+              errorPopup("Name already in use.");
+            }
+            else{
+              $.ajax(Routes.move_hdfs_path(id, {format: 'json'}), {
+                type: 'post',
+                data: {
+                  from: from_path,
+                  to: newFullPath
+                },
+                success: function() {
+                  el.attr('hdfs_path', newFullPath);
+                  var link = el.find('a');
+                  link.html(newName);
+                  var href = link.attr('href');
+                  link.attr('href', href.replace(from_path, newFullPath));
+                  if (el.hasClass('osxSelected')) {
+                    var nextWin = el.parents('.innerWindow').next();
+                    var display_href = el.find('a').attr('href');
+                    nextWin.load(display_href);
+                  } else {
+                    el.click();
+                  }
+                }
+              });
+              $().closePopup();
+            }
+          }
+        },
+        "Cancel": {
+          func: function() {
+            $().closePopup();
+          }
+        }
+      }
+    });
+  };
+
+  var delete_file = function(file) {
+    var id = file.attr('hdfs_id');
+    var path = file.attr('hdfs_path');
+    $.post(Routes.delete_file_hdfs_path(id, {format: 'json'}), {
+      'path': path
+    }, function() {
+      if (!historyUndef) {
+        reload_hdfs();
+      }
+      else {
+        reload_hdfs_ff(path, id);
+      }
+    });
+  };
+
+  var delete_additional_files = function(clicked_file) {
+    $.each(columnSelected, function(index, value){
+      if(!(clicked_file[0] == value)) {
+        delete_file($(value));
+      }
+    });
+  };
+
+  //Drag and Drop Functionality
+  //Event listener functions for drag and drop
+   function dragEnter (evt){
+    $(this).addClass('currentDrop');
+    evt.stopPropagation();
+    evt.preventDefault();
+  }
+  function dragOver (evt){
+    evt.stopPropagation();
+    evt.preventDefault();
+  }
+  function dragExit(evt){
+    $(this).removeClass('currentDrop');
+    evt.stopPropagation();
+    evt.preventDefault();
+  }
+  function drop(evt){
+    evt.stopPropagation();
+    evt.preventDefault();
+    var files = evt.originalEvent.dataTransfer.files; //FileList object
+    var count = files.length;
+    if (count > 0)
+      handleFiles(files);
+  }
+
+  //Compatability check
+if (window.File && window.FileReader && window.FileList && window.Blob){
+
+  $('#hdfs_browser').on('dragenter', '.innerWindow', dragEnter);
+  $('#hdfs_browser').on('dragleave', '.innerWindow', dragExit);
+  $('#hdfs_browser').on('dragover', '.innerWindow', dragOver);
+  $('#hdfs_browser').on('drop', '.innerWindow', drop);
+
+}
+//Posts the form data to the controller
+var handleFiles = function(files) {
+  var id =$('#top_level .osxSelected').attr('hdfs_id');
+  var target_path = $('.currentDrop').prev().find('.osxSelected').attr('hdfs_path');
+  var file = files[0];
+  if (file.size > 26214400){
+    console.error("File was too large. Needs to be less than 25 MB");
+  }
+
+  var formData = new FormData();
+  formData.append("upload", file);
+  formData.append("path", target_path);
+  formData.append("id", id);
+  var xhr = new XMLHttpRequest();
+  xhr.open('POST', Routes.upload_hdfs_path(id), true);
+  xhr.onload = function(e){
+    if (this.status != 200)
+      console.log("Loaded " + file.name);
+  };
+  xhr.send(formData);
+  if (!historyUndef) {
+    reload_hdfs();
+  }
+  else {
+    reload_hdfs_ff(target_path, id);
+  }
+};
+//End of DnD Functionality
+
+  var upload = function(el) {
+    var id = el.attr('hdfs_id');
+    var path = el.attr('hdfs_path');
+    var modal_container = $('<div id="upload_form_modal_container"></div>');
+    in_file = [];
+    $('.osxSelectable[hdfs_path="' + path + '"][hdfs_id=' + id + ']').click();
+    var osxWindow = ( path == '/' ? 1 : path.split('/').length );
+
+    modal_container.load(Routes.upload_form_hdfs_path(id), function(data) {
+      $().popup({
+        body: data,
+        title: 'Upload File',
+        titleClass: 'title',
+        show: function() {
+          $('#fpath-input').val(path);
+          $('#hdfs-id-input').val(id);
+          $.each( $($('.innerWindow')[osxWindow]).find('a'), function (index, value){
+            in_file.push($(value).attr('title'));
+          });
+          $('input[type=file]').change( function(event) {
+            if (in_file.indexOf($('#file-input').val().split('\\').pop()) < 0) {
+              $('#upload_file_warning').addClass('hidden');
+            }
+            else {
+              $('#upload_file_warning').removeClass('hidden');
+            }
+          });
+        },
+        hide: function() {
+          !window.uploading;
+        },
+        btns: {
+          "Upload": {
+            "class": "primary",
+            func: function() {
+              $('#upload-form').submit();
+            }
+          },
+          "Cancel": {
+            func: function() {
+              $().closePopup();
+            }
+          }
+        }
+      });
+    });
+  };
+
+  var make_dir = function(el) {
+    var id = el.attr('hdfs_id');
+    var path = el.attr('hdfs_path');
+    in_file = [];
+    $('.osxSelectable[hdfs_path="' + path + '"][hdfs_id=' + id + ']').click();
+    var osxWindow = ( path == '/' ? 1 : path.split('/').length );
+
+    $('<div id="newFolder"><label>Folder Name:</label><input></input><br/><br/>Parent directory: '+ path +'</div>').popup({
+      title: 'New Folder',
+      titleClass: 'title',
+      shown: function() {
+        $('#newFolder input').focus();
+      },
+      onEnter: true,
+      btns: {
+        "Create": {
+          "class": 'primary',
+          func: function() {
+            var newName = $('#newFolder input').val();
+            var unique = true;
+
+            $.each( $($('.innerWindow')[osxWindow]).find('a'), function (index, value) {
+              in_file.push($(value).attr('title'));
+            });
+
+            $.each(in_file, function(index, value) {
+              if(newName == value) unique = false;
+            });
+
+            if (newName == '') {
+              $().closePopup();
+              errorPopup("Name was not entered.");
+            }
+            else if (!unique) {
+              $().closePopup();
+              errorPopup("Folder or file with this name already in use.");
+            }
+            else {
+              $.ajax(Routes.mkdir_hdfs_path(id, {format: 'json'}), {
+                type: 'post',
+                data: {
+                  fs_path: path,
+                  folder: $('#newFolder input').val()
+                },
+                success: function() {
+                  var display_href, nextWin;
+                  if (el.hasClass('osxSelected')) {
+                    nextWin = el.parents('.innerWindow').next();
+                    display_href = el.find('a').attr('href');
+                    nextWin.load(display_href);
+                  } else {
+                    el.click();
+                  }
+                }
+              });
+            $().closePopup();
+            }
+          }
+        },
+        "Cancel": {
+          func: function() {
+            $().closePopup();
+          }
+        }
+      }
+    });
+  };
+
+  var show_hdfs_props = function(id, name) {
+    var title = "HDFS Information (" + name + ")";
+    $('.hdfs_instance[hdfs_id=' + id + ']').click();
+    $.get(Routes.info_hdfs_path(id), function(data) {
+      $(data).popup({
+        title: title,
+        titleClass: 'title',
+        show: function() {
+          $.get(Routes.structure_hdfs_path(id, {format: 'json'}), {
+            'fs_path': '/'
+          }, function(data) {
+            draw_radial_graph(520, 400, data);
+          });
+          $('#modal').css({
+            'width': '1120px',
+            'margin-left': '-560px'
+          });
+          $('.modal-footer').css({
+            'width': '1090px'
+          });
+        }
+      });
+    });
+  };
+
+  var show_dir_props = function(id, path) {
+    var title = "Properties for " + path;
+    $('.osxSelectable[hdfs_path="' + path + '"][hdfs_id=' + id + ']').click();
+    $.get(Routes.folder_info_hdfs_path(id), {
+      'fs_path': path
+    }, function(data) {
+      $(data).popup({
+        titleClass: 'title',
+        title: title,
+        show: function() {
+          $.get(Routes.slow_folder_info_hdfs_path(id, {format: 'json'}), {
+            'fs_path': path
+          }, function(data) {
+            $('#file_count').html(data.file_count);
+            $('#folder_count').html(data.folder_count);
+            $('#file_size').html(data.file_size);
+          });
+          $.get(Routes.structure_hdfs_path(id, {format: 'json'}), {
+            'fs_path': path
+          }, function(data) {
+            draw_radial_graph(520, 400, data);
+          });
+          $('#modal').css({
+            'width': '1120px',
+            'margin-left': '-560px'
+          });
+          $('.modal-footer').css({
+            'width': '1090px'
+          });
+        }
+      });
+    });
+  };
+
+  var perform_action = function(action, el) {
+    switch (action) {
+      case "delete":
+        if (columnSelected.length > 0) {
+          confirmPopup("Are you sure you wish to delete these files? This action can not be undone.", function() {
+            delete_additional_files(el);
+            delete_file(el);//need both - delete_file catches the clicked element when its not highlighted
+          });
+        }
+        else {
+          confirmPopup("Are you sure you wish to delete " + el.attr('hdfs_path') + "? This action can not be undone.", function() {
+            delete_file(el);
+          });
+        }
+        break;
+      case "cut":
+        pre_cut_file(action, el);
+        break;
+      case "paste":
+        if (paste_buffer.action && paste_buffer.action === "cut") {
+          if (paste_buffer.multiple.length > 0){
+            $.each(paste_buffer.multiple, function(index, value){
+              cut_file($(value), el);
+            });
+          }
+          else {
+            cut_file(paste_buffer.location, el);
+          }
+        }
+        break;
+      case "props":
+        show_hdfs_props(el.attr('hdfs_id'), el.attr('hdfs_name'));
+        break;
+      case "dirprops":
+        show_dir_props(el.attr('hdfs_id'), el.attr('hdfs_path'));
+        break;
+      case "mkdir":
+        make_dir(el);
+        break;
+      case "rename":
+        rename(el);
+        break;
+      case "upload":
+        upload(el);
+        break;
+    }
+  };
+
+  /*
+   * Upload Methods
+  */
+
+  // Upload methods on the window so returned JS can call them
+  window.finishUploading = function(path) {
+    $("li[hdfs_path='" + path + "']").click();
+    $().closePopup();
+    window.uploading = false;
+    if (!historyUndef) {
+      reload_hdfs();
+    }
+    else {
+      reload_hdfs_ff(path, $('.osxSelected').attr('hdfs_id'));
+    }
+  };
+
+  window.uploadFailed = function(error) {
+    errorPopup(error);
+    window.uploading = false;
+  };
+
+  $('#upload-form').live('submit', function() {
+    window.uploading = true;
+    $('#upload-file #status').html('<h2>Uploading...</h2>');
+    $('#upload-file #upload-button').attr('disabled', 'disabled');
+  });
+
+  reload_hdfs = function() {
+    $('.osxSelected').removeClass('osxSelected');
+    navigateUsingPath();
+  };
+
+  reload_hdfs_ff = function(path, hdfsId) { //fix for FF 3.6
+    $('.osxSelected').removeClass('osxSelected');
+    navigateOsxWindow(path, hdfsId);
+  }
+
+  /*
+    Methods for HTML History manipulation
+  */
+
+  navigateUsingPath = function() {
+    var pathPieces = window.location.pathname.split('/').filter(function(member) {
+      return member !== '';
+    }).slice(1);
+    var hdfsId = pathPieces.shift();
+    var path = '/' + pathPieces.slice(1).join('/');
+    $('#hdfs_browser').osxFinder('navigateToPath', path, hdfsId, true);
+    $('.innerWindow').first().disableContextMenu();
+  };
+  window.onpopstate = function(e) {
+    navigateUsingPath();
+  };
+  navigateOsxWindow = function(path, hdfsId) {
+    $('#hdfs_browser').osxFinder('navigateToPath', path, hdfsId, true);
+    $('.innerWindow').first().disableContextMenu();
+  };
+
+  /*
+   * Methods for modals
+  */
+
+  errorPopup = function(message) {
+    $('<div id="error">' + message +'</div>').popup({
+      title: 'Error',
+      shown: function() {
+        $('.btn-primary').focus();
+      },
+      btns: {
+        "Ok": {
+          "class": "primary",
+          func: function(){
+            $().closePopup();
+          }
+        }
+      }
+    });
+  };
+
+  confirmPopup = function(message, confirmFnct) {
+    $('<div id="confirm">' + message +'</div>').popup({
+      title: 'Confirm',
+      shown: function() {
+        $('.btn-primary').focus();
+      },
+      btns: {
+        "Ok": {
+          "class": "primary",
+          func: function() {
+            $().closePopup();
+            confirmFnct();
+          }
+        },
+        "Cancel": {
+          func: function() {
+            $().closePopup();
+            return false;
+          }
+        }
+      }
+    });
+  };
+
+  /*
+    Methods to call on page load
+  */
+
+  $(document.body).append(tree_context_menu());
+  setup_context_menus();
+  paste_buffer = {};
+  $('path').live('click', function() {
+    $().closePopup();
+    var id = $('#top_level .osxSelected').attr('hdfs_id');
+    var fullpath = $(this).attr('title');
+    fullpath = fullpath.substring(fullpath.indexOf('//') + 2);
+    var path = fullpath.substring(fullpath.indexOf('/'));
+    $('#hdfs_browser').osxFinder('navigateToPath', path);
+    show_dir_props(id, path);
+  });
+  $('#hdfs_browser').osxFinder({
+    done: function() {
+      navigateUsingPath();
+    },
+    navigated: function(e, data) {
+      if (history.pushState) {
+        history.pushState({}, '', data.url);
+      }
+    }
+  });
+
+  /*
+   * Multiple select
+  */
+
+  //de-selects everything stored in columnSelected except for keep_selected
+  var remove_selected = function(keep_selected){
+    $.each(columnSelected, function(index, value){
+      if (value != keep_selected){
+        $(value).removeClass('osxSelected');
+      }
+    });
+  };
+
+  //selects everything in the group_selected, de-selects current if already selected
+  var add_selected = function(group_selected, current){
+    $.each(group_selected, function(index, value){
+      if (value == current && group_selected.length > 1 && !shiftHeld)
+        $(value).removeClass('osxSelected');
+      else
+        $(value).addClass('osxSelected');
+    });
+  };
+
+  //select the item that was originally selected in the clicked column
+  var add_last_selected = function(parent) {
+    $.each(allSelected, function(index, value) {
+      if ($(value).parent()[0] == parent[0]){
+        $(value).addClass('osxSelected');
+        lastClicked = value;
+      }
+    });
+  };
+
+  //disables or enables items in context menus
+  var checkContextMenus = function() {
+    if (columnSelected.length > 1) {
+      $('.contextMenu').disableContextMenuItems('#mkdir,#upload,#rename,#dirprops');
+    }
+    else {
+      $('.contextMenu').enableContextMenuItems('#mkdir,#upload,#rename,#dirprops');
+    }
+  };
+
+  //method for shift multiple select with Ctrl
+  var shiftCtrlSelect = function (parent, elems) {
+    if (columnSelected.length > 1 && elems[0] != lastClicked) {
+      var sibs = parent.children();
+      var inside = false;
+      $.each(sibs, function(index, value){
+        if ($(value).attr('hdfs_path') == elems.attr('hdfs_path')
+            || $(value).attr('hdfs_path') == $(lastClicked).attr('hdfs_path')) {
+          inside = (inside ? false : true);
+        }
+        else if (inside){
+          $(value).addClass('osxSelected');
+        }
+      });
+      columnSelected = $(parent).find('.osxSelected');
+    }
+  };
+
+  //method for shift multiple select without Ctrl
+  var shiftSelect = function (parent, elems) {
+    if (columnSelected.length == 1 && $(lastClicked).parent()[0] == parent[0]) {
+      $(lastClicked).addClass('osxSelected');
+      columnSelected = $(parent).find('.osxSelected');
+    }
+    if (columnSelected.length > 1) {
+      var inside = false;
+      var elemsPath = elems.attr('hdfs_path');
+      var colPath = $(columnSelected[0]).attr('hdfs_path');
+      var start = (elemsPath < colPath ? elemsPath : colPath);
+      var end = (start == elemsPath ? $(columnSelected[columnSelected.length-1]).attr('hdfs_path') : elemsPath);
+
+      $.each($(parent).children(), function(index, value){
+        if (!inside && $(value).attr('hdfs_path') == start) {
+          inside = true;
+          $(value).addClass('osxSelected');
+        }
+        else if (inside && $(value).attr('hdfs_path') == end) {
+          inside = false;
+          $(value).addClass('osxSelected');
+        }
+        else if (inside){
+          $(value).addClass('osxSelected');
+        }
+        else {
+          $(value).removeClass('osxSelected');
+        }
+      });
+      columnSelected = $(parent).find('.osxSelected');
+    }
+  };
+
+  $(document).on('click', function(e){
+    if(e.which == 1){ //checks for left mouse button (needed in FF 3.6)
+      $(rightClicked).removeClass('rclicked');
+      var elems = $(e.target).closest('li');
+
+      //click outside of the lists
+      if (elems.length == 0 && !ctrlHeld) {
+        remove_selected(lastClicked);
+        columnSelected = [];
+        lastClicked = elems[0];
+        $('.contextMenu').enableContextMenuItems('#mkdir,#upload,#rename,#dirprops');
+      }
+
+      //click a list element
+      else {
+        var parent = elems.parent();
+
+        if(ctrlHeld) { //CTRL held down
+          if (columnSelected.length == 0) {
+            add_last_selected(parent);
+          }
+          else if ($(columnSelected[0]).parent()[0] == parent[0]) {
+            add_selected(columnSelected, elems[0]);
+          }
+          else {
+            remove_selected(lastClicked);
+          }
+
+          columnSelected = $(parent).find('.osxSelected');
+          if (shiftHeld) {
+            shiftCtrlSelect(parent, elems);
+          }
+          lastClicked = ( columnSelected.length > 0 ? elems[0] : null);
+        }
+
+        else { //CTRL not held down
+          if (shiftHeld) {
+            if (columnSelected.length == 0) {
+              add_last_selected(parent);
+              columnSelected = $(parent).find('.osxSelected');
+              shiftSelect(parent, elems);
+            }
+            else if ($(columnSelected[0]).parent()[0] == parent[0]) {
+              shiftSelect(parent, elems);
+            }
+            else {
+              remove_selected(lastClicked);
+              columnSelected = $(parent).find('.osxSelected');
+            }
+            lastClicked = elems[0];
+          }
+
+          else {
+            remove_selected(elems[0]);
+            if ($(columnSelected[0]).parent()[0] != parent[0]) {
+              $(lastClicked).addClass('osxSelected');
+            }
+            columnSelected = [];
+            $('.contextMenu').enableContextMenuItems('#mkdir,#upload,#rename,#dirprop');
+            lastClicked = null;
+          }
+        }
+        checkContextMenus();
+      }
+      if (columnSelected.length > 1) {
+        $('.innerWindow').disableContextMenu();
+      }
+      else {
+        $('.innerWindow').enableContextMenu();
+        $('.innerWindow').first().disableContextMenu();
+      }
+    }if(e.which == 3){ //to account for the right click
+      $(rightClicked).removeClass('rclicked');
+      rightClicked = $(e.target).closest('li');
+      $(rightClicked).addClass('rclicked');
+    }
+    else {
+      //NOTE: this only works for FF 3.6
+      //TODO: fix for Chrome (this listener is not picking up right click in Chrome)
+      lastWindow = $('.innerWindow').last();
+      if (lastWindow.find('#file_table').length > 0) {
+        lastWindow.disableContextMenu();
+      }
+    }
+  });
+
+  // Method for holding down CTRL key
+  $(document).on('keydown', function(e) {
+    shiftHeld = e.shiftKey;
+    ctrlHeld = (e.ctrlKey || e.which == 224);
+    if (shiftHeld || ctrlHeld) {
+      allSelected = $('#hdfs_browser').find('.osxSelected');
+    }
+  });
+
+  // Method when CTRL key is released
+  $(document).on('keyup', function(e) {
+    ctrlHeld = (e.ctrlKey  || e.which == 224);
+    shiftHeld = e.shiftKey;
+  });
+
+});

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/688e9d08/contrib/blur-console-old/blur-admin/app/assets/javascripts/hdfs_metrics.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console-old/blur-admin/app/assets/javascripts/hdfs_metrics.js b/contrib/blur-console-old/blur-admin/app/assets/javascripts/hdfs_metrics.js
new file mode 100644
index 0000000..c5f0bc3
--- /dev/null
+++ b/contrib/blur-console-old/blur-admin/app/assets/javascripts/hdfs_metrics.js
@@ -0,0 +1,421 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+//= require d3/d3
+//= require flot/flot
+//= require flot/jquery.flot.resize.min
+//= require flot/jquery.flot.selection.min
+//= require flot/jquery.flot.crosshair.min
+//= require jquery.timepicker
+//= require underscore
+//= require_self
+
+$(document).ready(function(){
+  // Datastore for the current data on the plot
+  var hdfs_data = {};
+  // The max range of data that can be returned (in days)
+  var num_days_back = 14;
+  // starting range for the graphs
+  var default_range = 60 * 24;
+  // refresh speed for pulling new info (while live)
+	var refresh_time = 20000;
+  // timezone offset
+  var epoc_offset = new Date().getTimezoneOffset() * 60 * 1000
+  // refresh timeout
+  var refresh_timer;
+  // Different tab actions
+	var actions = ['disk', 'nodes', 'block'];
+  // Xaxis range 
+	// Hash of labels and object lookup strings for the various actions
+  var hdfs_request_lookup =
+  {
+		disk:
+		{
+			label_1: "Hdfs Disk Capacity (GB) - Left axis <span class='axis-value'></span>",
+			label_2: "Hdfs Disk Usage (GB) - Right axis <span class='axis-value'></span>",
+			stat_1: "capacity",
+			stat_2: "used"
+		},
+		nodes:
+		{
+			label_1: "Live Nodes - Left axis <span class='axis-value'></span>",
+			label_2: "Dead Nodes - Right axis <span class='axis-value'></span>",
+			stat_1: "live_nodes",
+			stat_2: "dead_nodes"
+		},
+		block:
+		{
+			label_1: "Under Replicated Blocks - Left axis <span class='axis-value'></span>",
+      label_2: "Missing Blocks - Right axis <span class='axis-value'></span>",
+			stat_1: "under_replicated",
+      stat_2: "missing_blocks"
+		}
+	};
+
+  //------------- Page Methods -------------
+
+  /*
+   * Returns a new object used to initialize a new hdfs
+   */
+  var default_hdfs_data = function(){
+    return {
+      disk: { metrics: [] },
+      nodes: { metrics: [] },
+      block: { metrics: [] },
+      // Initial range starts at now and goes til 1 day ago (in minutes)
+      max: 0,
+      min: -default_range,
+      // Whether the data is being added to an old set
+      updating: false,
+      largest_id: 0
+    };
+  }
+
+  /* 
+   * Draw the graph
+   * @arg graph_data an object containing all the data related to a graph
+   * @arg selector a jquery selector representing the desired location of the graph
+   */
+  var draw_graph = function(graph_data, selector, min, max){
+    // get the min and max
+    var now = new Date().getTime();
+    min = now + (min * 60 * 1000) - epoc_offset;
+    max = now + (max * 60 * 1000) - epoc_offset;
+
+    graph_data.plot = $.plot(selector, graph_data.metrics,
+		{
+      // Set the xaxis to a time plot
+			xaxis: {
+        mode: "time",
+        timeformat: "%0m/%0d %H:%M %p",
+        max: max,
+        min: min
+      },
+      // Set the yaxis to 2 separate scales
+      yaxes:[
+        { position: 'left', tickDecimals: 1 },
+        { position: 'right', tickDecimals: 1 }
+      ],
+      // Set the legend container
+      legend: { container: $(".graph-legend") },
+      // Set the crosshair to only show in the y direction
+      crosshair: { mode: "x" },
+      // Set the grid to hoverable (for value grabbing)
+      grid: { hoverable: true, autoHighlight: false },
+      // Do not show the lines (looks odd with non contiguous data)
+      lines: { show: false },
+      // Show the points
+      points: { show: true, radius: 2 }
+		});
+	};
+
+	/* 
+   * Request new graph data
+	 * @arg id of the hdfs
+   * @arg req_data data object for the ajax request
+	 *   req_data.stat_id requests data after a certain ID (update)
+	 *   req_data.stat_min specifies a min for the range (update / overwrite)
+   *   req_data.stat_max specifies a min for the range (overwrite)
+   */
+	var request_data = function(id, req_data){
+    $.ajax({
+			url: Routes.stats_hdfs_metric_path(id),
+			type: 'GET',
+			data: _.extend(req_data, {format: 'json'}),
+			success: function(data){
+        // If no data was returned then set the no data message
+        if (data.length <= 0 && !hdfs_data[id]){
+          $.each($('.graph_instance#' + id + ' .graph'), function(index, value) {
+            this.innerHTML = 'No data available';
+          });
+          return;
+				}
+
+        // Loop over every action set and build with the returned data
+				for(var action in hdfs_request_lookup){
+          var request_options = hdfs_request_lookup[action];
+          // Create the buffers for parsing the returned data
+					var hdfs_data_1 = {label: request_options.label_1, data: []};
+          var hdfs_data_2 = {label: request_options.label_2, data: [], yaxis: 2};
+          // Grab the correct container from the page
+          var graph_container = $('.graph_instance#' + id).find('.tab-pane#' + action + '_' + id);
+
+          // Add all of the data points to the buffers
+          for( var i in data ){
+						var point = data[i];
+						var entry_date = new Date(point.created_at).getTime();
+            // Convert the dates to epoc time
+            hdfs_data_1.data.push([entry_date - epoc_offset, point[request_options.stat_1]]);
+						hdfs_data_2.data.push([entry_date - epoc_offset, point[request_options.stat_2]]);
+          }
+
+          // if we are updating the current data set then add the new data
+          // NOTE: the data is a fixed size queue (time) therefore data out of view is dropped
+					if (req_data && req_data.stat_id){
+            var length = hdfs_data[id][action].metrics[0].data.length;
+            var now = new Date();
+              for(var find = 0; find <= length; find++){
+                if (hdfs_data[id][action].metrics[0].data[find] < now + hdfs_data[id].min * 60 * 1000) break;
+              }
+              
+              // remove all data outside of the range
+              if(find > 0){
+                hdfs_data[id][action].metrics[0].data.splice(0, find);
+                hdfs_data[id][action].metrics[1].data.splice(0, find);
+              }
+
+							hdfs_data[id][action].metrics[0].data = hdfs_data[id][action].metrics[0].data.concat(hdfs_data_1.data);
+							hdfs_data[id][action].metrics[1].data = hdfs_data[id][action].metrics[1].data.concat(hdfs_data_2.data);
+					// otherwise we are loading a new dataset (clear and then add)
+          }	else {
+            hdfs_data[id][action].metrics = []
+						hdfs_data[id][action].metrics.push(hdfs_data_1, hdfs_data_2);
+					}
+
+          // Mark the largest id for update requests (only if it is the largest)
+					if (point && hdfs_data[id].largest_id <  point.id) hdfs_data[id].largest_id = point.id
+
+          // Only redraw the active graph
+					if (graph_container.hasClass('active')){
+            draw_graph(hdfs_data[id][action], graph_container.find('.graph'), hdfs_data[id].min, hdfs_data[id].max);
+					}
+
+          // Sync up the sliders / pickers to the newest date returned (may not change depending on ranges)
+          sync_slider(id);
+          sync_date_fields(id);
+				}
+			}
+		});
+	};
+
+  /* 
+   * Loops over every graph instance and requests the new data 
+   * @arg id id of the hdfs we are targetting
+   */
+	var update_live_graphs = function(id){
+    $('.graph_instance').each(function(){
+      // Grab the id of the current graph
+			var hdfs_id = $(this).attr('id');
+      // if an id is defined then we only want to update the graph with that id
+      if (id && hdfs_id !== id) return;
+      
+      // if the max is now
+      if (hdfs_data[hdfs_id].max === 0){
+        // Clear the timeout of the old refresh
+        clearTimeout(refresh_timer);
+        // if we are grabbing an update to a current range
+        if (hdfs_data[hdfs_id].updating){
+          request_data(hdfs_id, {stat_id: hdfs_data[hdfs_id].largest_id});
+        // otherwise it is a newly selected range with a max of 0
+        } else {
+          request_data(hdfs_id, {stat_min: -hdfs_data[hdfs_id].min});
+          // set the updating to true because the max is now
+          hdfs_data[hdfs_id].updating = true;
+        }
+        refresh_timer = setTimeout(update_live_graphs, refresh_time);
+      // otherwise request the range
+      } else {
+        request_data(hdfs_id, {stat_min: -hdfs_data[hdfs_id].min, stat_max: -hdfs_data[hdfs_id].max});
+      }
+    });
+	};
+
+  /*
+   * Sets the time fields to the minDate and maxDate
+   */
+  var sync_slider = function(hdfs_id){
+    // the range values are stored as slider offsets simply set the slider to those values
+    var range_values = [hdfs_data[hdfs_id].min, hdfs_data[hdfs_id].max]
+    //$('.graph_instance#' + hdfs_id + ' .slider').dragslider('option', 'values', range_values);
+  };
+
+  /*
+   * Sets the time fields to match the slider
+   * @arg hdfs_id target hdfs
+   * @arg min(optional) min value for date picker
+   * @arg max(optional) max value for date picker
+   */
+  var sync_date_fields = function(hdfs_id, min, max) {
+    // get the current time
+    var now = new Date().getTime();
+
+    // grab the min date and max dates
+    min = typeof min !== "undefined" ? min : hdfs_data[hdfs_id].min;
+    max = typeof max !== "undefined" ? max : hdfs_data[hdfs_id].max;
+    var min_date = now + min * 60 * 1000;
+    var max_date = now + max * 60 * 1000;
+
+    // set the time pickers to the correct time and max/min time
+    var graph = $(".graph_instance#" + hdfs_id)
+    graph.find(".min-date")
+      .datetimepicker("option", "maxDate", new Date(max_date))
+      .datetimepicker("setDate", new Date(min_date));
+    graph.find(".max-date").datetimepicker("option", "maxDate", new Date())
+      .datetimepicker("option", "minDate", new Date(min_date))
+      .datetimepicker("setDate", new Date(max_date));
+  };
+
+	//------------- Page Events -------------
+
+  // Request the first set of data for every graph (starts the page)
+  // Uses the initial time length on
+  $('.graph_instance').each(function(){
+    var hdfs_id = $(this).attr('id');
+    hdfs_data[hdfs_id] = default_hdfs_data();
+    update_live_graphs(hdfs_id);
+  });
+
+  // Draws the new graph when a new tab is shown
+  $('.graph_instance').on('shown', 'a[data-toggle="tab"]', function(e){
+    var instance = $(this).closest('.graph_instance')
+		var hdfs_id = instance.attr('id');
+		var container = instance.find('.active > .graph');
+		var action = $(this).data('action');
+    if (hdfs_data[hdfs_id]){
+      draw_graph(hdfs_data[hdfs_id][action], container, hdfs_data[hdfs_id].min, hdfs_data[hdfs_id].max);
+    };
+	});
+
+  // Show the loading spinner when there is an ajax request taking place
+  $('.loading-spinner').on('ajaxStart', function(){
+    $(this).removeClass('hidden');
+  }).on('ajaxStop', function(){
+    $(this).addClass('hidden');
+  });
+
+    // Update the legend on crosshair show     
+  $(".graph").bind("plothover",  function (event, pos, item) {    
+    // grab the plot from the global store
+    var graph_definition = $(event.target).closest('.active').attr('id');
+    var pieces = graph_definition.split('_');
+    var plot = hdfs_data[pieces[1]][pieces[0]].plot
+    var show_offset = 15; // (in minutes)
+     
+    // get the datasets for searching
+    var axes = plot.getAxes();
+    var datasets = plot.getData();
+    var series = datasets[0];
+
+    // legend holder
+    var legends = $(this).closest('.graph_data').find('.axis-value');
+
+    // break if we are hovering off the viewport
+    if (pos.x < axes.xaxis.min || pos.x > axes.xaxis.max ||
+        pos.y < axes.yaxis.min || pos.y > axes.yaxis.max){
+      legends.text('');
+      return;
+    }
+
+    // find the nearest points, x-wise
+    // ToDo: Change this so that it only reads a val if it is within a certain distance
+    for (index = 0; index < series.data.length - 1; ++index)
+      if (series.data[index][0] + show_offset * 60 * 1000 > pos.x)
+        break;
+
+    // absolute distance from mouse to nearest point
+    var current_delta = Math.abs(pos.x - series.data[index][0]);
+
+    // if the point is more than 5 min away draw nothing
+    if ((current_delta / (1000 * 60)) > show_offset){
+      legends.text('');
+      return;
+    }
+            
+    // draw to the legend
+    for (plot_index = 0; plot_index < datasets.length; plot_index++){
+      var point = datasets[plot_index].data[index];
+      legends.eq(plot_index).text('(' + point[1].toFixed(2) + ')');
+    }
+  });
+
+  //------------- Page Elements -------------
+
+  /* 
+   * Creates the date slider
+   */
+  // $(".slider").dragslider({
+  //     range: true,
+  //     // allows for dragging of the range
+  //     rangeDrag: true,
+  //     // Max range
+  //     min: -1 * 60 * 24 * num_days_back,
+  //     // Min range (now)
+  //     max: 0,
+  //     // Starting selected range is the default
+  //     values: [-1 * default_range, 0],
+  //     // A new value has been picked
+  //     stop: function(event, ui) {
+  //       // grab the current hdfs_id
+  //       var hdfs_id = $(this).closest('.graph_instance').attr('id');
+  //       // set the values for the hdfs
+  //       hdfs_data[hdfs_id].min = ui.values[0];
+  //       hdfs_data[hdfs_id].max = ui.values[1];
+  //       // set the updating to false because a range was selected
+  //       hdfs_data[hdfs_id].updating = false;
+  //       // Sync the date fields with the range selected
+  //       sync_date_fields(hdfs_id);
+  //       // update the graph for this hdfs
+  //       update_live_graphs(hdfs_id);
+  //     },
+  //     // Update the date values while sliding (feedback for user)
+  //     slide: function(event, ui){
+  //       // grab the current hdfs_id
+  //       var hdfs_id = $(this).closest('.graph_instance').attr('id');
+  //       // Sync the date fields with the range selected
+  //       sync_date_fields(hdfs_id, ui.values[0], ui.values[1]);
+  //     }
+  //   });
+
+  $(".min-date").datetimepicker({
+    minDate: -1 * num_days_back,
+    defaultDate: -1,
+    onSelect: function (selectedDateTime){
+      // grab the current hdfs_id
+      var hdfs_id = $(this).closest('.graph_instance').attr('id');
+      // get the new date as minutes
+      var min_date = Math.round((new Date().getTime() - new Date(selectedDateTime).getTime()) / (-1 * 1000 * 60))
+      // set the new min range
+      hdfs_data[hdfs_id].min = min_date;
+      // set the updating to false because a range was selected
+      hdfs_data[hdfs_id].updating = false;
+      $(".max-date").datetimepicker("option", "minDate", new Date(selectedDateTime));
+      // reload the data
+      sync_slider(hdfs_id);
+      update_live_graphs(hdfs_id);
+    }
+  })
+
+  // Create the Date pickers for each graph
+  $(".max-date").datetimepicker({
+    // Earliest date available is the max of min-date
+    minDate: -1 * default_range / (60 * 24),
+    defaultDate: 0,
+    onSelect: function (selectedDateTime){
+      // grab the current hdfs_id
+      var hdfs_id = $(this).closest('.graph_instance').attr('id');
+      // get the new date as minutes
+      var max_date = Math.round((new Date().getTime() - new Date(selectedDateTime).getTime()) / (-1 * 1000 * 60));
+      // set the new min range
+      hdfs_data[hdfs_id].max = max_date;
+      // set the updating to false because a range was selected
+      hdfs_data[hdfs_id].updating = false;
+      $(".min-date").datetimepicker("option", "maxDate", new Date(selectedDateTime));
+      // reload the data
+      sync_slider(hdfs_id);
+      update_live_graphs(hdfs_id);
+    }
+  });
+});

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/688e9d08/contrib/blur-console-old/blur-admin/app/assets/javascripts/help.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console-old/blur-admin/app/assets/javascripts/help.js b/contrib/blur-console-old/blur-admin/app/assets/javascripts/help.js
new file mode 100644
index 0000000..03f2c1f
--- /dev/null
+++ b/contrib/blur-console-old/blur-admin/app/assets/javascripts/help.js
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+//= require jquery
+//= require_self
+
+$(document).ready(function(){
+  // toggles help sections on click
+  $('.help-section').on('click', function(){
+    $(this).children('.help-content').slideToggle('fast')
+  });
+  // remove the padding at the bottom of the help menu
+  $('body:has(#help-window)').css('padding-bottom', '0');
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/688e9d08/contrib/blur-console-old/blur-admin/app/assets/javascripts/placeholder.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console-old/blur-admin/app/assets/javascripts/placeholder.js b/contrib/blur-console-old/blur-admin/app/assets/javascripts/placeholder.js
new file mode 100644
index 0000000..606a95a
--- /dev/null
+++ b/contrib/blur-console-old/blur-admin/app/assets/javascripts/placeholder.js
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+$(document).ready(function() {
+  if (!Modernizr.input.placeholder) {
+    $('[placeholder]').focus(function() {
+      var input = $(this);
+      if (input.val() === input.attr('placeholder')) {
+        input.val('');
+        input.removeClass('placeholder');
+      }
+      if (input.attr('placeholder') === 'Password') input[0].type = 'password';
+    }).blur(function() {
+      var input = $(this);
+      if (input.val() === '' || input.val() === input.attr('placeholder')) {
+        input.addClass('placeholder');
+        input.val(input.attr('placeholder'));
+        if (input.attr('placeholder') === 'Password') input[0].type = 'text';
+      }
+    }).blur();
+    $('[placeholder]').parents('form').submit(function() {
+      $(this).find('[placeholder]').each(function() {
+      	var input = $(this);
+      	if (input.val() === input.attr('placeholder')) input.val('');
+      });
+    });
+  }
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/688e9d08/contrib/blur-console-old/blur-admin/app/assets/javascripts/search.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console-old/blur-admin/app/assets/javascripts/search.js b/contrib/blur-console-old/blur-admin/app/assets/javascripts/search.js
new file mode 100644
index 0000000..0fa6e92
--- /dev/null
+++ b/contrib/blur-console-old/blur-admin/app/assets/javascripts/search.js
@@ -0,0 +1,465 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+//= require jquery.dynatree
+
+$(document).ready(function() {
+  // PUSH STATE SEARCH QUERIES
+  // When the history is popped add the query and table
+  // then submit the query
+  window.onpopstate = function(e) {
+    if(e.state){
+      $('#blur_table').val(e.state.table_id);
+      $('#query_string').val(e.state.query);
+      $('#search_submit').click();
+    }
+  };
+
+  $('#search_form').on('submit', function(e) {
+    // if the browser doesnt support push state return
+    if (!Modernizr.history) {
+      return;
+    }
+
+    // History state object
+    var state = {
+      table_id: $('#blur_table').find('option:selected').val(),
+      query: $('#query_string').val()
+    };
+
+    // Build the new stateful query search
+    var stateful_url = '?table_id=' + state.table_id + '&query=' + encodeURIComponent(state.query);
+    var base_url = location.protocol + "//" + location.host + location.pathname;
+    var full_url = base_url + stateful_url;
+
+    // If the length is zero it is the first search
+    // and we want replace (avoid going back twice)
+    if(location.search.length === 0){
+      history.replaceState(state, "Search | Blur Console", full_url);
+    // Otherwise we need to check that we arent searching
+    // using the same query (dont push if it is the same)
+    } else if(location.search !== stateful_url){
+      history.pushState(state, "Search | Blur Console", full_url);
+    }
+  });
+
+  /********** METHODS **********/
+  var resizeSearch = function() {
+    var footerHeight, headerHeight, resultWrapper;
+    headerHeight = parseInt($('.navbar').css('height'));
+    footerHeight = parseInt($('#ft').css('height'));
+    resultWrapper = $('#results_wrapper');
+    $('#results_wrapper').css('max-height', window.innerHeight - (footerHeight + headerHeight + parseInt(resultWrapper.css('margin-top')) + 50));
+  };
+
+  var hide_all_tabs = function() {
+    $('.tab:visible').slideUp('fast');
+    $('.arrow_up').hide();
+    $('.arrow_down').show();
+  };
+
+  // method to initialize the filter tree
+  var setup_filter_tree = function() {
+    $('.column_family_filter').dynatree({
+      checkbox: true,
+      selectMode: 3,
+      initAjax: get_filter_ajax(),
+      onSelect: toggle_submit
+    });
+  };
+
+  var get_filter_ajax = function() {
+    return {
+      url: Routes.filters_zookeeper_searches_path(CurrentZookeeper, $('#blur_table').val(), {format: 'json'}),
+      type: 'get'
+    };
+  };
+
+  // Function to enable or disable submit button based on checkbox status
+  var toggle_submit = function() {
+    if ($(".column_family_filter").dynatree("getTree").getSelectedNodes().length > 0 && $('#query_string').val() !== '') {
+      $('#search_submit').removeAttr('disabled');
+      if ($('#save_name').val() !== '') {
+        $('#save_button, #update_button').removeAttr('disabled');
+      }
+    } else {
+      $('#save_button, #update_button, #search_submit').attr('disabled', 'disabled');
+    }
+  };
+
+  /********** PAGE ACTIONS **********/
+  // Setup the filters onload
+  $.ui.dynatree.nodedatadefaults["icon"] = false;
+  setup_filter_tree();
+  $(window).resize(function() {
+    var prevHeight;
+    if (prevHeight !== window.innerHeight) {
+      resizeSearch();
+    }
+    prevHeight = window.innerHeight;
+  });
+
+  /********** PAGE ELEMENT LISTENERS **********/
+  // Reload the filters when the table selector is changed
+  $('#blur_table').change(function() {
+    var prevMode, tree;
+    $(".column_family_filter").dynatree("option", "initAjax", get_filter_ajax());
+    tree = $(".column_family_filter").dynatree("getTree");
+    prevMode = tree.enableUpdate(false);
+    tree.reload();
+    tree.enableUpdate(prevMode);
+  });
+
+  // listener that checks if the submit button should be enabled on keystrokes
+  $('#query_string, #save_name').live("keydown", function(name) {
+    if (name.keyCode === 13 && !name.shiftKey) {
+      return name.preventDefault();
+    }
+  });
+
+  $('#query_string, #save_name').live("keyup", function(name) {
+    var error_content;
+    if (name.keyCode === 13 && !name.shiftKey) {
+      name.preventDefault();
+      if ($('#search_submit').attr('disabled')) {
+        error_content = '<div style="color:red;font-style:italic; font-weight:bold">Invalid query search.</div>';
+        $('#results_container').html(error_content);
+        $('#results_wrapper').removeClass('hidden');
+      } else {
+        $('#search_form').submit();
+      }
+    } else {
+      toggle_submit();
+    }
+  });
+
+  // listener that accordion the filter sections
+  $('.header').live('click', function() {
+    if ($('.tab:visible').length > 0) {
+      if ($(this).siblings('.tab:visible').length > 0) {
+        $(this).siblings('.tab:visible').slideUp('fast');
+        $(this).find('.arrow_up').hide();
+        $(this).find('.arrow_down').show();
+      } else {
+        $('.tab').slideToggle('fast');
+        $('.arrow').toggle();
+      }
+    } else {
+      $(this).siblings('.body').slideDown('fast');
+      $(this).find('.arrow_down').hide();
+      $(this).find('.arrow_up').show();
+    }
+  });
+
+  /********** more Functions **********/
+
+  var fetch_error = function(error) {
+    $('#results_container').html("<div class='no-results'>An error has occured: " + error + "</div>");
+    $('#results_wrapper').addClass('noResults').removeClass('hidden');
+  };
+
+  var no_results = function() {
+    $('#results_container').html('<div class="no-results">No results for your search.</div>');
+    $('#results_wrapper').addClass('noResults').removeClass('hidden');
+  };
+
+  // disable buttons on load
+  toggle_submit();
+  //set up listeners for ajax to show spinner and disable buttons
+  $('#loading-spinner').bind('ajaxStart', function() {
+    $(this).removeClass('hidden');
+  });
+  $('#loading-spinner').bind('ajaxStop', function() {
+    $(this).addClass('hidden');
+  });
+  $('#search_submit, #update_button, #save_button').bind('ajaxStart', function() {
+    $(this).attr('disabled', 'disabled');
+  });
+  $('#search_submit, #update_button, #save_button').bind('ajaxStop', function() {
+    toggle_submit();
+  });
+  $('html').live('click', function() {
+    hide_all_tabs();
+  });
+  $('.tab:visible, .header').live('click', function(e) {
+    return e.stopPropagation();
+  });
+
+  var populate_form = function(data) {
+    var column, _i, _len, _ref;
+    var oldTableName = $('#blur_table').val();
+    $(".column_family_filter").dynatree("getRoot").visit(function(node) {
+      return node.select(false);
+    });
+    $('#result_count').val(data.fetch);
+    $('#offset').val(data.offset);
+    $('#query_string').val(data.query);
+    $('#save_name').val(data.name);
+    //Checks to see if table still exists in hdfs before changing selector
+    if ($('#blur_table').find('option[value='+ data.blur_table_id + ']').length != 0){
+      $('#blur_table').val(data.blur_table_id);
+    }
+    /*
+    *This seems backwards, but the .change trigger was not firing when jQuery was changing the dropdown selector.
+    *This check forces the filter tree to refresh if the table changed
+    */
+    if (oldTableName != data.blur_table_id){
+      var prevMode, tree;
+      $(".column_family_filter").dynatree("option", "initAjax", get_filter_ajax());
+      tree = $(".column_family_filter").dynatree("getTree");
+      prevMode = tree.enableUpdate(false);
+      tree.reload();
+      tree.enableUpdate(prevMode);
+    }
+    if (data.super_query) {
+      $('#search_row').prop('checked', true);
+      $('#search_record').prop('checked', false);
+      $('#return_row').prop('checked', true);
+      $('#return_record').prop('checked', false).prop('disabled', true);
+    } else if (data.record_only) {
+      $('#search_row').prop('checked', false);
+      $('#search_record').prop('checked', true);
+      $('#return_row').prop('checked', false);
+      $('#return_record').prop('checked', true).prop('disabled', false);
+    } else {
+      $('#search_row').prop('checked', false);
+      $('#search_record').prop('checked', true);
+      $('#return_row').prop('checked', true);
+      $('#return_record').prop('checked', false).prop('disabled', false);
+    }
+    if (data.search_row) {
+      $('#search_row').click();
+    }
+    if (data.search_record) {
+      $('#search_record').click();
+    }
+    if (data.return_row) {
+      $('#return_row').click();
+    }
+    if (data.return_record) {
+      $('#return_record').click();
+    }
+    if (data.pre_filter){
+      $('#pre_filter').val(data.pre_filter);
+    }
+    if (data.post_filter){
+      $('#post_filter').val(data.post_filter);
+    }
+    //check everything in the tree
+    raw_columns = data.column_object;
+    for(index = 0; index < raw_columns.length; index++){
+      column = raw_columns[index];
+      $(".column_family_filter").dynatree("getTree").selectKey(column);
+    }
+
+    $('#search_submit').removeAttr('disabled');
+    $('#save_button').removeAttr('disabled');
+    $('#update_button').removeAttr('disabled');
+  };
+
+  var retrieve_search = function(id) {
+    $.ajax(Routes.search_path(id, {format: 'json'}), {
+      type: 'GET',
+      success: function(data) {
+        populate_form(data);
+      }
+    });
+  };
+
+   /********** PAGE AJAX LISTENERS **********/
+   // fetch the results of a new search
+  $('#search_form').submit(function() {
+    function runQuery(){
+      $('#results_wrapper').addClass('noResults').removeClass('hidden');
+      $('#results_wrapper').html('<div id="results_container"><div class="no-results">Loading...</div></div>');
+      $().closePopup();
+      $.ajax(Routes.fetch_results_zookeeper_searches_path(CurrentZookeeper, $('#blur_table').val()), {
+        data: form_data,
+        type: 'post',
+        success: function(data, status, xhr) {
+          if (data) {
+            $('#results_container').html(data);
+            resizeSearch();
+            $('#results_wrapper').removeClass('hidden noResults');
+          } else {
+            no_results();
+          }
+        },
+       error: function(xhr, status, error) {
+          fetch_error(error);
+        }
+      });
+    };
+
+    var form_data = $(this).serializeArray();
+    var tree = $('.column_family_filter').dynatree('getTree');
+    form_data = form_data.concat(tree.serializeArray());
+
+    if ($('#query_string').val().match(searchValidator.query)) {
+      var table = $('#blur_table option:selected').text();
+      if (!table.match(searchValidator.table)){
+        var buttons = {
+          "Ok": {
+            func: function() {
+              $().closePopup();
+            }
+          }
+        };
+        $().popup({
+          btns: buttons,
+          title: "Dangerous Query Detected",
+          titleClass: 'title',
+          body: "This query is not allowed on the \"" + table + "\" table, Please contact your admin for more information!"
+        });
+      } else {
+        var buttons = {
+        "Send Query": {
+          "class": 'primary',
+          func: runQuery
+        },
+          "Cancel": {
+            func: function() {
+              $().closePopup();
+            }
+          }
+        };
+
+        $().popup({
+          btns: buttons,
+          title: "Send this query?",
+          titleClass: 'title',
+          body: "This will run a potentially dangerous query on the \"" + table + "\" table, do you wish to continue?"
+        });
+      }
+    } else {
+      runQuery();
+    }
+    return false;
+  });
+
+  // ajax listener for the edit action
+  $('#edit_icon').live('click', function() {
+    retrieve_search($(this).parents('.search_element').attr('id'));
+    hide_all_tabs();
+  });
+
+  // ajax listener for the delete action
+  $('#delete_icon').live('click', function() {
+    var parent = $(this).parents('.search_element');
+    var buttons = {
+      "Delete Query": {
+        "class": 'primary',
+        func: function() {
+          $().closePopup();
+          $.ajax(Routes.search_path(parent.attr("id")), {
+            type: 'DELETE',
+            success: function(data) {
+              $('#saved .body .saved').html(data);
+            }
+          });
+        }
+      },
+    "Cancel": {
+        func: function() {
+          $().closePopup();
+        }
+      }
+    };
+    $().popup({
+      btns: buttons,
+      title: "Delete this saved query?",
+      titleClass: 'title',
+      body: "This will permanently delete the selected saved query. Do you wish to continue?"
+    });
+  });
+
+  //ajax listener for the save action
+  $('#save_button').live('click', function(evt) {
+    var form_data = $('#search_form').serializeArray();
+    var tree = $('.column_family_filter').dynatree('getTree');
+    form_data = form_data.concat(tree.serializeArray());
+    $.ajax(Routes.save_zookeeper_searches_path(CurrentZookeeper), {
+      type: 'POST',
+      data: form_data,
+      success: function(data) {
+        if (data) {
+          $('#searches').replaceWith(data);
+        }
+      }
+    });
+  });
+
+  //ajax listener for the update action
+  $('#update_button').live('click', function(evt) {
+    var match_found = false;
+    var send_request = false;
+    var search_id = "";
+    //if the name in the "name" field matches a search then we can update
+    $('.search_element').each(function(index, value) {
+      if ($.trim($(value).children('.search-name').text()) === $.trim($('#save_name').val())) {
+        //if we found another matching item do not send the update request
+        if (match_found) {
+          send_request = false;
+        }
+        send_request = true;
+        match_found = true;
+        search_id = $(value).attr('id');
+      }
+    });
+    if (send_request) {
+      var form_data = $('#search_form').serializeArray();
+      var tree = $('.column_family_filter').dynatree('getTree');
+      form_data = form_data.concat(tree.serializeArray());
+      $.ajax(Routes.search_path(search_id, {format: 'json'}), {
+        type: 'PUT',
+        data: form_data
+      });
+    } else {
+      if (match_found) {
+        var contentBody = "There are multiple saves with the same name.";
+      } else {
+        var contentBody = "There are no saved searches with that name.";
+      }
+      var message = "An error occurred while trying to update the saved search: " + contentBody + " To fix this error try changing the name.";
+      return $().popup({
+        title: 'Update Error',
+        titleClass: 'title',
+        body: message
+      });
+    }
+  });
+
+  //listener for the Search and Return Radiobuttons
+  $('#search_row, #search_record, #return_row, #return_record').live('change', function(evt) {
+    var search_row = $('#search_row');
+    var search_record = $('#search_record');
+    var return_row = $('#return_row');
+    var return_record = $('#return_record');
+    if (search_row[0] === $(this)[0]) {
+      search_record.prop('checked', false);
+      return_record.prop('checked', false);
+      return_record.prop('disabled', true);
+      return_row.prop('checked', true);
+    } else if (search_record[0] === $(this)[0]) {
+      search_row.prop('checked', false);
+      return_record.prop('disabled', false);
+    } else if (return_row[0] === $(this)[0]) {
+      return_record.prop('checked', false);
+    } else {
+      return_row.prop('checked', false);
+    }
+  });
+});

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/688e9d08/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates.js b/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates.js
new file mode 100644
index 0000000..5575c84
--- /dev/null
+++ b/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates.js
@@ -0,0 +1,17 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+//= require_tree ./templates
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/688e9d08/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/active_tables.jst.ejs
----------------------------------------------------------------------
diff --git a/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/active_tables.jst.ejs b/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/active_tables.jst.ejs
new file mode 100644
index 0000000..c03f692
--- /dev/null
+++ b/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/active_tables.jst.ejs
@@ -0,0 +1,36 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you 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.
+-->
+<% if (cluster.get('can_update')) { %>
+  <button class="btn btn-primary" disabled="disabled" data-action="disable">Disable Tables</button>
+<% } %>
+<table class="table table-striped table-bordered sortable" blur_cluster_id='<%= cluster.get('id') %>' id="active_tables">
+  <thead>
+    <tr>
+      <th class="checkbox-td sorttable_nosort"><input class="check-all" type="checkbox" disabled="disabled"/></th>
+      <th>Name</th>
+      <th class="sorttable_nosort">Comments</th>
+      <th class="sorttable_nosort">Hosts | Shards</th>
+      <th>Row Count</th>
+      <th>Record Count</th>
+      <th class="sorttable_nosort">Info</th>
+    </tr>
+  </thead>
+  <tbody class="active-table">
+  </tbody>
+</table>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/688e9d08/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/cluster_view.jst.ejs
----------------------------------------------------------------------
diff --git a/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/cluster_view.jst.ejs b/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/cluster_view.jst.ejs
new file mode 100644
index 0000000..7d2b414
--- /dev/null
+++ b/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/cluster_view.jst.ejs
@@ -0,0 +1,38 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you 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.
+-->
+<ul class="cluster-tabs nav-tabs nav" id="<%= 'inner-tabs-cluster_' + cluster.get('id') %>">
+  <li class="active">
+    <a href="<%= '#cluster_' + cluster.get('id') + '_active' %>" data-toggle="tab">
+      Active Tables ( <span class="active-counter"><%= cluster.get('tables').where({table: 'active'}).length %></span> )
+    </a>
+  </li>
+  <li>
+    <a href="<%= '#cluster_' + cluster.get('id') + '_disabled' %>" data-toggle="tab">
+      Disabled Tables ( <span class="disabled-counter"><%= cluster.get('tables').where({table: 'disabled'}).length %></span> )
+    </a>
+  </li>
+</ul>
+<div class="tab-content">
+  <div class="tab-pane active" id="<%= 'cluster_' + cluster.get('id') + '_active' %>" data-state="active">
+    <%= JST['templates/blur_table/active_tables']({cluster: cluster}) %>
+  </div>
+  <div class="tab-pane" id="<%= 'cluster_' + cluster.get('id') + '_disabled' %>" data-state="disabled">
+    <%= JST['templates/blur_table/disabled_tables']({cluster: cluster}) %>
+  </div>
+</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/688e9d08/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/comments.jst.ejs
----------------------------------------------------------------------
diff --git a/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/comments.jst.ejs b/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/comments.jst.ejs
new file mode 100644
index 0000000..eac5578
--- /dev/null
+++ b/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/comments.jst.ejs
@@ -0,0 +1,22 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you 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.
+-->
+<% { %>    
+    Comments:
+    <textarea id="comments" style="width: 75%;"><%=table.get('comments')%></textarea>
+<% } %>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/688e9d08/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/disabled_tables.jst.ejs
----------------------------------------------------------------------
diff --git a/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/disabled_tables.jst.ejs b/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/disabled_tables.jst.ejs
new file mode 100644
index 0000000..61fc3f9
--- /dev/null
+++ b/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/disabled_tables.jst.ejs
@@ -0,0 +1,35 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you 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.
+-->
+<% if (cluster.get('can_update')){ %>
+  <button class="btn btn-primary" disabled="disabled" data-action="enable">Enable Tables</button>
+  <button class="btn btn-danger" disabled="disabled" data-action="delete">Delete Tables</button>
+<% } %>
+<table class="table table-striped table-bordered sortable" blur_cluster_id='<%= cluster.get('id') %>' id="disabled_tables">
+  <thead>
+    <tr>
+      <th class="checkbox-td sorttable_nosort"><input class="check-all" type="checkbox" disabled="disabled"/></th>
+      <th>Name</th>
+			<th class="sorttable_nosort">Comments</th>
+      <th>Row Count</th>
+      <th>Record Count</th>
+    </tr>
+  </thead>
+  <tbody class="disabled-table">
+  </tbody>
+</table>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/688e9d08/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/hosts.jst.ejs
----------------------------------------------------------------------
diff --git a/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/hosts.jst.ejs b/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/hosts.jst.ejs
new file mode 100644
index 0000000..c0cf38b
--- /dev/null
+++ b/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/hosts.jst.ejs
@@ -0,0 +1,39 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you 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.
+-->
+<% if (hosts) { %>
+  <div class="host_wrap">
+    <h4>Hosts</h4>
+    <div class="hosts table_info_tree">
+      <ul>
+        <% _.each(hosts, function(shards, host){ %>
+          <li>
+            <a href=""><%= host %></a>
+            <ul>
+              <% _.each(shards, function(shard){ %>
+                <li><%= shard %></li>
+              <% }); %>
+            </ul>
+          </li>
+        <% }); %>
+      </ul>
+    </div>
+  </div>
+<% } else { %>
+  <div>Not Available</div>
+<% } %>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/688e9d08/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/schema.jst.ejs
----------------------------------------------------------------------
diff --git a/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/schema.jst.ejs b/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/schema.jst.ejs
new file mode 100644
index 0000000..7a5c71b
--- /dev/null
+++ b/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/schema.jst.ejs
@@ -0,0 +1,57 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you 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.
+-->
+<% if(schema){ %>
+  <div class="schema_wrap">
+    <h4>Location</h4>
+    <a href="<%= '/hdfs/' + table.get('cluster_id') + '/show/' + table.parse_uri('path') %>"><%= table.get('table_uri') %></a>
+    <h4>Schema</h4>
+    <div class="info table_info_tree">
+      <ul>
+        <% _.each(schema, function(family){ %>
+          <li>
+            <a href="#"><%= family.name %></a>
+            <ul>
+              <% _.each(family.columns, function(column){ %>
+                <li>
+                  <a href="#"><%= column.name %></a>
+                  <ul>
+                    <li><a href="#">Searchable?: <%= column.searchable %></a></li>
+                    <li><a href="#">Type: <%= column.analyzer %></a></li>
+                    <li><a href="#">Full Text?: <%= column.fullText %></a></li>
+                    <% if(column.searchable) { %>
+                      <li data-family_name="<%= family.name%>" data-column_name="<%= column.name %>">
+                        <a href="#">
+                          <span class="terms" data-family-name="<%= family.name %>" data-column-name="<%= column.name %>">
+                              View Terms
+                          </span>
+                        </a>
+                      </li>
+                    <% } %>
+                  </ul>
+                </li>
+              <% }); %>
+            </ul>
+          </li>
+        <% }); %>
+      </ul>
+    </div>
+  </div>
+<% } else { %>
+  <div> Not Available </div>
+<% } %>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/688e9d08/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/table_row.jst.ejs
----------------------------------------------------------------------
diff --git a/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/table_row.jst.ejs b/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/table_row.jst.ejs
new file mode 100644
index 0000000..8a01349
--- /dev/null
+++ b/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/table_row.jst.ejs
@@ -0,0 +1,68 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you 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.
+-->
+<% var state = table.get('state'); %>
+<% if (['disabling', 'enabling', 'deleting'].indexOf(state) >= 0){ %>
+  <% var colspan = table.colspan_lookup[table.get('table')]; %>
+  <td class='table-updating checkbox-td'>
+    <img id="loading-spinner" alt="Loading..." src="/assets/loader.gif"/>
+  </td>
+  <td colspan="<%= colspan %>"><%= table.capitalize_first(state) + ' ' + table.get('table_name') + '...' %></td>
+<% } else { %>
+  <td class='checkbox-td'>
+    <input class='bulk-action-checkbox' type='checkbox'/>
+  </td>
+  <td class='blur_table_name'>
+    <%= table.get('table_name') %>
+    <i class="icon-exclamation-sign queries-running-icon" title="Has been queried within last 5 minutes" style="<% if (!table.get('queried_recently')) { %><%= 'display:none' %><% } %>"></i>
+  </td>
+  <td class='comment_row' title= "<%= table.get('comments')%>" >
+    <%if (table.get('comments') != null) { %>
+      <% if (table.get('comments').length > 30) { %>
+        <%= table.get('comments').substring(0, 30) + "..." %>
+      <% }else { %>
+        <%= table.get('comments')%>
+      <% } %>
+    <% } %>
+    <a class='comments' href="#" style="float: right">
+      <button class="btn" type="submit" style="padding: 2px 5px"> <i class="icon-pencil"></i> </button>
+    </a>
+  </td>
+  <% if (state === 'active'){ %>
+    <td class='blur_table_hosts_shards'>
+      <a class='hosts' href="#">
+        <%= table.get('server_info') %>
+      </a>
+    </td>
+  <% } %>
+  <% if (state !== 'deleted'){ %>
+    <td class='blur_table_row_count'>
+      <%= table.get('row_count') %>
+    </td>
+    <td class='blur_table_record_count'>
+      <%= table.get('record_count') %>
+    </td>
+  <% } %>
+  <% if (state === 'active'){ %>
+    <td class='blur_table_info'>
+      <a class='info' href="#">
+        View
+      </a>
+    </td>
+  <% } %>
+<% } %>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/688e9d08/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/terms_list.jst.ejs
----------------------------------------------------------------------
diff --git a/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/terms_list.jst.ejs b/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/terms_list.jst.ejs
new file mode 100644
index 0000000..8f33341
--- /dev/null
+++ b/contrib/blur-console-old/blur-admin/app/assets/javascripts/templates/blur_table/terms_list.jst.ejs
@@ -0,0 +1,32 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you 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.
+-->
+<% if(terms.length > 0){ %>
+  <%_.each(terms, function(term){ %>
+    <li class="input-prepend term-li">
+      <span class="add-on search-term-link" term="<%= term %>">
+        <i class="icon-search"></i>
+      </span>
+      <span class="input uneditable-input term-input">
+        <span><%= term %></span>
+      </span>
+    </li>
+    <% }); %>
+<% } else { %>
+  <li class="no-items"> No terms matched your search conditions </li>
+<% } %>


Mime
View raw message