From 9caac2439f10e44e96013914b0f125f33f1848ab Mon Sep 17 00:00:00 2001 From: Axolotle Date: Tue, 3 Nov 2020 16:30:08 +0100 Subject: [PATCH] update AppList & AppInfo with permission labels --- app/src/helpers/filters/human.js | 7 ++ app/src/views/app/AppInfo.vue | 147 +++++++++++++++++++++++-------- app/src/views/app/AppList.vue | 18 ++-- 3 files changed, 123 insertions(+), 49 deletions(-) diff --git a/app/src/helpers/filters/human.js b/app/src/helpers/filters/human.js index 050f70ba..bdad91e9 100644 --- a/app/src/helpers/filters/human.js +++ b/app/src/helpers/filters/human.js @@ -4,3 +4,10 @@ export function humanSize (bytes) { const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024))) return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i] } + + +export function humanPermissionName (text) { + return text.split('.')[1].replace('_', ' ').replace(/\w\S*/g, part => { + return part.charAt(0).toUpperCase() + part.substr(1).toLowerCase() + }) +} diff --git a/app/src/views/app/AppInfo.vue b/app/src/views/app/AppInfo.vue index b27e8ef1..b9bfb972 100644 --- a/app/src/views/app/AppInfo.vue +++ b/app/src/views/app/AppInfo.vue @@ -25,7 +25,7 @@

{{ $t('app_info_access_desc') }}
- {{ app.permissions.length > 0 ? app.permissions.join(', ') + '.' : $t('nobody') }} + {{ allowedGroups.length > 0 ? allowedGroups.join(', ') + '.' : $t('nobody') }}

{{ $t('groups_and_permissions_manage') }} @@ -38,26 +38,46 @@

{{ $t('operations') }}

- - - - -