Procházet zdrojové kódy

取消搜索旁的筛选框,技术特性以及新建实体的key值汉化。

jie před 1 rokem
rodič
revize
3b73aefdf0

+ 3 - 9
atlas/js/templates/search/SearchLayoutView_tmpl.html

@@ -36,23 +36,17 @@
             <div class="srchType clearfix">
                 <span class="srchTitle">根据类型搜索</span>
                 <div class="">
-                    <div class="col-sm-10 no-padding typeFilter">
+                    <div class="col-sm-12 no-padding typeFilter">
                         <select data-id="typeLOV"></select>
                     </div>
-                    <div class="col-sm-2 no-padding typeFilterBtn">
-                        <button type="button" class="btn btn-action btn-md pull-right typeLOV active" title="类型属性过滤器" data-id="typeAttrFilter"><i class="fa fa-filter"></i></button>
-                    </div>
                 </div>
             </div>
             <div class="srchType tagBox clearfix">
                 <span class="srchTitle">根据分类搜索</span>
                 <div>
-                    <div class="col-sm-10 no-padding">
+                    <div class="col-sm-12 no-padding">
                         <select data-id="tagLOV"></select>
                     </div>
-                    <div class="col-sm-2 no-padding">
-                        <button type="button" class="btn btn-action btn-md pull-right active" title="标签属性过滤器" data-id="tagAttrFilter"><i class="fa fa-filter"></i></button>
-                    </div>
                 </div>
             </div>
             <div class="srchType termBox clearfix">
@@ -78,4 +72,4 @@
     <div class="col-sm-12">
         <div class="col-sm-12 well advanceSaveSearch" data-id="r_saveSearchAdvance" style="display: none"></div>
     </div>
-</div>
+</div>

+ 67 - 37
atlas/js/utils/Utils.js

@@ -10,7 +10,7 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
                 container: "body",
                 sanitize: !1
             };
-            return (options.viewFixedPopover || options.contentClass) && (defaultObj.template = '<div class="popover ' + (options.viewFixedPopover ? "fixed-popover" : "") + ' fade bottom"><div class="arrow"></div><h3 class="popover-title"></h3><div class="' + (options.contentClass ? options.contentClass : "") + ' popover-content"></div></div>'), 
+            return (options.viewFixedPopover || options.contentClass) && (defaultObj.template = '<div class="popover ' + (options.viewFixedPopover ? "fixed-popover" : "") + ' fade bottom"><div class="arrow"></div><h3 class="popover-title"></h3><div class="' + (options.contentClass ? options.contentClass : "") + ' popover-content"></div></div>'),
             options.el.popover(_.extend(defaultObj, options.popoverOptions));
         }
     }, Utils.getNumberSuffix = function(options) {
@@ -36,7 +36,7 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
             return entityData.isProcess ? Enums.entityStateReadOnly[status] ? iconBasePath + "disabled/process.png" : iconBasePath + "process.png" : Enums.entityStateReadOnly[status] ? iconBasePath + "disabled/table.png" : iconBasePath + "table.png";
         }
         var serviceType, status, typeName, entityData = options && options.entityData, iconBasePath = Utils.getBaseUrl(window.location.pathname) + Globals.entityImgPath;
-        if (entityData && (typeName = entityData.typeName, serviceType = entityData && entityData.serviceType, 
+        if (entityData && (typeName = entityData.typeName, serviceType = entityData && entityData.serviceType,
         status = entityData && entityData.status), entityData) {
             if (options.errorUrl) {
                 var isErrorInTypeName = !(!options.errorUrl || !options.errorUrl.match("entity-icon/" + typeName + ".png|disabled/" + typeName + ".png"));
@@ -97,7 +97,7 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
                 push: "top",
                 modal: !0
             };
-            modal.addclass = "stack-modal " + (options.modalClass ? modalClass : "width-500"), 
+            modal.addclass = "stack-modal " + (options.modalClass ? modalClass : "width-500"),
             modal.stack = myStack;
         }
         notify(_.extend({
@@ -122,7 +122,7 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
                             showButtonLoader: function() {
                                 notice.container.find("button.ok").showButtonLoader();
                             }
-                        })), options.okShowLoader && notice.container.find("button.ok").showButtonLoader(), 
+                        })), options.okShowLoader && notice.container.find("button.ok").showButtonLoader(),
                         options.okCloses !== !1 && notice.remove();
                     }
                 } ]
@@ -194,7 +194,7 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
                 var urlUpdate = {
                     stateChanged: !0
                 };
-                Utils.getUrlState.isTagTab(options.url) ? urlUpdate.tagUrl = options.url : Utils.getUrlState.isSearchTab(options.url) ? urlUpdate.searchUrl = options.url : Utils.getUrlState.isGlossaryTab(options.url) ? urlUpdate.glossaryUrl = options.url : Utils.getUrlState.isAdministratorTab(options.url) ? urlUpdate.administratorUrl = options.url : Utils.getUrlState.isDebugMetricsTab(options.url) && (urlUpdate.debugMetricsUrl = options.url), 
+                Utils.getUrlState.isTagTab(options.url) ? urlUpdate.tagUrl = options.url : Utils.getUrlState.isSearchTab(options.url) ? urlUpdate.searchUrl = options.url : Utils.getUrlState.isGlossaryTab(options.url) ? urlUpdate.glossaryUrl = options.url : Utils.getUrlState.isAdministratorTab(options.url) ? urlUpdate.administratorUrl = options.url : Utils.getUrlState.isDebugMetricsTab(options.url) && (urlUpdate.debugMetricsUrl = options.url),
                 $.extend(Globals.saveApplicationState.tabState, urlUpdate);
             }
             Backbone.history.navigate(options.url, {
@@ -292,35 +292,35 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
             key: null
         };
         if (collectionJSON) {
-            if (collectionJSON.attributes && collectionJSON.attributes[priorityAttribute]) return returnObj.name = _.escape(collectionJSON.attributes[priorityAttribute]), 
+            if (collectionJSON.attributes && collectionJSON.attributes[priorityAttribute]) return returnObj.name = _.escape(collectionJSON.attributes[priorityAttribute]),
             returnObj.key = priorityAttribute, returnObj;
-            if (collectionJSON[priorityAttribute]) return returnObj.name = _.escape(collectionJSON[priorityAttribute]), 
+            if (collectionJSON[priorityAttribute]) return returnObj.name = _.escape(collectionJSON[priorityAttribute]),
             returnObj.key = priorityAttribute, returnObj;
             if (collectionJSON.attributes) {
-                if (collectionJSON.attributes.name) return returnObj.name = _.escape(collectionJSON.attributes.name), 
+                if (collectionJSON.attributes.name) return returnObj.name = _.escape(collectionJSON.attributes.name),
                 returnObj.key = "name", returnObj;
-                if (collectionJSON.attributes.displayName) return returnObj.name = _.escape(collectionJSON.attributes.displayName), 
+                if (collectionJSON.attributes.displayName) return returnObj.name = _.escape(collectionJSON.attributes.displayName),
                 returnObj.key = "displayName", returnObj;
-                if (collectionJSON.attributes.qualifiedName) return returnObj.name = _.escape(collectionJSON.attributes.qualifiedName), 
+                if (collectionJSON.attributes.qualifiedName) return returnObj.name = _.escape(collectionJSON.attributes.qualifiedName),
                 returnObj.key = "qualifiedName", returnObj;
-                if (collectionJSON.attributes.displayText) return returnObj.name = _.escape(collectionJSON.attributes.displayText), 
+                if (collectionJSON.attributes.displayText) return returnObj.name = _.escape(collectionJSON.attributes.displayText),
                 returnObj.key = "displayText", returnObj;
-                if (collectionJSON.attributes.guid) return returnObj.name = _.escape(collectionJSON.attributes.guid), 
+                if (collectionJSON.attributes.guid) return returnObj.name = _.escape(collectionJSON.attributes.guid),
                 returnObj.key = "guid", returnObj;
-                if (collectionJSON.attributes.id) return _.isObject(collectionJSON.attributes.id) ? collectionJSON.id.id && (returnObj.name = _.escape(collectionJSON.attributes.id.id)) : returnObj.name = _.escape(collectionJSON.attributes.id), 
+                if (collectionJSON.attributes.id) return _.isObject(collectionJSON.attributes.id) ? collectionJSON.id.id && (returnObj.name = _.escape(collectionJSON.attributes.id.id)) : returnObj.name = _.escape(collectionJSON.attributes.id),
                 returnObj.key = "id", returnObj;
             }
-            if (collectionJSON.name) return returnObj.name = _.escape(collectionJSON.name), 
+            if (collectionJSON.name) return returnObj.name = _.escape(collectionJSON.name),
             returnObj.key = "name", returnObj;
-            if (collectionJSON.displayName) return returnObj.name = _.escape(collectionJSON.displayName), 
+            if (collectionJSON.displayName) return returnObj.name = _.escape(collectionJSON.displayName),
             returnObj.key = "displayName", returnObj;
-            if (collectionJSON.qualifiedName) return returnObj.name = _.escape(collectionJSON.qualifiedName), 
+            if (collectionJSON.qualifiedName) return returnObj.name = _.escape(collectionJSON.qualifiedName),
             returnObj.key = "qualifiedName", returnObj;
-            if (collectionJSON.displayText) return returnObj.name = _.escape(collectionJSON.displayText), 
+            if (collectionJSON.displayText) return returnObj.name = _.escape(collectionJSON.displayText),
             returnObj.key = "displayText", returnObj;
-            if (collectionJSON.guid) return returnObj.name = _.escape(collectionJSON.guid), 
+            if (collectionJSON.guid) return returnObj.name = _.escape(collectionJSON.guid),
             returnObj.key = "guid", returnObj;
-            if (collectionJSON.id) return _.isObject(collectionJSON.id) ? collectionJSON.id.id && (returnObj.name = _.escape(collectionJSON.id.id)) : returnObj.name = _.escape(collectionJSON.id), 
+            if (collectionJSON.id) return _.isObject(collectionJSON.id) ? collectionJSON.id.id && (returnObj.name = _.escape(collectionJSON.id.id)) : returnObj.name = _.escape(collectionJSON.id),
             returnObj.key = "id", returnObj;
         }
         return returnObj.found = !1, skipAttribute && returnObj.key == skipAttribute ? {
@@ -330,7 +330,7 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
         } : returnObj;
     }, Utils.backButtonClick = function() {
         var queryParams = Utils.getUrlState.getQueryParams(), urlPath = "searchUrl";
-        queryParams && queryParams.from && ("classification" == queryParams.from ? urlPath = "tagUrl" : "glossary" == queryParams.from ? urlPath = "glossaryUrl" : "bm" == queryParams.from && (urlPath = "administratorUrl")), 
+        queryParams && queryParams.from && ("classification" == queryParams.from ? urlPath = "tagUrl" : "glossary" == queryParams.from ? urlPath = "glossaryUrl" : "bm" == queryParams.from && (urlPath = "administratorUrl")),
         Utils.setUrl({
             url: Globals.saveApplicationState.tabState[urlPath],
             mergeBrowserUrl: !1,
@@ -370,10 +370,10 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
                         var entityFound = _.find(relationShipVal, {
                             guid: attr.guid
                         });
-                        entityFound && (attr.attributes = _.omit(entityFound, "typeName", "guid", "entityStatus"), 
+                        entityFound && (attr.attributes = _.omit(entityFound, "typeName", "guid", "entityStatus"),
                         attr.status = entityFound.entityStatus);
                     }
-                }) : relationShipVal && void 0 === val.attributes && (val.attributes = _.omit(relationShipVal, "typeName", "guid", "entityStatus"), 
+                }) : relationShipVal && void 0 === val.attributes && (val.attributes = _.omit(relationShipVal, "typeName", "guid", "entityStatus"),
                 val.status = relationShipVal.entityStatus));
             }
         });
@@ -402,19 +402,19 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
                 return obj;
             });
         }, getData = function(data, collection) {
-            options.attrMerge ? seperateRelatioshipAttr ? (attributeDefs.attributeDefs = attributeDefs.attributeDefs.concat(data.attributeDefs), 
-            attributeDefs.relationshipAttributeDefs = attributeDefs.relationshipAttributeDefs.concat(getRelationshipAttributeDef(data))) : (attributeDefs = attributeDefs.concat(data.attributeDefs), 
+            options.attrMerge ? seperateRelatioshipAttr ? (attributeDefs.attributeDefs = attributeDefs.attributeDefs.concat(data.attributeDefs),
+            attributeDefs.relationshipAttributeDefs = attributeDefs.relationshipAttributeDefs.concat(getRelationshipAttributeDef(data))) : (attributeDefs = attributeDefs.concat(data.attributeDefs),
             mergeRelationAttributes && (attributeDefs = attributeDefs.concat(getRelationshipAttributeDef(data)))) : attributeDefs[data.name] ? attributeDefs[data.name] = _.toArrayifObject(attributeDefs[data.name]).concat(data.attributeDefs) : seperateRelatioshipAttr ? attributeDefs[data.name] = {
                 attributeDefs: data.attributeDefs,
                 relationshipAttributeDefs: data.relationshipAttributeDefs
-            } : (attributeDefs[data.name] = data.attributeDefs, mergeRelationAttributes && (attributeDefs[data.name] = _.toArrayifObject(attributeDefs[data.name]).concat(getRelationshipAttributeDef(data)))), 
+            } : (attributeDefs[data.name] = data.attributeDefs, mergeRelationAttributes && (attributeDefs[data.name] = _.toArrayifObject(attributeDefs[data.name]).concat(getRelationshipAttributeDef(data)))),
             data.superTypes && data.superTypes.length && _.each(data.superTypes, function(superTypeName) {
                 if (collection.fullCollection) var collectionData = collection.fullCollection.findWhere({
                     name: superTypeName
                 }); else var collectionData = collection.findWhere({
                     name: superTypeName
                 });
-                return collectionData = collectionData && collectionData.toJSON ? collectionData.toJSON() : collectionData, 
+                return collectionData = collectionData && collectionData.toJSON ? collectionData.toJSON() : collectionData,
                 collectionData ? getData(collectionData, collection) : void 0;
             });
         };
@@ -441,15 +441,15 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
                         value: splitValue[0],
                         monthlyCounts: {},
                         totalCount: 0
-                    }), dateObj[splitValue[0]] && "count" == splitValue[1] && (dateObj[splitValue[0]].count = parseData[key]), 
-                    dateObj[splitValue[0]] && "count" !== splitValue[1] && (dateObj[splitValue[0]].monthlyCounts[splitValue[1]] = parseData[key], 
+                    }), dateObj[splitValue[0]] && "count" == splitValue[1] && (dateObj[splitValue[0]].count = parseData[key]),
+                    dateObj[splitValue[0]] && "count" !== splitValue[1] && (dateObj[splitValue[0]].monthlyCounts[splitValue[1]] = parseData[key],
                     dateObj[splitValue[0]].count || (dateObj[splitValue[0]].totalCount += parseData[key]));
                 }), _.toArray(dateObj).map(function(obj) {
                     return !obj.count && obj.totalCount && (obj.count = obj.totalCount), obj;
                 });
             }
             var data = [];
-            return profileData.distributionKeyOrder ? orderValue = profileData.distributionKeyOrder : (sort = !0, 
+            return profileData.distributionKeyOrder ? orderValue = profileData.distributionKeyOrder : (sort = !0,
             orderValue = _.keys(parseData)), _.each(orderValue, function(key) {
                 parseData[key] && data.push({
                     value: key,
@@ -488,7 +488,7 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
     }, Utils.JSONPrettyPrint = function(obj, getValue) {
         var replacer = function(match, pIndent, pKey, pVal, pEnd) {
             var key = "<span class=json-key>", val = "<span class=json-value>", str = "<span class=json-string>", r = pIndent || "";
-            return pKey && (r = r + key + pKey.replace(/[": ]/g, "") + "</span>: "), pVal && (r = r + ('"' == pVal[0] ? str : val) + getValue(pVal) + "</span>"), 
+            return pKey && (r = r + key + pKey.replace(/[": ]/g, "") + "</span>: "), pVal && (r = r + ('"' == pVal[0] ? str : val) + getValue(pVal) + "</span>"),
             r + (pEnd || "");
         }, jsonLine = /^( *)("[\w]+": )?("[^"]*"|[\w.+-]*)?([,[{])?$/gm;
         return obj && _.isObject(obj) ? JSON.stringify(obj, null, 3).replace(/&/g, "&amp;").replace(/\\"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(jsonLine, replacer) : {};
@@ -496,7 +496,7 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
         this.attr(attributeName) == firstString ? this.attr(attributeName, secondString) : this.attr(attributeName, firstString);
     }, Utils.millisecondsToTime = function(duration) {
         var milliseconds = parseInt(duration % 1e3 / 100), seconds = parseInt(duration / 1e3 % 60), minutes = parseInt(duration / 6e4 % 60), hours = parseInt(duration / 36e5 % 24);
-        return hours = hours < 10 ? "0" + hours : hours, minutes = minutes < 10 ? "0" + minutes : minutes, 
+        return hours = hours < 10 ? "0" + hours : hours, minutes = minutes < 10 ? "0" + minutes : minutes,
         seconds = seconds < 10 ? "0" + seconds : seconds, hours + ":" + minutes + ":" + seconds + "." + milliseconds;
     }, Utils.togglePropertyRelationshipTableEmptyValues = function(object) {
         var inputSelector = object.inputType, tableEl = object.tableEl;
@@ -507,11 +507,11 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
         $(this).removeClass("button-loader").removeAttr("disabled"), $(this).siblings("button.cancel").prop("disabled", !1);
     }, Utils.formatDate = function(options) {
         var dateValue = null, dateFormat = Globals.dateTimeFormat, isValidDate = !1;
-        return options && options.date && (dateValue = options.date, "-" !== dateValue && (dateValue = parseInt(dateValue), 
-        _.isNaN(dateValue) && (dateValue = options.date), dateValue = moment(dateValue), 
-        dateValue._isValid && (isValidDate = !0, dateValue = dateValue.format(dateFormat)))), 
-        "-" !== dateValue && (isValidDate === !1 && options && options.defaultDate !== !1 && (dateValue = moment().format(dateFormat)), 
-        Globals.isTimezoneFormatEnabled && (!options || options && options.zone !== !1) && (dateValue += " (" + moment.tz(moment.tz.guess()).zoneAbbr() + ")")), 
+        return options && options.date && (dateValue = options.date, "-" !== dateValue && (dateValue = parseInt(dateValue),
+        _.isNaN(dateValue) && (dateValue = options.date), dateValue = moment(dateValue),
+        dateValue._isValid && (isValidDate = !0, dateValue = dateValue.format(dateFormat)))),
+        "-" !== dateValue && (isValidDate === !1 && options && options.defaultDate !== !1 && (dateValue = moment().format(dateFormat)),
+        Globals.isTimezoneFormatEnabled && (!options || options && options.zone !== !1) && (dateValue += " (" + moment.tz(moment.tz.guess()).zoneAbbr() + ")")),
         dateValue;
     },Utils.toChinese=function (name){
         switch (name){
@@ -539,9 +539,39 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
             case "viewExpandedText": return "视图拓展文本";
             case "viewOriginalText": return "视图原始文本";
             case "type": return "类型";
+            case "ddlQueries": return "数据定义语句";
+            case "outputFromProcesses": return "表格输出过程";
+            case "inputs": return "输入";
+            case "outputs": return "输出";
+            case "processExecutions": return "执行过程";
+            case "inputToProcesses": return "输入过程";
+            case "namespace": return "命名空间";
+            case "table": return "表";
+            case "meanings": return "含义";
+            case "model": return "模型";
+            case "pipeline": return "管道";
+            case "schema": return "模式";
+            case "position": return "位置";
+            case "description": return "描述";
+            case "path": return "路径";
+            case "clusterName": return "数据块名称";
+            case "extendedAttributes": return "扩展属性";
+            case "fileSize": return "文件大小";
+            case "group": return "组";
+            case "isFile": return "是否为文件";
+            case "isSymlink": return "是否为符号链接";
+            case "modifiedTime": return "修改时间";
+            case "nameServiceId": return "服务器序号";
+            case "numberOfReplicas": return "副本数量";
+            case "posixPermissions": return "接口访问权限";
+            case "hiveDb": return "hive数据库";
+
+
+
+
             default: return name;
         }
 
     },
         Utils;
-});
+});