From dc25bd7de72aa574767876341e5792733c2ee0e0 Mon Sep 17 00:00:00 2001
From: Jannik Schönartz
Date: Sun, 1 Dec 2019 15:03:55 +0000
Subject: [server/log] Add logging to all modules

Logging with snapshots:
Client: create / edit / delete / added to group / removed from group
Group: create / edit / delete / added to group / removed from group

Logging without snapshot:
Wake-on-lan: wakup
Ipxe-Builder: build / clear / cancel / script save
IP-Ranges: create / edit / delete

Logging: with info in description:
User: create / edit / delete / grant role / revoke role
Event: create / edit / delete
Permission-Manager-Role: create / edit / delete
Registration-Hook: create / delete / edit / change order
Ipxe Configuration: create / delete / edit
Backend: create / edit / delete
---
 webapp/src/components/LogModule.vue | 87 +++++++++++++++++++++++++++++++++++--
 1 file changed, 83 insertions(+), 4 deletions(-)

(limited to 'webapp/src/components/LogModule.vue')

diff --git a/webapp/src/components/LogModule.vue b/webapp/src/components/LogModule.vue
index e365701..cb7f035 100644
--- a/webapp/src/components/LogModule.vue
+++ b/webapp/src/components/LogModule.vue
@@ -226,15 +226,91 @@ export default {
   },
   data () {
     return {
-      CATEGORIES: [
-        { id: 1, name: 'REGISTRATION' },
-        { id: 2, name: 'ERROR_BACKEND' }
+      categoryArray: [
+        'BACKEND_CREATE',
+        'BACKEND_EDIT',
+        'BACKEND_DELETE',
+        'BACKEND_SYNCSETTINGS_EDIT',
+        'BACKEND_CHECKCONNECTION',
+        'BACKEND_BATCH_DELETE',
+        'ERROR_BACKEND',
+        'ERROR_BACKEND_CHECKCONNECTION',
+        'ERROR_BACKEND_DELETE',
+        'CLIENT_BOOT',
+        'CLIENT_CREATE',
+        'CLIENT_EDIT',
+        'CLIENT_DELETE',
+        'CLIENT_BATCH_DELETE',
+        'ERROR_CLIENT_DELETE',
+        'ERROR_DHCP',
+        'EVENT_CREATE',
+        'EVENT_EDIT',
+        'EVENT_DELETE',
+        'ERROR_EVENT_DELETE',
+        'EVENT_BATCH_DELETE',
+        'GROUP_CREATE',
+        'GROUP_EDIT',
+        'GROUP_DELETE',
+        'GROUP_BATCH_DELETE',
+        'GROUP_BATCH_REMOVE_SUBGROUP',
+        'GROUP_REMOVE_SUBGROUP',
+        'GROUP_BATCH_ADD_SUBGROUP',
+        'GROUP_ADD_SUBGROUP',
+        'GROUP_BATCH_REMOVE_CLIENT',
+        'GROUP_REMOVE_CLIENT',
+        'GROUP_BATCH_ADD_CLIENT',
+        'GROUP_ADD_CLIENT',
+        'ERROR_GROUP_DELETE',
+        'ERROR_GROUP_REMOVE_SUBGROUP',
+        'ERROR_GROUP_ADD_SUBGROUP',
+        'ERROR_GROUP_REMOVE_CLIENT',
+        'ERROR_GROUP_ADD_CLIENT',
+        'IPRANGE_CREATE',
+        'IPRANGE_EDIT',
+        'IPRANGE_DELETE',
+        'IPRANGE_BATCH_DELETE',
+        'ERROR_IPRANGE_DELETE',
+        'IPXEBUILDER_BUILD',
+        'IPXEBUILDER_CANCEL',
+        'IPXEBUILDER_CLEAN',
+        'IPXEBUILDER_SAVE',
+        'ERROR_IPXEBUILDER_SAVE',
+        'IPXECONFIG_CREATE',
+        'IPXECONFIG_EDIT',
+        'IPXECONFIG_DELETE',
+        'IPXECONFIG_SET_CLIENTS',
+        'IPXECONFIG_SET_GROUPS',
+        'IPXECONFIG_SET_DEFAULT',
+        'IPXECONFIG_BATCH_DELETE',
+        'ERROR_IPXECONFIG_DELETE',
+        'REGISTRATION',
+        'REGISTATIONHOOK_CREATE',
+        'REGISTATIONHOOK_EDIT',
+        'REGISTATIONHOOK_DELETE',
+        'REGISTATIONHOOK_EDIT_ORDER',
+        'ROLE_CREATE',
+        'ROLE_EDIT',
+        'ROLE_DELETE',
+        'ROLE_BATCH_DELETE',
+        'ERROR_ROLE_DELETE',
+        'USER_CREATE',
+        'USER_EDIT',
+        'USER_EDIT_PASSWORD',
+        'USER_DELETE',
+        'USER_BATCH_DELETE',
+        'USER_GRANT_ROLE',
+        'USER_REVOKE_ROLE',
+        'ERROR_USER_CREATE',
+        'ERROR_USER_EDIT',
+        'ERROR_USER_EDIT_PASSWORD',
+        'WAKE_ON_LAN',
+        'ERROR_WAKE_ON_LAN'
       ],
       tabs: 0,
       log: [],
       headers: [
         { key: 'timestamp', text: this.$t('timestamp'), width: '160px' },
-        { key: 'category', text: this.$t('category'), width: '160px' },
+        { key: 'category', text: this.$t('category'), width: '200px' },
         { key: 'description', searchKey: 'searchString', text: this.$t('description') }
       ],
       loading: false,
@@ -248,6 +324,9 @@ export default {
     ...mapState('log', ['filter']),
     ...mapState('groups', ['groupList', 'clientList']),
     ...mapGetters(['tabsDark', 'tabsColor', 'tabsSliderColor']),
+    CATEGORIES () {
+      return this.categoryArray.map((category, index) => { return { id: index, name: category } })
+    },
     locale () { return this.$store.state.settings.locale },
     selectBoxColumnCount () {
       if (this.$vuetify.breakpoint.mdOnly || this.$vuetify.breakpoint.xsOnly) return 1
-- 
cgit v1.2.3-55-g7522

