Эх сурвалжийг харах

[sentry] Prettify URI view

Romain Rigaux 11 жил өмнө
parent
commit
805253a36c

+ 1 - 1
apps/security/src/security/api/hive.py

@@ -51,7 +51,7 @@ def list_sentry_privileges_by_role(request):
   try:
     roleName = request.POST['roleName']
     sentry_privileges = get_api(request.user).list_sentry_privileges_by_role(roleName)
-    result['sentry_privileges'] = sorted(sentry_privileges, key=lambda privilege: '%s.%s' % (privilege['database'], privilege['table']))
+    result['sentry_privileges'] = sorted(sentry_privileges, key=lambda privilege: '%s.%s.%s.%s' % (privilege['server'], privilege['database'], privilege['table'], privilege['URI']))
     result['message'] = ''
     result['status'] = 0
   except Exception, e:

+ 5 - 3
apps/security/src/security/templates/hive.mako

@@ -102,13 +102,15 @@ ${ layout.menubar(section='hive') }
       </span>
       <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>
-      </span>
-      <i class="fa fa-long-arrow-right"></i> action=<span data-bind="text: action"></span>
+      </span>      
     <!-- /ko -->
 
     <!-- ko if: URI -->
-      <span data-bind="text: URI"></span>
+      <i class="fa fa-long-arrow-right"></i> <a data-bind="attr: { href: '/filebrowser/view/' + URI().split('/')[3] }" target="_blank"><span data-bind="text: URI"></span></a>
     <!-- /ko -->
+
+    <i class="fa fa-long-arrow-right"></i> action=<span data-bind="text: action"></span>
+
   <!-- /ko -->
 </div>
 </script>

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

@@ -1174,6 +1174,6 @@ var HiveViewModel = function (initial) {
 
 function logGA(page) {
   if (typeof trackOnGA == 'function') {
-    trackOnGA('security/' + page);
+    trackOnGA('sentry/' + page);
   }
 }