From f005ed445a98beee19e8d61296a18d6439ebfd97 Mon Sep 17 00:00:00 2001 From: rxdn <29165304+rxdn@users.noreply.github.com> Date: Mon, 25 Oct 2021 11:32:33 +0100 Subject: [PATCH] store_transcripts --- .../src/components/manage/SettingsCard.svelte | 3 ++ frontend/src/views/Transcripts.svelte | 31 ++++++++++++++----- go.mod | 2 +- go.sum | 2 ++ 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/manage/SettingsCard.svelte b/frontend/src/components/manage/SettingsCard.svelte index c6c1ae6..d0abb76 100644 --- a/frontend/src/components/manage/SettingsCard.svelte +++ b/frontend/src/components/manage/SettingsCard.svelte @@ -25,6 +25,9 @@ +
+ +

Start Ticket From Message Settings

diff --git a/frontend/src/views/Transcripts.svelte b/frontend/src/views/Transcripts.svelte index 382c38f..370729d 100644 --- a/frontend/src/views/Transcripts.svelte +++ b/frontend/src/views/Transcripts.svelte @@ -53,7 +53,9 @@ Username Rating Close Reason - Transcript + {#if settings.store_transcripts} + Transcript + {/if} @@ -69,11 +71,13 @@ {/if} {transcript.close_reason || 'No reason specified'} - - - - - + {#if settings.store_transcripts} + + + + + + {/if} {/each} @@ -118,6 +122,8 @@ let panels = []; let selectedPanel; + let settings = {}; + const pageLimit = 15; let page = 1; @@ -202,7 +208,17 @@ panels = res.data; } - async function loadData(paginationSettings) { + async function loadSettings() { + const res = await axios.get(`${API_URL}/api/${guildId}/settings`); + if (res.status !== 200) { + notifyError(res.data.error); + return; + } + + settings = res.data; + } + + async function loadData(paginationSettings) { const res = await axios.post(`${API_URL}/api/${guildId}/transcripts`, paginationSettings); if (res.status !== 200) { notifyError(res.data.error); @@ -219,6 +235,7 @@ withLoadingScreen(async () => { await loadPanels(); + await loadSettings(); await loadData({}) }) diff --git a/go.mod b/go.mod index fa96173..0a8f469 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/BurntSushi/toml v0.3.1 github.com/TicketsBot/archiverclient v0.0.0-20210220155137-a562b2f1bbbb github.com/TicketsBot/common v0.0.0-20210910205523-7ce93fba6fa5 - github.com/TicketsBot/database v0.0.0-20211024191932-85d9cf1d71a8 + github.com/TicketsBot/database v0.0.0-20211025101648-1c5a53942cbe github.com/TicketsBot/worker v0.0.0-20210910205947-89f7bd5ccf67 github.com/apex/log v1.1.2 github.com/boj/redistore v0.0.0-20180917114910-cd5dcc76aeff // indirect diff --git a/go.sum b/go.sum index a045b4e..c5891b3 100644 --- a/go.sum +++ b/go.sum @@ -16,6 +16,8 @@ github.com/TicketsBot/database v0.0.0-20210902172951-4e1f8ced84b7/go.mod h1:A4T2 github.com/TicketsBot/database v0.0.0-20210906215136-2d0c54bd1109/go.mod h1:A4T2uQFIWC/ttCYpfgv7AkPjR09mMRgzG13lgoV/+aI= github.com/TicketsBot/database v0.0.0-20211024191932-85d9cf1d71a8 h1:TROAdrUeCjxRI0xpOd3MaoeQq/xjGPb2kIh7a3+8Ev4= github.com/TicketsBot/database v0.0.0-20211024191932-85d9cf1d71a8/go.mod h1:72oWvH/Gq1iKeXCZhVRZn1JFbNVC5iAgERZWTrEarEo= +github.com/TicketsBot/database v0.0.0-20211025101648-1c5a53942cbe h1:SImaEnLPwW18P016eBpE+kyneb1Nw8qjJfuTn05v34A= +github.com/TicketsBot/database v0.0.0-20211025101648-1c5a53942cbe/go.mod h1:72oWvH/Gq1iKeXCZhVRZn1JFbNVC5iAgERZWTrEarEo= github.com/TicketsBot/logarchiver v0.0.0-20200423221245-a3f92edf8c14/go.mod h1:whts8TRxrAF4WuDuEAMllkWA/inKem0NhDEFeyuoOvE= github.com/TicketsBot/ttlcache v1.6.1-0.20200405150101-acc18e37b261 h1:NHD5GB6cjlkpZFjC76Yli2S63/J2nhr8MuE6KlYJpQM= github.com/TicketsBot/ttlcache v1.6.1-0.20200405150101-acc18e37b261/go.mod h1:2zPxDAN2TAPpxUPjxszjs3QFKreKrQh5al/R3cMXmYk=