You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by GitBox <gi...@apache.org> on 2018/04/23 07:11:12 UTC

[GitHub] chenzhx closed pull request #131: KYLIN-3343 support RDBMS on GUI

chenzhx closed pull request #131: KYLIN-3343 support RDBMS on GUI
URL: https://github.com/apache/kylin/pull/131
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/webapp/app/js/controllers/sourceMeta.js b/webapp/app/js/controllers/sourceMeta.js
index 49a9613a7d..8a795d58bd 100755
--- a/webapp/app/js/controllers/sourceMeta.js
+++ b/webapp/app/js/controllers/sourceMeta.js
@@ -260,6 +260,10 @@ KylinApp
       $scope.treeOptions = {multiSelection: true};
       $scope.selectedNodes = [];
       $scope.hiveLimit =  kylinConfig.getHiveLimit();
+      $scope.sourceType =  kylinConfig.getSourceType();
+      if ($scope.sourceType !== '0') {
+        $scope.isCalculate.val = false
+      }
 
       $scope.loadHive = function () {
         if($scope.hiveLoaded)
diff --git a/webapp/app/js/services/kylinProperties.js b/webapp/app/js/services/kylinProperties.js
index bd492bdf03..5b64f7a397 100644
--- a/webapp/app/js/services/kylinProperties.js
+++ b/webapp/app/js/services/kylinProperties.js
@@ -161,5 +161,12 @@ KylinApp.service('kylinConfig', function (AdminService, $log) {
     return false;
   }
 
+  this.getSourceType = function(){
+    this.sourceType = this.getProperty("kylin.source.default").trim();
+    if (!this.sourceType) {
+      return '0';
+    }
+    return this.sourceType;
+  }
 });
 
diff --git a/webapp/app/partials/tables/source_table_tree.html b/webapp/app/partials/tables/source_table_tree.html
index 30cfc8b7d1..059e01e0ab 100755
--- a/webapp/app/partials/tables/source_table_tree.html
+++ b/webapp/app/partials/tables/source_table_tree.html
@@ -25,8 +25,8 @@ <h3 class="text-info">Tables</h3>
         <!--button-->
         <div class="col-xs-5" style="padding-left: 0px;margin-top: 20px;">
             <div class="pull-right">
-              <a class="btn btn-xs btn-primary" tooltip="Load Hive Table"  ng-if="userService.hasRole('ROLE_ADMIN')|| hasPermission('project',projectModel, permissions.ADMINISTRATION.mask)"  ng-click="openModal()"><i class="fa fa-download"></i></a>
-              <a class="btn btn-xs btn-info" tooltip="Load Hive Table From Tree"  ng-if="userService.hasRole('ROLE_ADMIN')|| hasPermission('project',projectModel, permissions.ADMINISTRATION.mask)"  ng-click="openTreeModal()"><i class="fa fa-download"></i></a>
+              <a class="btn btn-xs btn-primary" tooltip="Load Table"  ng-if="userService.hasRole('ROLE_ADMIN')|| hasPermission('project',projectModel, permissions.ADMINISTRATION.mask)"  ng-click="openModal()"><i class="fa fa-download"></i></a>
+              <a class="btn btn-xs btn-info" tooltip="Load Table From Tree"  ng-if="userService.hasRole('ROLE_ADMIN')|| hasPermission('project',projectModel, permissions.ADMINISTRATION.mask)"  ng-click="openTreeModal()"><i class="fa fa-download"></i></a>
               <a class="btn btn-xs btn-primary" tooltip="Add Streaming Table"  ng-if="userService.hasRole('ROLE_ADMIN')|| hasPermission('project',projectModel, permissions.ADMINISTRATION.mask)"  ng-click="openStreamingSourceModal()"><i class="fa fa-area-chart"></i></a>
             </div>
         </div>
@@ -49,7 +49,7 @@ <h3 class="text-info">Tables</h3>
 
 <script type="text/ng-template" id="addHiveTableFromTree.html">
   <div class="modal-header"><button class="close" type="button" data-dismiss="modal" ng-click="cancel()">×</button>
-    <h4>Load Hive Table Metadata From Tree</h4>
+    <h4>Load Table Metadata From Tree</h4>
   </div>
   <div class="modal-body">
     <span><strong>Project: </strong>{{ $parent.projectName!=null?$parent.projectName:'NULL'}}</span>
@@ -63,7 +63,7 @@ <h4>Load Hive Table Metadata From Tree</h4>
       <button class="btn btn-xs btn-primary" ng-if="node.label==''&&node.id==65535" ng-click="showAllClicked($parentNode)">Show All</button>
       {{node.label}}
     </treecontrol>
-    <label><input type="checkbox" ng-model="isCalculate.val" > Calculate column cardinality</label>
+    <label ng-if="sourceType === '0'"><input type="checkbox" ng-model="isCalculate.val" > Calculate column cardinality</label>
   </div>
 
   <div class="modal-footer">
diff --git a/webapp/app/partials/tables/table_detail.html b/webapp/app/partials/tables/table_detail.html
index 33fdf70bf6..d8209a8e4d 100644
--- a/webapp/app/partials/tables/table_detail.html
+++ b/webapp/app/partials/tables/table_detail.html
@@ -47,7 +47,7 @@ <h3 class="text-info">Table Schema:{{ tableModel.selectedSrcTable.name}}</h3>
                 <td>{{ tableModel.selectedSrcTable.name}}</td>
               </tr>
               <tr>
-                <th>Hive DATABASE</th>
+                <th>DATABASE</th>
                 <td>{{tableModel.selectedSrcTable.database}}</td>
               </tr>
               <tr>
@@ -205,8 +205,8 @@ <h3 class="box-title">No tables</h3>
       </div>
       <div class="box-body">
         <div>
-          <a tooltip="Load Hive Table" href="javascript:void(0);" ng-if="userService.hasRole('ROLE_ADMIN') || hasPermission('project',projectModel, permissions.ADMINISTRATION.mask)"
-             ng-click="openModal()">Click here to load your hive table</a>
+          <a tooltip="Load Table" href="javascript:void(0);" ng-if="userService.hasRole('ROLE_ADMIN') || hasPermission('project',projectModel, permissions.ADMINISTRATION.mask)"
+             ng-click="openModal()">Click here to load your table</a>
         </div>
       </div>
       <!-- /.box-body -->
diff --git a/webapp/app/partials/tables/table_load.html b/webapp/app/partials/tables/table_load.html
index fe954ce73a..dd7c447adc 100644
--- a/webapp/app/partials/tables/table_load.html
+++ b/webapp/app/partials/tables/table_load.html
@@ -18,14 +18,14 @@
 
   <script type="text/ng-template" id="addHiveTable.html">
     <div class="modal-header">
-      <h4>Load Hive Table Metadata</h4>
+      <h4>Load Table Metadata</h4>
     </div>
     <div class="modal-body">
       <span><strong>Project: </strong>{{ $parent.projectName!=null?$parent.projectName:'NULL'}}</span>
       <label for="tables"> Table Names:(Separate with comma)</label>
             <textarea ng-model="$parent.tableNames" class="form-control" id="tables"
                       placeholder="table1,table2  By default,system will choose 'Default' as database,you can specify database like this 'database.table'"></textarea>
-      <label> <input type="checkbox" ng-model="isCalculate.val" > Calculate column cardinality</label>
+      <label ng-if="sourceType === '0'"> <input type="checkbox" ng-model="isCalculate.val" > Calculate column cardinality</label>
     </div>
     <div class="modal-footer">
       <button class="btn btn-primary" ng-click="add()">Sync</button>
@@ -109,7 +109,7 @@ <h4>Reload Table Metadata</h4>
   <div class="modal-body">
     <span><strong>Project: {{ $parent.projectName!=null?$parent.projectName:'NULL'}}</strong></span><br/>
     <label for="tables"> Are you sure to reload table {{selectTable}} ?</label><br/>
-    <label><input type="checkbox" ng-model="isCalculate.val" > Calculate column cardinality</label>
+    <label ng-if="sourceType === '0'"><input type="checkbox" ng-model="isCalculate.val" > Calculate column cardinality</label>
   </div>
   <div class="modal-footer">
     <button class="btn btn-primary" ng-click="confirmReload()">Sync</button>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services