Răsfoiți Sursa

[sentry] Better role filtering

Romain Rigaux 11 ani în urmă
părinte
comite
5c1e646

+ 4 - 4
apps/security/src/security/templates/hive.mako

@@ -102,7 +102,7 @@ ${ layout.menubar(section='hive') }
       </span>
       </span>
       <span data-bind="visible: tableName">
       <span data-bind="visible: tableName">
         <i class="fa fa-long-arrow-right"></i> table=<a data-bind="attr: { href: '/metastore/table/' + dbName() + '/' + tableName() }" target="_blank"><span data-bind="text: tableName"></span></a>
         <i class="fa fa-long-arrow-right"></i> table=<a data-bind="attr: { href: '/metastore/table/' + dbName() + '/' + tableName() }" target="_blank"><span data-bind="text: tableName"></span></a>
-      </span>      
+      </span>
     <!-- /ko -->
     <!-- /ko -->
 
 
     <!-- ko if: URI -->
     <!-- ko if: URI -->
@@ -245,7 +245,7 @@ ${ layout.menubar(section='hive') }
           <div data-bind="visible: $root.roles().length > 0 && ! $root.isLoadingRoles()">
           <div data-bind="visible: $root.roles().length > 0 && ! $root.isLoadingRoles()">
             <%actionbar:render>
             <%actionbar:render>
               <%def name="search()">
               <%def name="search()">
-                <input id="filterInput" type="text" class="input-xlarge search-query" placeholder="${_('Search for name, groups, etc...')}" data-bind="value: $root.roleFilter, valueUpdate: 'afterkeydown'">
+                <input id="filterInput" type="text" class="input-xlarge search-query" placeholder="${_('Search roles by name, groups, etc...')}" data-bind="value: $root.roleFilter, valueUpdate: 'afterkeydown'">
               </%def>
               </%def>
 
 
               <%def name="actions()">
               <%def name="actions()">
@@ -536,7 +536,7 @@ ${ tree.import_templates(itemClick='$root.assist.setPath', iconClick='$root.assi
         }
         }
         if ($("a.anchor[href^='"+_path+"']").length > 0){
         if ($("a.anchor[href^='"+_path+"']").length > 0){
           $("#expandableTree").animate({
           $("#expandableTree").animate({
-            scrollTop: ($("a.anchor[href^='"+_path+"']:first").position().top + $("#expandableTree").scrollTop() - $("#expandableTree").position().top - 4)+"px"
+            scrollTop: ($("a.anchor[href^='"+_path+"']:first").position().top + $("#expandableTree").scrollTop() - $("#expandableTree").position().top - 4) + "px"
           });
           });
         }
         }
       });
       });
@@ -584,7 +584,7 @@ ${ tree.import_templates(itemClick='$root.assist.setPath', iconClick='$root.assi
           $("#bulkActionsModal").modal("hide");
           $("#bulkActionsModal").modal("hide");
           showMainSection("roles");
           showMainSection("roles");
           $("html, body").animate({
           $("html, body").animate({
-            scrollTop: ($("a[href='" + role.name() + "']").position().top - 90)+"px"
+            scrollTop: ($("a[href='" + role.name() + "']").position().top - 90) + "px"
           });
           });
         }
         }
       });
       });

+ 4 - 1
apps/security/static/js/hive.ko.js

@@ -759,7 +759,10 @@ var HiveViewModel = function (initial) {
         });
         });
         var _inPrivileges = false;
         var _inPrivileges = false;
         role.privileges().forEach(function (priv) {
         role.privileges().forEach(function (priv) {
-          if (priv.dbName().toLowerCase().indexOf(_filter) > -1 || priv.tableName().toLowerCase().indexOf(_filter) > -1) {
+          if (priv.dbName().toLowerCase().indexOf(_filter) > -1 || priv.tableName().toLowerCase().indexOf(_filter) > -1
+              || priv.URI().toLowerCase().indexOf(_filter) > -1
+              || priv.action().toLowerCase().indexOf(_filter) > -1
+              || priv.serverName().toLowerCase().indexOf(_filter) > -1) {
             _inPrivileges = true;
             _inPrivileges = true;
           }
           }
         });
         });