浏览代码

HUE-2470 [beeswax] DB Assist should load different Impala and Hive tables without hitting refresh

Prefixed totalStorage with the app name
Enrico Berti 11 年之前
父节点
当前提交
d3f2a58f67
共有 2 个文件被更改,包括 8 次插入3 次删除
  1. 1 0
      apps/beeswax/src/beeswax/templates/execute.mako
  2. 7 3
      apps/beeswax/static/js/autocomplete.utils.js

+ 1 - 0
apps/beeswax/src/beeswax/templates/execute.mako

@@ -978,6 +978,7 @@ var codeMirror, renderNavigator, resetNavigator, resizeNavigator, dataTable, ren
 var HIVE_AUTOCOMPLETE_BASE_URL = "${ autocomplete_base_url | n,unicode }";
 var HIVE_AUTOCOMPLETE_FAILS_QUIETLY_ON = [500]; // error codes from beeswax/views.py - autocomplete
 var HIVE_AUTOCOMPLETE_USER = "${ user }";
+var HIVE_AUTOCOMPLETE_APP = "${app_name}";
 
 var HIVE_AUTOCOMPLETE_GLOBAL_CALLBACK = function (data) {
   if (data != null && data.error && typeof resetNavigator != "undefined") {

+ 7 - 3
apps/beeswax/static/js/autocomplete.utils.js

@@ -58,11 +58,15 @@ function hac_getTableAliases(textScanned) {
   return _aliases;
 }
 
-function hac_getTotalStorageUserPrefix(){
+function hac_getTotalStorageUserPrefix() {
+  var _app = "";
+  if (typeof HIVE_AUTOCOMPLETE_APP != "undefined") {
+    _app = HIVE_AUTOCOMPLETE_APP;
+  }
   if (typeof HIVE_AUTOCOMPLETE_USER != "undefined") {
-    return HIVE_AUTOCOMPLETE_USER + "_";
+    return _app + "_" + HIVE_AUTOCOMPLETE_USER + "_";
   }
-  return "";
+  return (_app != "" ? _app + "_" : "");
 }
 
 function hac_getTableColumns(databaseName, tableName, textScanned, callback) {