From 1ee0e6c1d7484930387438b7ebb15340595b5383 Mon Sep 17 00:00:00 2001 From: Christian Hofmaier Date: Sun, 24 Mar 2019 16:02:18 +0000 Subject: [eventmanager] Add module and functionality - list to show all events, buttons to create/delete events - can add groups/clients to event - can add blacklist to event --- webapp/src/components/EventModule.vue | 83 +++ webapp/src/components/EventModuleDelete.vue | 66 +++ webapp/src/components/EventModuleEdit.vue | 638 +++++++++++++++++++++ webapp/src/components/EventModuleEventList.vue | 85 +++ webapp/src/components/PermissionModule.vue | 4 +- webapp/src/components/PermissionModuleEdit.vue | 1 + webapp/src/components/PermissionModuleRoleList.vue | 2 +- webapp/src/config/dashboard.js | 4 +- webapp/src/config/i18n.js | 6 +- webapp/src/config/store.js | 4 +- webapp/src/store/events.js | 35 ++ 11 files changed, 921 insertions(+), 7 deletions(-) create mode 100644 webapp/src/components/EventModule.vue create mode 100644 webapp/src/components/EventModuleDelete.vue create mode 100644 webapp/src/components/EventModuleEdit.vue create mode 100644 webapp/src/components/EventModuleEventList.vue create mode 100644 webapp/src/store/events.js (limited to 'webapp') diff --git a/webapp/src/components/EventModule.vue b/webapp/src/components/EventModule.vue new file mode 100644 index 0000000..68f9537 --- /dev/null +++ b/webapp/src/components/EventModule.vue @@ -0,0 +1,83 @@ + +{ + "en": { + "events": "Events", + "eventCalendar": "Event Calendar", + "eventList": "Event List" + }, + "de": { + "events": "Veranstaltungen", + "eventCalendar": "Veranstaltungskalendar", + "eventList": "Veranstaltungsliste" + } +} + + + + + + + diff --git a/webapp/src/components/EventModuleDelete.vue b/webapp/src/components/EventModuleDelete.vue new file mode 100644 index 0000000..f22fc41 --- /dev/null +++ b/webapp/src/components/EventModuleDelete.vue @@ -0,0 +1,66 @@ + +{ + "en": { + "delete-are-you-sure": "Are you sure you want to delete this event? | Are you sure you want to delete these events?" + }, + "de": { + "delete-are-you-sure": "Sind sie sicher, dass sie diese Veranstaltung Löschen wollen? | Sind sie sicher, dass sie diese Veranstaltungen löschen wollen?" + } +} + + + + + + + + diff --git a/webapp/src/components/EventModuleEdit.vue b/webapp/src/components/EventModuleEdit.vue new file mode 100644 index 0000000..2b6dbc3 --- /dev/null +++ b/webapp/src/components/EventModuleEdit.vue @@ -0,0 +1,638 @@ + +{ + "en": { + "april": "April", + "august": "August", + "blacklist": "Blacklist", + "blacklistClients": "Blacklist Clients", + "blacklistGroups": "Blacklist Groups", + "clients": "Clients", + "config": "Configuration", + "day": "Day", + "days": "Days", + "december": "December", + "description": "Description", + "endDate": "End Date", + "endTime": "End Time", + "event": "Event", + "eventName": "Event Name", + "eventNameEmptyError": "Event Name can't be empty!", + "february": "February", + "friday": "Friday", + "groups": "Groups", + "groupsAndClients": "Groups / Clients", + "id": "ID", + "importantEvent": "Important Event", + "interval": "Interval", + "intervalMustBeNumberError": "Interval must be a valid number!", + "intervalTypes": "Interval Types", + "ip": "IP", + "january": "January", + "july": "July", + "june": "June", + "march": "March", + "may": "May", + "monday": "Monday", + "month": "Month", + "months": "Months", + "name": "Name", + "november": "November", + "october": "October", + "repetitiveModeSwitch": "repetitive Event", + "saturday": "Saturday", + "september": "September", + "startDate": "Start Date", + "startTime": "Start Time", + "sunday": "Sunday", + "thursday": "Thursday", + "tuesday": "Tuesday", + "uuid": "UUID", + "wednesday": "Wednesday", + "week": "Week" + }, + "de": { + "april": "April", + "august": "August", + "blacklist": "Blacklist", + "blacklistClients": "Blacklist Clienten", + "blacklistGroups": "Blacklist Gruppen", + "clients": "Clients", + "config": "Konfiguration", + "day": "Tag", + "days": "Tage", + "december": "Dezember", + "description": "Beschreibung", + "endDate": "End Datum", + "endTime": "End Zeit", + "event": "Veranstaltung", + "eventName": "Veranstaltungsname", + "eventNameEmptyError": "Der Veranstaltungsname kann nicht leer sein!", + "february": "Februar", + "friday": "Freitag", + "groups": "Gruppen", + "groupsAndClients": "Gruppen / Clients", + "id": "ID", + "importantEvent": "Wichtige Veranstaltung", + "interval": "Intervall", + "intervalMustBeNumberError": "Das Intervall muss eine gültige Zahl sein!", + "intervalTypes": "Intervalltypen", + "ip": "IP", + "january": "Januar", + "july": "Juli", + "june": "Juni", + "march": "März", + "may": "Mai", + "monday": "Montag", + "month": "Monat", + "months": "Monate", + "name": "Name", + "november": "November", + "october": "Oktober", + "repetitiveModeSwitch": "Wiederholende Veranstaltung", + "saturday": "Samstag", + "september": "September", + "startDate": "Start Datum", + "startTime": "Start Zeit", + "sunday": "Sonntag", + "thursday": "Donnerstag", + "tuesday": "Dienstag", + "uuid": "UUID", + "wednesday": "Mittwoch", + "week": "Woche" + } +} + + + + + + + + diff --git a/webapp/src/components/EventModuleEventList.vue b/webapp/src/components/EventModuleEventList.vue new file mode 100644 index 0000000..fe2ac1a --- /dev/null +++ b/webapp/src/components/EventModuleEventList.vue @@ -0,0 +1,85 @@ + +{ + "en": { + "create-event": "Create Event", + "delete-event": "Delete {0} Event | Delete {0} Events", + "name": "Name", + "description": "Description", + "config": "Configuration", + "times": "Times" + }, + "de": { + "create-event": "Veranstaltung erstellen", + "delete-event": "Lösche {0} Veranstaltung | Lösche {0} Veranstaltungen", + "name": "Name", + "description": "Beschreibung", + "config": "Konfiguration", + "times": "Zeiten" + } +} + + + + + + + + diff --git a/webapp/src/components/PermissionModule.vue b/webapp/src/components/PermissionModule.vue index 213ca4f..109007c 100644 --- a/webapp/src/components/PermissionModule.vue +++ b/webapp/src/components/PermissionModule.vue @@ -3,14 +3,14 @@ "en": { "roles": "Roles", "users": "Users", - "delete-are-you-sure": "Are you sure you want to delete this role? | Are you sure you want to delete those roles?", + "delete-are-you-sure": "Are you sure you want to delete this role? | Are you sure you want to delete these roles?", "delete-permission": "Delete {0} role | Delete {0} roles", "delete-role": "Delete {0} Role | Delete {0} Roles" }, "de": { "roles": "Rollen", "users": "Nutzer", - "delete-are-you-sure": "Sind sie sicher, dass sie diese Rolle Löschen wollen? | Sind sie sicher, dass sie diese Rollen Löschen wollen?", + "delete-are-you-sure": "Sind sie sicher, dass sie diese Rolle Löschen wollen? | Sind sie sicher, dass sie diese Rollen löschen wollen?", "delete-permission": "Delete {0} role | Delete {0} roles", "delete-role": "Lösche {0} Rolle | Lösche {0} Rollen" } diff --git a/webapp/src/components/PermissionModuleEdit.vue b/webapp/src/components/PermissionModuleEdit.vue index c026f54..f88eb4c 100644 --- a/webapp/src/components/PermissionModuleEdit.vue +++ b/webapp/src/components/PermissionModuleEdit.vue @@ -274,6 +274,7 @@ export default { }).then(response => { this.$snackbar({ color: 'success', text: this.$t('roleSavedSuccess') }) this.$store.dispatch('permissions/loadRoleData') + this.$store.dispatch('permissions/loadUserData') this.$store.commit('permissions/setEdit', false) }).catch(error => { console.log(error) diff --git a/webapp/src/components/PermissionModuleRoleList.vue b/webapp/src/components/PermissionModuleRoleList.vue index 7b744b6..67fbb9f 100644 --- a/webapp/src/components/PermissionModuleRoleList.vue +++ b/webapp/src/components/PermissionModuleRoleList.vue @@ -52,7 +52,7 @@ export default { { text: this.$t('id'), key: 'id' }, { text: this.$t('name'), key: 'name' }, { text: this.$t('description'), key: 'descr' }, - { sortable: false, key: 'action' } + { sortable: false, key: 'action', width: '60px' } ], canEdit: false } diff --git a/webapp/src/config/dashboard.js b/webapp/src/config/dashboard.js index 26de0fc..7a5244e 100644 --- a/webapp/src/config/dashboard.js +++ b/webapp/src/config/dashboard.js @@ -6,6 +6,7 @@ import PermissionModule from '@/components/PermissionModule' import IpxeBuilderModule from '@/components/IpxeBuilderModule' import UserModule from '@/components/UserModule' import LogModule from '@/components/LogModule' +import EventModule from '@/components/EventModule' export default [ { path: 'groups', component: GroupModule, icon: 'category' }, @@ -15,5 +16,6 @@ export default [ { path: 'permissions', component: PermissionModule, icon: 'lock_open' }, { path: 'ipxe', component: IpxeBuilderModule, icon: 'merge_type' }, { path: 'users', component: UserModule, icon: 'contacts' }, - { path: 'log', component: LogModule, icon: 'error_outline' } + { path: 'log', component: LogModule, icon: 'error_outline' }, + { path: 'events', component: EventModule, icon: 'event' } ] diff --git a/webapp/src/config/i18n.js b/webapp/src/config/i18n.js index c9cf137..25e6f3a 100644 --- a/webapp/src/config/i18n.js +++ b/webapp/src/config/i18n.js @@ -30,7 +30,8 @@ export default { 'PermissionModule': 'Permission Manager', 'IpxeBuilderModule': 'iPXE Builder', 'UserModule': 'User Management', - 'LogModule': 'System Log' + 'LogModule': 'System Log', + 'EventModule': 'Event Manager' } }, 'de': { @@ -64,7 +65,8 @@ export default { 'PermissionModule': 'Rechteverwaltung', 'IpxeBuilderModule': 'iPXE Builder', 'UserModule': 'Benutzerverwaltung', - 'LogModule': 'System Protokoll' + 'LogModule': 'System Protokoll', + 'EventModule': 'Veranstaltungsverwaltung' } } } diff --git a/webapp/src/config/store.js b/webapp/src/config/store.js index ac65696..f8bb4f0 100644 --- a/webapp/src/config/store.js +++ b/webapp/src/config/store.js @@ -5,6 +5,7 @@ import registration from '@/store/registration' import backends from '@/store/backends' import permissions from '@/store/permissions' import users from '@/store/users' +import events from '@/store/events' export default { notifications, @@ -13,5 +14,6 @@ export default { registration, backends, permissions, - users + users, + events } diff --git a/webapp/src/store/events.js b/webapp/src/store/events.js new file mode 100644 index 0000000..27cb3e7 --- /dev/null +++ b/webapp/src/store/events.js @@ -0,0 +1,35 @@ +import axios from 'axios' + +export default { + namespaced: true, + state: { + events: [], + configList: [], + dialog: { show: false, type: null, info: {} } + }, + mutations: { + setEvents (state, value) { state.events = value }, + setConfigList (state, value) { state.configList = value }, + setDialog (state, { show, type, info }) { + if (show !== undefined) state.dialog.show = show + if (type !== undefined) state.dialog.type = type + if (info !== undefined) state.dialog.info = info + } + }, + actions: { + loadEvents (context) { + axios.get('/api/events').then(response => { + context.commit('setEvents', response.data) + }) + }, + loadConfigs (context) { + axios.get('/api/configurator/configs').then(result => { + context.commit('setConfigList', result.data) + }) + }, + loadLists (context) { + context.dispatch('loadEvents') + context.dispatch('loadConfigs') + } + } +} -- cgit v1.2.3-55-g7522