You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ni...@apache.org on 2019/12/31 13:22:12 UTC

[kylin] branch master updated: KYLIN-4193 Support self defined Ts Pattern

This is an automated email from the ASF dual-hosted git repository.

nic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/master by this push:
     new 6ed4090  KYLIN-4193 Support self defined Ts Pattern
6ed4090 is described below

commit 6ed40905392e4d31e72e7745a14f898ed5fdfbd1
Author: nichunen <ni...@apache.org>
AuthorDate: Tue Dec 31 21:21:12 2019 +0800

    KYLIN-4193 Support self defined Ts Pattern
---
 webapp/app/js/controllers/sourceMeta.js                  | 13 +++++++++++++
 webapp/app/partials/tables/loadStreamingTableConfig.html |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/webapp/app/js/controllers/sourceMeta.js b/webapp/app/js/controllers/sourceMeta.js
index 918b075..1c538ea 100755
--- a/webapp/app/js/controllers/sourceMeta.js
+++ b/webapp/app/js/controllers/sourceMeta.js
@@ -27,6 +27,8 @@ KylinApp
     $scope.window = 0.68 * $window.innerHeight;
     $scope.tableConfig = tableConfig;
     $scope.isCalculate = true;
+    $scope.selectedTsPattern = '';
+    $scope.selfDefinedTsPattern = false;
 
     $scope.state = {
       filterAttr: 'id', filterReverse: false, reverseColumn: 'id',
@@ -1305,6 +1307,7 @@ KylinApp
           $scope.streaming.TSPatternArr = [];
           TableService.getSupportedDatetimePatterns({}, function (patterns) {
             $scope.streaming.TSPatternArr = patterns;
+            $scope.streaming.TSPatternArr.push('--- Other ---');
             $scope.streaming.TSPattern = 'yyyy-MM-dd HH:mm:ss.SSS';
           }, function (e) {
             return;
@@ -1312,6 +1315,16 @@ KylinApp
         }
       };
 
+      $scope.updateTsPatternOption = function(pattern) {
+        if (pattern === '--- Other ---') {
+          $scope.selfDefinedTsPattern = true;
+          $scope.streaming.TSPattern = '';
+        } else {
+          $scope.selfDefinedTsPattern = pattern;
+          $scope.selfDefinedTsPattern = false;
+        }
+      };
+
       $scope.saveStreamingSource = function() {
         $scope.streaming.errMsg = '';
 
diff --git a/webapp/app/partials/tables/loadStreamingTableConfig.html b/webapp/app/partials/tables/loadStreamingTableConfig.html
index c4cca0f..26cbeff 100644
--- a/webapp/app/partials/tables/loadStreamingTableConfig.html
+++ b/webapp/app/partials/tables/loadStreamingTableConfig.html
@@ -82,8 +82,9 @@
         <div class="form-group">
           <label for="TSPattern" class="col-sm-3 control-label font-color-default">TSPattern</label>
           <div class="col-sm-9">
-            <select id="TSPattern" chosen ng-model="streaming.TSPattern" ng-options="TSPattern as TSPattern for TSPattern in streaming.TSPatternArr" data-placeholder="select a time pattern" style="width: 360px !important;" class="chosen-select"></select>
+            <select id="TSPattern" chosen ng-model="selectedTsPattern" ng-options="TSPattern as TSPattern for TSPattern in streaming.TSPatternArr" data-placeholder="select a time pattern" style="width: 360px !important;" class="chosen-select" ng-change="updateTsPatternOption(selectedTsPattern)"></select>
           </div>
+          <input ng-if="selfDefinedTsPattern" type="text" id="RealTSPattern" ng-model="streaming.TSPattern" name="realTSPattern" style="margin-top:10px;margin-left:200px;width:360px" placeholder="Input Your TSPattern" required autofocus>
         </div>
 
         <div>