You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2015/05/27 06:34:32 UTC
[07/50] [abbrv] incubator-kylin git commit: KYLIN-722 format local js
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/filters/filter.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/filters/filter.js b/webapp/app/js/filters/filter.js
index 555e31d..7dff440 100755
--- a/webapp/app/js/filters/filter.js
+++ b/webapp/app/js/filters/filter.js
@@ -14,147 +14,149 @@
* 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.
-*/
+ */
'use strict';
/* Filters */
KylinApp
- .filter('orderObjectBy', function () {
- return function (input, attribute, reverse) {
- if (!angular.isObject(input)) return input;
+ .filter('orderObjectBy', function () {
+ return function (input, attribute, reverse) {
+ if (!angular.isObject(input)) return input;
- var array = [];
- for (var objectKey in input) {
- array.push(input[objectKey]);
- }
+ var array = [];
+ for (var objectKey in input) {
+ array.push(input[objectKey]);
+ }
- array.sort(function (a, b) {
- if (!attribute)
- {
- return 0;
- }
- var result = 0;
- var attriOfA = a, attriOfB = b;
- var temps = attribute.split(".");
- if (temps.length > 1) {
- angular.forEach(temps, function (temp, index) {
- attriOfA = attriOfA[temp];
- attriOfB = attriOfB[temp];
- });
- }
- else {
- attriOfA = a[attribute];
- attriOfB = b[attribute];
- }
-
- if (!attriOfA) {
- result = -1;
- }
- else if (!attriOfB) {
- result = 1;
- }
- else {
- result = attriOfA > attriOfB ? 1 : attriOfA < attriOfB ? -1 : 0;
- }
- return reverse ? -result : result;
- });
- return array;
+ array.sort(function (a, b) {
+ if (!attribute) {
+ return 0;
}
- })
-
- .filter('reverse', function () {
- return function (items) {
- if (items) {
- return items.slice().reverse();
- } else {
- return items;
- }
+ var result = 0;
+ var attriOfA = a, attriOfB = b;
+ var temps = attribute.split(".");
+ if (temps.length > 1) {
+ angular.forEach(temps, function (temp, index) {
+ attriOfA = attriOfA[temp];
+ attriOfB = attriOfB[temp];
+ });
}
- })
- .filter('range', function () {
- return function (input, total) {
- total = parseInt(total);
- for (var i = 0; i < total; i++)
- input.push(i);
- return input;
+ else {
+ attriOfA = a[attribute];
+ attriOfB = b[attribute];
}
- })
- // Convert bytes into human readable format.
- .filter('bytes', function() {
- return function(bytes, precision) {
- if (bytes === 0) { return '0 bytes' };
- if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) {
- return '-';
- }
-
- if (typeof precision === 'undefined') {
- precision = 1;
- }
- var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
- number = Math.floor(Math.log(bytes) / Math.log(1024));
- return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
+ if (!attriOfA) {
+ result = -1;
}
- }).filter('resizePieHeight',function(){
- return function(item){
- if(item<150){
- return 1300;
- }
- return 1300;
+ else if (!attriOfB) {
+ result = 1;
}
- }).filter('utcToConfigTimeZone',function($filter,kylinConfig){
+ else {
+ result = attriOfA > attriOfB ? 1 : attriOfA < attriOfB ? -1 : 0;
+ }
+ return reverse ? -result : result;
+ });
+ return array;
+ }
+ })
- var gmttimezone;
- //convert GMT+0 time to specified Timezone
- return function(item,timezone,format){
+ .filter('reverse', function () {
+ return function (items) {
+ if (items) {
+ return items.slice().reverse();
+ } else {
+ return items;
+ }
+ }
+ })
+ .filter('range', function () {
+ return function (input, total) {
+ total = parseInt(total);
+ for (var i = 0; i < total; i++)
+ input.push(i);
+ return input;
+ }
+ })
+ // Convert bytes into human readable format.
+ .filter('bytes', function () {
+ return function (bytes, precision) {
+ if (bytes === 0) {
+ return '0 bytes'
+ }
+ ;
+ if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) {
+ return '-';
+ }
- // undefined and 0 is not necessary to show
- if(angular.isUndefined(item)||item===0){
- return "";
- }
+ if (typeof precision === 'undefined') {
+ precision = 1;
+ }
- if(angular.isUndefined(timezone)||timezone===''){
- timezone = kylinConfig.getTimeZone()==""?'PST':kylinConfig.getTimeZone();
- }
- if(angular.isUndefined(format)||format===''){
- format ="yyyy-MM-dd HH:mm:ss";
- }
+ var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
+ number = Math.floor(Math.log(bytes) / Math.log(1024));
+ return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
+ }
+ }).filter('resizePieHeight', function () {
+ return function (item) {
+ if (item < 150) {
+ return 1300;
+ }
+ return 1300;
+ }
+ }).filter('utcToConfigTimeZone', function ($filter, kylinConfig) {
- //convert short name timezone to GMT
- switch(timezone){
- //convert PST to GMT
- case "PST":
- gmttimezone= "GMT-8";
- break;
- default:
- gmttimezone = timezone;
- }
+ var gmttimezone;
+ //convert GMT+0 time to specified Timezone
+ return function (item, timezone, format) {
- var localOffset = new Date().getTimezoneOffset();
- var convertedMillis = item;
- if(gmttimezone.indexOf("GMT+")!=-1){
- var offset = gmttimezone.substr(4,1);
- convertedMillis= item+offset*60*60000+localOffset*60000;
- }
- else if(gmttimezone.indexOf("GMT-")!=-1){
- var offset = gmttimezone.substr(4,1);
- convertedMillis= item-offset*60*60000+localOffset*60000;
- }
- else{
- // return PST by default
- timezone="PST";
- convertedMillis = item-8*60*60000+localOffset*60000;
- }
- return $filter('date')(convertedMillis, format)+ " "+timezone;
+ // undefined and 0 is not necessary to show
+ if (angular.isUndefined(item) || item === 0) {
+ return "";
+ }
- }
- }).filter('reverseToGMT0',function($filter){
- //backend store GMT+0 timezone ,by default front will show local,so convert to GMT+0 Date String format
- return function(item) {
- if(item||item==0){
- item += new Date().getTimezoneOffset() * 60000;
- return $filter('date')(item, "yyyy-MM-dd HH:mm:ss");
- }
- }
- });
+ if (angular.isUndefined(timezone) || timezone === '') {
+ timezone = kylinConfig.getTimeZone() == "" ? 'PST' : kylinConfig.getTimeZone();
+ }
+ if (angular.isUndefined(format) || format === '') {
+ format = "yyyy-MM-dd HH:mm:ss";
+ }
+
+ //convert short name timezone to GMT
+ switch (timezone) {
+ //convert PST to GMT
+ case "PST":
+ gmttimezone = "GMT-8";
+ break;
+ default:
+ gmttimezone = timezone;
+ }
+
+ var localOffset = new Date().getTimezoneOffset();
+ var convertedMillis = item;
+ if (gmttimezone.indexOf("GMT+") != -1) {
+ var offset = gmttimezone.substr(4, 1);
+ convertedMillis = item + offset * 60 * 60000 + localOffset * 60000;
+ }
+ else if (gmttimezone.indexOf("GMT-") != -1) {
+ var offset = gmttimezone.substr(4, 1);
+ convertedMillis = item - offset * 60 * 60000 + localOffset * 60000;
+ }
+ else {
+ // return PST by default
+ timezone = "PST";
+ convertedMillis = item - 8 * 60 * 60000 + localOffset * 60000;
+ }
+ return $filter('date')(convertedMillis, format) + " " + timezone;
+
+ }
+ }).filter('reverseToGMT0', function ($filter) {
+ //backend store GMT+0 timezone ,by default front will show local,so convert to GMT+0 Date String format
+ return function (item) {
+ if (item || item == 0) {
+ item += new Date().getTimezoneOffset() * 60000;
+ return $filter('date')(item, "yyyy-MM-dd HH:mm:ss");
+ }
+ }
+ });
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/listeners.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/listeners.js b/webapp/app/js/listeners.js
index 4524696..08a9bf9 100644
--- a/webapp/app/js/listeners.js
+++ b/webapp/app/js/listeners.js
@@ -14,82 +14,82 @@
* 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.
-*/
+ */
-KylinApp.run(function ($rootScope,$http, $location, UserService, AuthenticationService, MessageService,loadingRequest,SweetAlert) {
+KylinApp.run(function ($rootScope, $http, $location, UserService, AuthenticationService, MessageService, loadingRequest, SweetAlert) {
- $rootScope.permissions = {
- READ: {name: 'CUBE QUERY', value: 'READ', mask: 1},
- MANAGEMENT: {name: 'CUBE EDIT', value: 'MANAGEMENT', mask: 32},
- OPERATION: {name: 'CUBE OPERATION', value: 'OPERATION', mask: 64},
- ADMINISTRATION: {name: 'CUBE ADMIN', value: 'ADMINISTRATION', mask: 16}
- };
+ $rootScope.permissions = {
+ READ: {name: 'CUBE QUERY', value: 'READ', mask: 1},
+ MANAGEMENT: {name: 'CUBE EDIT', value: 'MANAGEMENT', mask: 32},
+ OPERATION: {name: 'CUBE OPERATION', value: 'OPERATION', mask: 64},
+ ADMINISTRATION: {name: 'CUBE ADMIN', value: 'ADMINISTRATION', mask: 16}
+ };
- $rootScope.$on("$routeChangeStart", function () {
- AuthenticationService.ping(function (data) {
- UserService.setCurUser(data);
- });
-
- if ($location.url() == '' || $location.url() == '/') {
- AuthenticationService.ping(function (data) {
- UserService.setCurUser(data);
- $location.path(UserService.getHomePage());
- });
- return;
- }
- });
-
- /**
- * Holds all the requests which failed due to 401 response.
- */
- $rootScope.requests401 = [];
-
- $rootScope.$on('event:loginRequired', function () {
- $rootScope.requests401 = [];
- $location.path('/login');
- loadingRequest.hide();
+ $rootScope.$on("$routeChangeStart", function () {
+ AuthenticationService.ping(function (data) {
+ UserService.setCurUser(data);
});
- /**
- * On 'event:loginConfirmed', resend all the 401 requests.
- */
- $rootScope.$on('event:loginConfirmed', function () {
- var i,
- requests = $rootScope.requests401,
- retry = function (req) {
- $http(req.config).then(function (response) {
- req.deferred.resolve(response);
- });
- };
+ if ($location.url() == '' || $location.url() == '/') {
+ AuthenticationService.ping(function (data) {
+ UserService.setCurUser(data);
+ $location.path(UserService.getHomePage());
+ });
+ return;
+ }
+ });
- for (i = 0; i < requests.length; i += 1) {
- retry(requests[i]);
- }
- $rootScope.requests401 = [];
- });
+ /**
+ * Holds all the requests which failed due to 401 response.
+ */
+ $rootScope.requests401 = [];
- /**
- * On 'logoutRequest' invoke logout on the server.
- */
- $rootScope.$on('event:logoutRequest', function () {
- httpHeaders.common['Authorization'] = null;
- });
+ $rootScope.$on('event:loginRequired', function () {
+ $rootScope.requests401 = [];
+ $location.path('/login');
+ loadingRequest.hide();
+ });
- if ($location.url() == '' || $location.url() == '/') {
- AuthenticationService.ping(function (data) {
- UserService.setCurUser(data);
- $location.path(UserService.getHomePage());
+ /**
+ * On 'event:loginConfirmed', resend all the 401 requests.
+ */
+ $rootScope.$on('event:loginConfirmed', function () {
+ var i,
+ requests = $rootScope.requests401,
+ retry = function (req) {
+ $http(req.config).then(function (response) {
+ req.deferred.resolve(response);
});
- return;
+ };
+
+ for (i = 0; i < requests.length; i += 1) {
+ retry(requests[i]);
}
+ $rootScope.requests401 = [];
+ });
- /**
- * On 'event:forbidden', resend all the 403 requests.
- */
- $rootScope.$on('event:forbidden', function (event, message) {
- var msg = !!(message) ? message : 'You don\' have right to take the action.';
- SweetAlert.swal('Oops...', 'Permission Denied: ' + msg, 'error');
+ /**
+ * On 'logoutRequest' invoke logout on the server.
+ */
+ $rootScope.$on('event:logoutRequest', function () {
+ httpHeaders.common['Authorization'] = null;
+ });
+ if ($location.url() == '' || $location.url() == '/') {
+ AuthenticationService.ping(function (data) {
+ UserService.setCurUser(data);
+ $location.path(UserService.getHomePage());
});
+ return;
+ }
+
+ /**
+ * On 'event:forbidden', resend all the 403 requests.
+ */
+ $rootScope.$on('event:forbidden', function (event, message) {
+ var msg = !!(message) ? message : 'You don\' have right to take the action.';
+ SweetAlert.swal('Oops...', 'Permission Denied: ' + msg, 'error');
+
+ });
});
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/model/cubeConfig.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/model/cubeConfig.js b/webapp/app/js/model/cubeConfig.js
index ecdd316..d284f00 100644
--- a/webapp/app/js/model/cubeConfig.js
+++ b/webapp/app/js/model/cubeConfig.js
@@ -1,74 +1,74 @@
-/*
- * 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.
-*/
-
-KylinApp.constant('cubeConfig', {
-
- //~ Define metadata & class
- measureParamType : ['column', 'constant'],
- measureExpressions : ['SUM', 'MIN', 'MAX', 'COUNT', 'COUNT_DISTINCT'],
- dimensionDataTypes : ["string", "tinyint", "int", "bigint", "date"],
- cubeCapacities : ["SMALL", "MEDIUM","LARGE"],
-// cubePartitionTypes : ['APPEND', 'UPDATE_INSERT'],
- cubePartitionTypes : ['APPEND'],
- joinTypes : [
- {name: 'Left', value: 'left'},
- {name: 'Inner', value: 'inner'},
- {name: 'Right', value: 'right'}
- ],
- queryPriorities : [
- {name: 'NORMAL', value: 50},
- {name: 'LOW', value: 70},
- {name: 'HIGH', value: 30}
- ],
- measureDataTypes : [
- {name: 'INT', value: 'int'},
- {name: 'BIGINT', value: 'bigint'},
- {name: 'DECIMAL', value: 'decimal'},
- {name: 'DOUBLE', value: 'double'},
- {name: 'DATE', value: 'date'},
- {name: 'STRING', value: 'string'}
- ],
- distinctDataTypes : [
- {name: 'Error Rate < 9.75%', value: 'hllc10'},
- {name: 'Error Rate < 4.88%', value: 'hllc12'},
- {name: 'Error Rate < 2.44%', value: 'hllc14'},
- {name: 'Error Rate < 1.72%', value: 'hllc15'},
- {name: 'Error Rate < 1.22%', value: 'hllc16'}
- ],
- dftSelections : {
- measureExpression: 'SUM',
- measureParamType: 'column',
- measureDataType: {name: 'BIGINT', value: 'bigint'},
- distinctDataType: {name: 'Error Rate < 4.88%', value: 'hllc12'},
- cubeCapacity: 'MEDIUM',
- queryPriority: {name: 'NORMAL', value: 50},
- cubePartitionType: 'APPEND'
- },
- dictionaries : ["true", "false"],
-
-// cubes config
- theaditems : [
- {attr: 'name', name: 'Name'},
- {attr: 'status', name: 'Status'},
- {attr: 'size_kb', name: 'Cube Size'},
- {attr: 'source_records_count', name: 'Source Records'},
- {attr: 'last_build_time', name: 'Last Build Time'},
- {attr: 'owner', name: 'Owner'},
- {attr: 'create_time', name: 'Create Time'}
- ]
- });
+/*
+ * 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.
+ */
+
+KylinApp.constant('cubeConfig', {
+
+ //~ Define metadata & class
+ measureParamType: ['column', 'constant'],
+ measureExpressions: ['SUM', 'MIN', 'MAX', 'COUNT', 'COUNT_DISTINCT'],
+ dimensionDataTypes: ["string", "tinyint", "int", "bigint", "date"],
+ cubeCapacities: ["SMALL", "MEDIUM", "LARGE"],
+// cubePartitionTypes : ['APPEND', 'UPDATE_INSERT'],
+ cubePartitionTypes: ['APPEND'],
+ joinTypes: [
+ {name: 'Left', value: 'left'},
+ {name: 'Inner', value: 'inner'},
+ {name: 'Right', value: 'right'}
+ ],
+ queryPriorities: [
+ {name: 'NORMAL', value: 50},
+ {name: 'LOW', value: 70},
+ {name: 'HIGH', value: 30}
+ ],
+ measureDataTypes: [
+ {name: 'INT', value: 'int'},
+ {name: 'BIGINT', value: 'bigint'},
+ {name: 'DECIMAL', value: 'decimal'},
+ {name: 'DOUBLE', value: 'double'},
+ {name: 'DATE', value: 'date'},
+ {name: 'STRING', value: 'string'}
+ ],
+ distinctDataTypes: [
+ {name: 'Error Rate < 9.75%', value: 'hllc10'},
+ {name: 'Error Rate < 4.88%', value: 'hllc12'},
+ {name: 'Error Rate < 2.44%', value: 'hllc14'},
+ {name: 'Error Rate < 1.72%', value: 'hllc15'},
+ {name: 'Error Rate < 1.22%', value: 'hllc16'}
+ ],
+ dftSelections: {
+ measureExpression: 'SUM',
+ measureParamType: 'column',
+ measureDataType: {name: 'BIGINT', value: 'bigint'},
+ distinctDataType: {name: 'Error Rate < 4.88%', value: 'hllc12'},
+ cubeCapacity: 'MEDIUM',
+ queryPriority: {name: 'NORMAL', value: 50},
+ cubePartitionType: 'APPEND'
+ },
+ dictionaries: ["true", "false"],
+
+// cubes config
+ theaditems: [
+ {attr: 'name', name: 'Name'},
+ {attr: 'status', name: 'Status'},
+ {attr: 'size_kb', name: 'Cube Size'},
+ {attr: 'source_records_count', name: 'Source Records'},
+ {attr: 'last_build_time', name: 'Last Build Time'},
+ {attr: 'owner', name: 'Owner'},
+ {attr: 'create_time', name: 'Create Time'}
+ ]
+});
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/model/cubesManager.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/model/cubesManager.js b/webapp/app/js/model/cubesManager.js
index f8e9cd8..91481ca 100644
--- a/webapp/app/js/model/cubesManager.js
+++ b/webapp/app/js/model/cubesManager.js
@@ -17,7 +17,7 @@
*/
// TODO add cubes manager
-KylinApp.service('cubesManager',function(){
+KylinApp.service('cubesManager', function () {
this.currentCube = {};
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/model/jobConfig.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/model/jobConfig.js b/webapp/app/js/model/jobConfig.js
index 0d59762..2e74845 100644
--- a/webapp/app/js/model/jobConfig.js
+++ b/webapp/app/js/model/jobConfig.js
@@ -14,23 +14,23 @@
* 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.
-*/
+ */
KylinApp.constant('jobConfig', {
- allStatus : [
- {name: 'NEW', value: 0},
- {name: 'PENDING', value: 1},
- {name: 'RUNNING', value: 2},
- {name: 'FINISHED', value: 4},
- {name: 'ERROR', value: 8},
- {name: 'DISCARDED', value: 16}
- ],
- theaditems : [
- {attr: 'name', name: 'Job Name'},
- {attr: 'related_cube', name: 'Cube'},
- {attr: 'progress', name: 'Progress'},
- {attr: 'last_modified', name: 'Last Modified Time'},
- {attr: 'duration', name: 'Duration'}
- ]
+ allStatus: [
+ {name: 'NEW', value: 0},
+ {name: 'PENDING', value: 1},
+ {name: 'RUNNING', value: 2},
+ {name: 'FINISHED', value: 4},
+ {name: 'ERROR', value: 8},
+ {name: 'DISCARDED', value: 16}
+ ],
+ theaditems: [
+ {attr: 'name', name: 'Job Name'},
+ {attr: 'related_cube', name: 'Cube'},
+ {attr: 'progress', name: 'Progress'},
+ {attr: 'last_modified', name: 'Last Modified Time'},
+ {attr: 'duration', name: 'Duration'}
+ ]
});
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/model/projectConfig.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/model/projectConfig.js b/webapp/app/js/model/projectConfig.js
index aba9909..270eb7a 100644
--- a/webapp/app/js/model/projectConfig.js
+++ b/webapp/app/js/model/projectConfig.js
@@ -14,14 +14,14 @@
* 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.
-*/
+ */
KylinApp.constant('projectConfig', {
- theaditems : [
- {attr: 'name', name: 'Name'},
- {attr: 'owner', name: 'Owner'},
- {attr: 'description', name: 'Description'},
- {attr: 'create_time', name: 'Create Time'}
- ]
+ theaditems: [
+ {attr: 'name', name: 'Name'},
+ {attr: 'owner', name: 'Owner'},
+ {attr: 'description', name: 'Description'},
+ {attr: 'create_time', name: 'Create Time'}
+ ]
});
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/model/tableConfig.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/model/tableConfig.js b/webapp/app/js/model/tableConfig.js
index 90f76aa..f994b09 100644
--- a/webapp/app/js/model/tableConfig.js
+++ b/webapp/app/js/model/tableConfig.js
@@ -14,14 +14,14 @@
* 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.
-*/
+ */
KylinApp.constant('tableConfig', {
- theaditems : [
- {attr: 'id', name: 'ID'},
- {attr: 'name', name: 'Name'},
- {attr: 'datatype', name: 'Data Type'},
- {attr: 'cardinality', name: 'Cardinality'}
- ]
+ theaditems: [
+ {attr: 'id', name: 'ID'},
+ {attr: 'name', name: 'Name'},
+ {attr: 'datatype', name: 'Data Type'},
+ {attr: 'cardinality', name: 'Cardinality'}
+ ]
});
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/services/access.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/services/access.js b/webapp/app/js/services/access.js
index cdb74f5..5dabaa4 100644
--- a/webapp/app/js/services/access.js
+++ b/webapp/app/js/services/access.js
@@ -14,13 +14,13 @@
* 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.
-*/
+ */
KylinApp.factory('AccessService', ['$resource', function ($resource, config) {
- return $resource(Config.service.url + 'access/:type/:uuid', {}, {
- list: {method: 'GET', params: {}, isArray: true},
- grant: {method: 'POST', params: {}, isArray: true},
- update: {method: 'PUT', params: {}, isArray: true},
- revoke: {method: 'DELETE', params: {}, isArray: false}
- });
+ return $resource(Config.service.url + 'access/:type/:uuid', {}, {
+ list: {method: 'GET', params: {}, isArray: true},
+ grant: {method: 'POST', params: {}, isArray: true},
+ update: {method: 'PUT', params: {}, isArray: true},
+ revoke: {method: 'DELETE', params: {}, isArray: false}
+ });
}]);
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/services/admin.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/services/admin.js b/webapp/app/js/services/admin.js
index ac57bd1..47dce92 100644
--- a/webapp/app/js/services/admin.js
+++ b/webapp/app/js/services/admin.js
@@ -14,13 +14,13 @@
* 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.
-*/
+ */
KylinApp.factory('AdminService', ['$resource', function ($resource, config) {
- return $resource(Config.service.url + 'admin/:action', {}, {
- env: {method: 'GET', params: {action: 'env'}, isArray: false},
- config: {method: 'GET', params: {action: 'config'}, isArray: false},
- cleanStorage: {method: 'DELETE', params:{action: 'storage'}, isArray: false},
- updateConfig: {method: 'PUT', params:{action: 'config'}, isArray:false}
- });
+ return $resource(Config.service.url + 'admin/:action', {}, {
+ env: {method: 'GET', params: {action: 'env'}, isArray: false},
+ config: {method: 'GET', params: {action: 'config'}, isArray: false},
+ cleanStorage: {method: 'DELETE', params: {action: 'storage'}, isArray: false},
+ updateConfig: {method: 'PUT', params: {action: 'config'}, isArray: false}
+ });
}]);
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/services/auth.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/services/auth.js b/webapp/app/js/services/auth.js
index b639c58..3970b0d 100644
--- a/webapp/app/js/services/auth.js
+++ b/webapp/app/js/services/auth.js
@@ -14,12 +14,12 @@
* 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.
-*/
+ */
KylinApp.factory('AuthenticationService', ['$resource', function ($resource, config) {
- return $resource(Config.service.url + 'user/authentication/:action', {}, {
- ping: {method: 'GET', params: {}, isArray: false},
- login: {method: 'POST', params: {}, isArray: false},
- authorities: {method: 'GET', params: {action: 'authorities'}, cache: true, isArray: false}
- });
+ return $resource(Config.service.url + 'user/authentication/:action', {}, {
+ ping: {method: 'GET', params: {}, isArray: false},
+ login: {method: 'POST', params: {}, isArray: false},
+ authorities: {method: 'GET', params: {action: 'authorities'}, cache: true, isArray: false}
+ });
}]);
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/services/cache.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/services/cache.js b/webapp/app/js/services/cache.js
index b8481c4..b61a179 100644
--- a/webapp/app/js/services/cache.js
+++ b/webapp/app/js/services/cache.js
@@ -14,10 +14,10 @@
* 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.
-*/
+ */
KylinApp.factory('CacheService', ['$resource', function ($resource, config) {
- return $resource(Config.service.url + 'cache/:type/:name/:action', {}, {
- clean: {method: 'PUT', params: {type:'all', name:'all', action: 'update'}, isArray: false}
- });
+ return $resource(Config.service.url + 'cache/:type/:name/:action', {}, {
+ clean: {method: 'PUT', params: {type: 'all', name: 'all', action: 'update'}, isArray: false}
+ });
}]);
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/services/cubeDesc.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/services/cubeDesc.js b/webapp/app/js/services/cubeDesc.js
index b101dae..09700c1 100644
--- a/webapp/app/js/services/cubeDesc.js
+++ b/webapp/app/js/services/cubeDesc.js
@@ -14,10 +14,10 @@
* 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.
-*/
+ */
KylinApp.factory('CubeDescService', ['$resource', function ($resource, config) {
- return $resource(Config.service.url + 'cube_desc/:cube_name/:propName/:propValue/:action', {}, {
- get: {method: 'GET', params: {}, isArray: true}
- });
+ return $resource(Config.service.url + 'cube_desc/:cube_name/:propName/:propValue/:action', {}, {
+ get: {method: 'GET', params: {}, isArray: true}
+ });
}])
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/services/cubes.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/services/cubes.js b/webapp/app/js/services/cubes.js
index d5782d2..3431c9a 100644
--- a/webapp/app/js/services/cubes.js
+++ b/webapp/app/js/services/cubes.js
@@ -14,22 +14,22 @@
* 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.
-*/
+ */
KylinApp.factory('CubeService', ['$resource', function ($resource, config) {
- return $resource(Config.service.url + 'cubes/:cubeId/:propName/:propValue/:action', {}, {
- list: {method: 'GET', params: {}, isArray: true},
- getSql: {method: 'GET', params: {propName: 'segs', action: 'sql'}, isArray: false},
- updateNotifyList: {method: 'PUT', params: {propName: 'notify_list'}, isArray: false},
- cost: {method: 'PUT', params: {action: 'cost'}, isArray: false},
- rebuildLookUp: {method: 'PUT', params: {propName: 'segs', action: 'refresh_lookup'}, isArray: false},
- rebuildCube: {method: 'PUT', params: {action: 'rebuild'}, isArray: false},
- disable: {method: 'PUT', params: {action: 'disable'}, isArray: false},
- enable: {method: 'PUT', params: {action: 'enable'}, isArray: false},
- purge: {method: 'PUT', params: {action: 'purge'}, isArray: false},
- drop: {method: 'DELETE', params: {}, isArray: false},
- save: {method: 'POST', params: {}, isArray: false},
- update: {method: 'PUT', params: {}, isArray: false},
- getHbaseInfo: {method: 'GET', params: {propName: 'hbase'}, isArray: true}
- });
+ return $resource(Config.service.url + 'cubes/:cubeId/:propName/:propValue/:action', {}, {
+ list: {method: 'GET', params: {}, isArray: true},
+ getSql: {method: 'GET', params: {propName: 'segs', action: 'sql'}, isArray: false},
+ updateNotifyList: {method: 'PUT', params: {propName: 'notify_list'}, isArray: false},
+ cost: {method: 'PUT', params: {action: 'cost'}, isArray: false},
+ rebuildLookUp: {method: 'PUT', params: {propName: 'segs', action: 'refresh_lookup'}, isArray: false},
+ rebuildCube: {method: 'PUT', params: {action: 'rebuild'}, isArray: false},
+ disable: {method: 'PUT', params: {action: 'disable'}, isArray: false},
+ enable: {method: 'PUT', params: {action: 'enable'}, isArray: false},
+ purge: {method: 'PUT', params: {action: 'purge'}, isArray: false},
+ drop: {method: 'DELETE', params: {}, isArray: false},
+ save: {method: 'POST', params: {}, isArray: false},
+ update: {method: 'PUT', params: {}, isArray: false},
+ getHbaseInfo: {method: 'GET', params: {propName: 'hbase'}, isArray: true}
+ });
}]);
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/services/graph.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/services/graph.js b/webapp/app/js/services/graph.js
index fb98ad1..b191c50 100644
--- a/webapp/app/js/services/graph.js
+++ b/webapp/app/js/services/graph.js
@@ -14,33 +14,33 @@
* 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.
-*/
+ */
KylinApp.service('GraphService', function (GraphBuilder) {
- this.buildGraph = function (query) {
- var graphData = null;
- var dimension = query.graph.state.dimensions;
+ this.buildGraph = function (query) {
+ var graphData = null;
+ var dimension = query.graph.state.dimensions;
- if (dimension && query.graph.type.dimension.types.indexOf(dimension.type) > -1) {
- var metricsList = [];
- metricsList = metricsList.concat(query.graph.state.metrics);
- angular.forEach(metricsList, function (metrics, index) {
- var aggregatedData = {};
- angular.forEach(query.result.results, function (data, index) {
- aggregatedData[data[dimension.index]] = (!!aggregatedData[data[dimension.index]] ? aggregatedData[data[dimension.index]] : 0)
- + parseFloat(data[metrics.index].replace(/[^\d\.\-]/g, ""));
- });
+ if (dimension && query.graph.type.dimension.types.indexOf(dimension.type) > -1) {
+ var metricsList = [];
+ metricsList = metricsList.concat(query.graph.state.metrics);
+ angular.forEach(metricsList, function (metrics, index) {
+ var aggregatedData = {};
+ angular.forEach(query.result.results, function (data, index) {
+ aggregatedData[data[dimension.index]] = (!!aggregatedData[data[dimension.index]] ? aggregatedData[data[dimension.index]] : 0)
+ + parseFloat(data[metrics.index].replace(/[^\d\.\-]/g, ""));
+ });
- var newData = GraphBuilder["build" + capitaliseFirstLetter(query.graph.type.value) + "Graph"](dimension, metrics, aggregatedData);
- graphData = (!!graphData) ? graphData.concat(newData) : newData;
- });
- }
-
- return graphData;
+ var newData = GraphBuilder["build" + capitaliseFirstLetter(query.graph.type.value) + "Graph"](dimension, metrics, aggregatedData);
+ graphData = (!!graphData) ? graphData.concat(newData) : newData;
+ });
}
- function capitaliseFirstLetter(string) {
- return string.charAt(0).toUpperCase() + string.slice(1);
- }
+ return graphData;
+ }
+
+ function capitaliseFirstLetter(string) {
+ return string.charAt(0).toUpperCase() + string.slice(1);
+ }
});
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/services/jobs.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/services/jobs.js b/webapp/app/js/services/jobs.js
index 55d2248..c0f297b 100644
--- a/webapp/app/js/services/jobs.js
+++ b/webapp/app/js/services/jobs.js
@@ -14,14 +14,14 @@
* 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.
-*/
+ */
KylinApp.factory('JobService', ['$resource', function ($resource, config) {
- return $resource(Config.service.url + 'jobs/:jobId/:propName/:propValue/:action', {}, {
- list: {method: 'GET', params: {}, isArray: true},
- get: {method: 'GET', params: {}, isArray: false},
- stepOutput: {method: 'GET', params: {propName: 'steps', action: 'output'}, isArray: false},
- resume: {method: 'PUT', params: {action: 'resume'}, isArray: false},
- cancel: {method: 'PUT', params: {action: 'cancel'}, isArray: false}
- });
+ return $resource(Config.service.url + 'jobs/:jobId/:propName/:propValue/:action', {}, {
+ list: {method: 'GET', params: {}, isArray: true},
+ get: {method: 'GET', params: {}, isArray: false},
+ stepOutput: {method: 'GET', params: {propName: 'steps', action: 'output'}, isArray: false},
+ resume: {method: 'PUT', params: {action: 'resume'}, isArray: false},
+ cancel: {method: 'PUT', params: {action: 'cancel'}, isArray: false}
+ });
}]);
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/services/kylinProperties.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/services/kylinProperties.js b/webapp/app/js/services/kylinProperties.js
index 0f8129b..76b8087 100644
--- a/webapp/app/js/services/kylinProperties.js
+++ b/webapp/app/js/services/kylinProperties.js
@@ -1,78 +1,78 @@
-/*
- * 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.
-*/
-
-KylinApp.service('kylinConfig', function(AdminService,$log) {
- var _config;
- var timezone;
- var deployEnv;
-
-
- this.init = function (){
- return AdminService.config({}, function(config){
- _config = config.config;
- },function(e){
- $log.error("failed to load kylin.properties"+e);
- });
- };
-
- this.getProperty = function(name){
- var keyIndex = _config.indexOf(name);
- var keyLength = name.length;
- var partialResult = _config.substr(keyIndex);
- var preValueIndex = partialResult.indexOf("=");
- var sufValueIndex = partialResult.indexOf("\n");
- return partialResult.substring(preValueIndex+1,sufValueIndex);
-
- }
-
- this.getTimeZone = function(){
- if(!this.timezone){
- this.timezone = this.getProperty("kylin.rest.timezone").trim();
- }
- return this.timezone;
- }
-
- this.getDeployEnv = function(){
- if(!this.deployEnv){
- this.deployEnv = this.getProperty("deploy.env").trim();
- }
- return this.deployEnv.toUpperCase();
- }
-
- //fill config info for Config from backend
- this.initWebConfigInfo = function(){
-
- try{
- Config.reference_links.hadoop.link = this.getProperty("kylin.web.hadoop").trim();
- Config.reference_links.diagnostic.link = this.getProperty("kylin.web.diagnostic").trim();
- Config.contact_mail = this.getProperty("kylin.web.contact_mail").trim();
- var doc_length = this.getProperty("kylin.web.help.length").trim();
- for(var i=0;i<doc_length;i++){
- var _doc = {};
- _doc.name = this.getProperty("kylin.web.help."+i).trim().split("|")[0];
- _doc.displayName = this.getProperty("kylin.web.help."+i).trim().split("|")[1];
- _doc.link = this.getProperty("kylin.web.help."+i).trim().split("|")[2];
- Config.documents.push(_doc);
- }
- }catch(e){
- $log.error("failed to load kylin web info");
- }
- }
-
-});
-
+/*
+ * 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.
+ */
+
+KylinApp.service('kylinConfig', function (AdminService, $log) {
+ var _config;
+ var timezone;
+ var deployEnv;
+
+
+ this.init = function () {
+ return AdminService.config({}, function (config) {
+ _config = config.config;
+ }, function (e) {
+ $log.error("failed to load kylin.properties" + e);
+ });
+ };
+
+ this.getProperty = function (name) {
+ var keyIndex = _config.indexOf(name);
+ var keyLength = name.length;
+ var partialResult = _config.substr(keyIndex);
+ var preValueIndex = partialResult.indexOf("=");
+ var sufValueIndex = partialResult.indexOf("\n");
+ return partialResult.substring(preValueIndex + 1, sufValueIndex);
+
+ }
+
+ this.getTimeZone = function () {
+ if (!this.timezone) {
+ this.timezone = this.getProperty("kylin.rest.timezone").trim();
+ }
+ return this.timezone;
+ }
+
+ this.getDeployEnv = function () {
+ if (!this.deployEnv) {
+ this.deployEnv = this.getProperty("deploy.env").trim();
+ }
+ return this.deployEnv.toUpperCase();
+ }
+
+ //fill config info for Config from backend
+ this.initWebConfigInfo = function () {
+
+ try {
+ Config.reference_links.hadoop.link = this.getProperty("kylin.web.hadoop").trim();
+ Config.reference_links.diagnostic.link = this.getProperty("kylin.web.diagnostic").trim();
+ Config.contact_mail = this.getProperty("kylin.web.contact_mail").trim();
+ var doc_length = this.getProperty("kylin.web.help.length").trim();
+ for (var i = 0; i < doc_length; i++) {
+ var _doc = {};
+ _doc.name = this.getProperty("kylin.web.help." + i).trim().split("|")[0];
+ _doc.displayName = this.getProperty("kylin.web.help." + i).trim().split("|")[1];
+ _doc.link = this.getProperty("kylin.web.help." + i).trim().split("|")[2];
+ Config.documents.push(_doc);
+ }
+ } catch (e) {
+ $log.error("failed to load kylin web info");
+ }
+ }
+
+});
+
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/services/message.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/services/message.js b/webapp/app/js/services/message.js
index 7c8fabd..9bed2d5 100644
--- a/webapp/app/js/services/message.js
+++ b/webapp/app/js/services/message.js
@@ -14,44 +14,44 @@
* 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.
-*/
+ */
KylinApp.service('MessageService', ['config_ui_messenger', function (config_ui_messenger,$log) {
- this.sendMsg = function (msg, type, actions, sticky, position) {
- var options = {
- 'theme': config_ui_messenger.theme
- };
+ this.sendMsg = function (msg, type, actions, sticky, position) {
+ var options = {
+ 'theme': config_ui_messenger.theme
+ };
- var data = {
- message: msg,
- type: angular.isDefined(type) ? type : 'info',
- actions: actions,
- showCloseButton: true
- };
+ var data = {
+ message: msg,
+ type: angular.isDefined(type) ? type : 'info',
+ actions: actions,
+ showCloseButton: true
+ };
- // Whether sticky the message, otherwise it will hide after a period.
- if (angular.isDefined(sticky) && sticky === true) {
- data.hideAfter = false;
- }
-
- // Specify the position, otherwise it will be default 'bottom_right'.
- if (angular.isDefined(position) && config_ui_messenger.location.hasOwnProperty(position)) {
- options.extraClasses = config_ui_messenger.location[position];
- }
+ // Whether sticky the message, otherwise it will hide after a period.
+ if (angular.isDefined(sticky) && sticky === true) {
+ data.hideAfter = false;
+ }
- Messenger(options).post(data);
+ // Specify the position, otherwise it will be default 'bottom_right'.
+ if (angular.isDefined(position) && config_ui_messenger.location.hasOwnProperty(position)) {
+ options.extraClasses = config_ui_messenger.location[position];
}
+
+ Messenger(options).post(data);
+ }
}]);
KylinApp.value('config_ui_messenger', {
- location: {
- top_left: 'messenger-fixed messenger-on-top messenger-on-left',
- top_center: 'messenger-fixed messenger-on-top',
- top_right: 'messenger-fixed messenger-on-top message-on-right',
- bottom_left: "messenger-fixed messenger-on-bottom messenger-on-left",
- bottom_center: 'messenger-fixed messenger-on-bottom',
- bottom_right: 'messenger-fixed messenger-on-bottom messenger-on-right'
- },
- theme: 'ice'
+ location: {
+ top_left: 'messenger-fixed messenger-on-top messenger-on-left',
+ top_center: 'messenger-fixed messenger-on-top',
+ top_right: 'messenger-fixed messenger-on-top message-on-right',
+ bottom_left: "messenger-fixed messenger-on-bottom messenger-on-left",
+ bottom_center: 'messenger-fixed messenger-on-bottom',
+ bottom_right: 'messenger-fixed messenger-on-bottom messenger-on-right'
+ },
+ theme: 'ice'
});
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/services/ngLoading.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/services/ngLoading.js b/webapp/app/js/services/ngLoading.js
index be05a2c..b0c4312 100644
--- a/webapp/app/js/services/ngLoading.js
+++ b/webapp/app/js/services/ngLoading.js
@@ -14,39 +14,39 @@
* 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 module = angular.module('ngLoadingRequest', []);
module.provider('loadingRequest', function () {
- this.$get = ['$document', '$window', function ($document, $window) {
- var body = $document.find('body');
+ this.$get = ['$document', '$window', function ($document, $window) {
+ var body = $document.find('body');
- var loadTemplate = angular.element('<div class="kylinLoadingRequest"><div class="loadingOverlay" ></div>' +
- '<div id="loadingCntnr" class="showbox" style="opacity: 0; margin-top: 250px;">'+
- '<div class="loadingWord" ><img src="image/waiting.gif"><span>Please wait...</span></div>'+
- '</div> </div>');
+ var loadTemplate = angular.element('<div class="kylinLoadingRequest"><div class="loadingOverlay" ></div>' +
+ '<div id="loadingCntnr" class="showbox" style="opacity: 0; margin-top: 250px;">' +
+ '<div class="loadingWord" ><img src="image/waiting.gif"><span>Please wait...</span></div>' +
+ '</div> </div>');
- var createOverlay = function () {
- if(!body.find(".kylinLoadingRequest").length){
- body.append(loadTemplate);
- }
- $(".loadingOverlay").css({'display':'block','opacity':'0.8'});
- $(".showbox").stop(true).animate({'margin-top':'300px','opacity':'1'},200);
- };
- return {
- show: function () {
- createOverlay();
- },
- hide: function () {
- $(".showbox").stop(true).animate({'margin-top':'250px','opacity':'0'},2000);
- $(".loadingOverlay").css({'display':'none','opacity':'0'});
- if(body.find(".kylinLoadingRequest").length){
- body.find(".kylinLoadingRequest").remove();
- }
-
- }
+ var createOverlay = function () {
+ if (!body.find(".kylinLoadingRequest").length) {
+ body.append(loadTemplate);
+ }
+ $(".loadingOverlay").css({'display': 'block', 'opacity': '0.8'});
+ $(".showbox").stop(true).animate({'margin-top': '300px', 'opacity': '1'}, 200);
+ };
+ return {
+ show: function () {
+ createOverlay();
+ },
+ hide: function () {
+ $(".showbox").stop(true).animate({'margin-top': '250px', 'opacity': '0'}, 2000);
+ $(".loadingOverlay").css({'display': 'none', 'opacity': '0'});
+ if (body.find(".kylinLoadingRequest").length) {
+ body.find(".kylinLoadingRequest").remove();
}
- }]
+ }
+ }
+
+ }]
});
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/services/projects.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/services/projects.js b/webapp/app/js/services/projects.js
index 2278d84..333e742 100644
--- a/webapp/app/js/services/projects.js
+++ b/webapp/app/js/services/projects.js
@@ -14,13 +14,13 @@
* 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.
-*/
+ */
KylinApp.factory('ProjectService', ['$resource', function ($resource, config) {
- return $resource(Config.service.url + 'projects/:projecId/:propName/:propValue/:action', {}, {
- list: {method: 'GET', params: {}, isArray: true},
- save: {method: 'POST', params: {}, isArray: false},
- update: {method: 'PUT', params:{}, isArray: false},
- delete: {method: 'DELETE', params: {}, isArray: false }
- });
+ return $resource(Config.service.url + 'projects/:projecId/:propName/:propValue/:action', {}, {
+ list: {method: 'GET', params: {}, isArray: true},
+ save: {method: 'POST', params: {}, isArray: false},
+ update: {method: 'PUT', params: {}, isArray: false},
+ delete: {method: 'DELETE', params: {}, isArray: false}
+ });
}]);
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/services/tables.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/services/tables.js b/webapp/app/js/services/tables.js
index 9b9daad..1f1f15a 100755
--- a/webapp/app/js/services/tables.js
+++ b/webapp/app/js/services/tables.js
@@ -14,15 +14,15 @@
* 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.
-*/
+ */
KylinApp.factory('TableService', ['$resource', function ($resource, config) {
- return $resource(Config.service.url + 'tables/:tableName/:action', {}, {
- list: {method: 'GET', params: {}, cache: true, isArray: true},
- get: {method: 'GET', params: {}, isArray: false},
- getExd: {method: 'GET', params: {action: 'exd-map'}, isArray: false},
- reload: {method: 'PUT', params: {action: 'reload'}, isArray: false},
- loadHiveTable: {method: 'POST', params: {}, isArray: false},
- genCardinality: {method: 'PUT', params: {action: 'cardinality'}, isArray: false}
- });
+ return $resource(Config.service.url + 'tables/:tableName/:action', {}, {
+ list: {method: 'GET', params: {}, cache: true, isArray: true},
+ get: {method: 'GET', params: {}, isArray: false},
+ getExd: {method: 'GET', params: {action: 'exd-map'}, isArray: false},
+ reload: {method: 'PUT', params: {action: 'reload'}, isArray: false},
+ loadHiveTable: {method: 'POST', params: {}, isArray: false},
+ genCardinality: {method: 'PUT', params: {action: 'cardinality'}, isArray: false}
+ });
}]);
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/js/utils/utils.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/utils/utils.js b/webapp/app/js/utils/utils.js
index 14dda8e..d838e9e 100644
--- a/webapp/app/js/utils/utils.js
+++ b/webapp/app/js/utils/utils.js
@@ -14,55 +14,55 @@
* 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.
-*/
+ */
'use strict';
/* utils */
KylinApp.factory('VdmUtil', function ($modal, $timeout, $location, $anchorScroll, $window) {
- return {
- createDialog: function (template, scope, thenFunc, options) {
- options = (!!!options) ? {} : options;
- options = angular.extend({
- backdropFade: true,
- templateUrl: template,
- resolve: {
- scope: function () {
- return scope;
- }
- },
- controller: function ($scope, $modalInstance, scope) {
- $scope = angular.extend($scope, scope);
- $scope.animate = "fadeInRight";
- $scope.close = function (data) {
- $scope.animate = "fadeOutRight";
- $timeout(function () {
- $modalInstance.close(data);
- }, 500);
- }
- }
- }, options);
-
- var dialog = $modal.open(options);
- dialog.result.then(thenFunc);
+ return {
+ createDialog: function (template, scope, thenFunc, options) {
+ options = (!!!options) ? {} : options;
+ options = angular.extend({
+ backdropFade: true,
+ templateUrl: template,
+ resolve: {
+ scope: function () {
+ return scope;
+ }
},
+ controller: function ($scope, $modalInstance, scope) {
+ $scope = angular.extend($scope, scope);
+ $scope.animate = "fadeInRight";
+ $scope.close = function (data) {
+ $scope.animate = "fadeOutRight";
+ $timeout(function () {
+ $modalInstance.close(data);
+ }, 500);
+ }
+ }
+ }, options);
- formatDate: function (date, fmt) {
- var o = {
- "M+": date.getMonth() + 1,
- "d+": date.getDate(),
- "h+": date.getHours(),
- "m+": date.getMinutes(),
- "s+": date.getSeconds(),
- "q+": Math.floor((date.getMonth() + 3) / 3),
- "S": date.getMilliseconds()
- };
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
- for (var k in o)
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+ var dialog = $modal.open(options);
+ dialog.result.then(thenFunc);
+ },
- return fmt;
- }
+ formatDate: function (date, fmt) {
+ var o = {
+ "M+": date.getMonth() + 1,
+ "d+": date.getDate(),
+ "h+": date.getHours(),
+ "m+": date.getMinutes(),
+ "s+": date.getSeconds(),
+ "q+": Math.floor((date.getMonth() + 3) / 3),
+ "S": date.getMilliseconds()
+ };
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+ for (var k in o)
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+
+ return fmt;
}
+ }
});
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4ddf4c8f/webapp/app/less/app.less
----------------------------------------------------------------------
diff --git a/webapp/app/less/app.less b/webapp/app/less/app.less
index 8763bb7..ff51368 100644
--- a/webapp/app/less/app.less
+++ b/webapp/app/less/app.less
@@ -392,7 +392,7 @@ treecontrol {
}
treecontrol > ul {
- width: 310px;
+// width: 310px;
overflow: auto;
}
@@ -523,9 +523,6 @@ background-color:#ffffff;
#loadingCntnr div.loadingWord{width:200px;height:70px;line-height:70px;border:2px solid #D6E7F2;background:#fff;}
#loadingCntnr img{margin:17px 15px;float:left;display:inline;}
-treecontrol ul{
- width:305px !important;
-}
/** Customization for Messenger **/
/** The top lower **/