From 7fbf3114a58567d623fcc37058bb6c24d0bffed6 Mon Sep 17 00:00:00 2001 From: jedi Date: Wed, 6 Nov 2024 06:43:14 +0100 Subject: [PATCH] stash --- core/core/settings.py | 3 +- web/src/components/CollapsableCards.vue | 14 +-- web/src/components/ExpandableTable.vue | 124 ++++++++++++++++++++++++ web/src/store.js | 7 ++ web/src/views/admin/Events.vue | 106 ++++++++++++++------ 5 files changed, 215 insertions(+), 39 deletions(-) create mode 100644 web/src/components/ExpandableTable.vue diff --git a/core/core/settings.py b/core/core/settings.py index 9220a30..94f15eb 100644 --- a/core/core/settings.py +++ b/core/core/settings.py @@ -151,7 +151,8 @@ else: 'USER': os.getenv('DB_USER', 'system3'), 'PASSWORD': os.getenv('DB_PASSWORD', 'system3'), 'OPTIONS': { - 'charset': 'utf8mb4' + 'charset': 'utf8mb4', + 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'" } } } diff --git a/web/src/components/CollapsableCards.vue b/web/src/components/CollapsableCards.vue index 554a960..c91420d 100644 --- a/web/src/components/CollapsableCards.vue +++ b/web/src/components/CollapsableCards.vue @@ -73,23 +73,15 @@ export default { data() { return { collapsed: [], - symbols: ['▲', '▼', '▶', '◀'], }; }, created() { - const query = this.$router.currentRoute ? (this.$router.currentRoute.query ? this.$router.currentRoute.query.collapsed : null) : null; + const query = this.route ? (this.route.query ? this.route.query.collapsed : null) : null; if (query !== null && query !== undefined) { this.collapsed = this.unpackInt(parseInt(query), this.sections.length); } else { this.collapsed = this.sections.map(() => true); } - - //this.$router.push({...this.$router.currentRoute, query: {...this.$router.currentRoute.query, layout}}); - //this.collapsed = this.sections.map(() => true); - /*this.columns.map(e => ({ - k: e, - v: this.$store.getters.getFilters[e] - })).filter(e => e.v).forEach(e => this.setFilter(e.k, e.v));*/ }, computed: { grouped_items() { @@ -116,8 +108,8 @@ export default { const encoded = this.packInt(this.collapsed).toString() if (this.route.query.collapsed !== encoded) this.$router.push({ - ...this.$router.currentRoute, - query: {...this.$router.currentRoute.query, collapsed: encoded} + ...this.route, + query: {...this.route.query, collapsed: encoded} }); }, deep: true, diff --git a/web/src/components/ExpandableTable.vue b/web/src/components/ExpandableTable.vue new file mode 100644 index 0000000..6bd5175 --- /dev/null +++ b/web/src/components/ExpandableTable.vue @@ -0,0 +1,124 @@ + + + + + \ No newline at end of file diff --git a/web/src/store.js b/web/src/store.js index 9ab6504..87b13a5 100644 --- a/web/src/store.js +++ b/web/src/store.js @@ -359,6 +359,13 @@ const store = createStore({ commit('replaceEvents', [...state.events.filter(e => e.eid !== event_id)]) } }, + async updateEvent({commit, dispatch, state}, {id, partial_event}){ + console.log(id, partial_event); + const {data, success} = await http.patch(`/2/events/${id}/`, partial_event, state.user.token); + if (success) { + commit('replaceEvents', [...state.events.filter(e => e.eid !== id), data]) + } + }, async fetchTicketStates({commit, state, getters}) { if (!state.user.token) return; if (state.fetchedData.states > Date.now() - 1000 * 60 * 60 * 24) return; diff --git a/web/src/views/admin/Events.vue b/web/src/views/admin/Events.vue index 1aab608..e2ff952 100644 --- a/web/src/views/admin/Events.vue +++ b/web/src/views/admin/Events.vue @@ -1,50 +1,102 @@ \ No newline at end of file