store_transcripts

This commit is contained in:
rxdn 2021-10-25 11:32:33 +01:00
parent 9be7e75e5a
commit f005ed445a
4 changed files with 30 additions and 8 deletions

View File

@ -25,6 +25,9 @@
<Checkbox label="Hide Claim Button" col4=true bind:value={data.hide_claim_button}/>
<Checkbox label="Disable /open Command" col4=true bind:value={data.disable_open_command}/>
</div>
<div class="row">
<Checkbox label="Store Ticket Transcripts" col4=true bind:value={data.store_transcripts}/>
</div>
<div class="from-message-settings">
<h3>Start Ticket From Message Settings</h3>
<div class="row">

View File

@ -53,7 +53,9 @@
<th>Username</th>
<th>Rating</th>
<th class="reason">Close Reason</th>
{#if settings.store_transcripts}
<th>Transcript</th>
{/if}
</tr>
</thead>
<tbody>
@ -69,11 +71,13 @@
{/if}
</td>
<td class="reason">{transcript.close_reason || 'No reason specified'}</td>
{#if settings.store_transcripts}
<td>
<Navigate to="{`/manage/${guildId}/transcripts/view/${transcript.ticket_id}`}" styles="link">
<Button>View</Button>
</Navigate>
</td>
{/if}
</tr>
{/each}
</tbody>
@ -118,6 +122,8 @@
let panels = [];
let selectedPanel;
let settings = {};
const pageLimit = 15;
let page = 1;
@ -202,6 +208,16 @@
panels = res.data;
}
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) {
@ -219,6 +235,7 @@
withLoadingScreen(async () => {
await loadPanels();
await loadSettings();
await loadData({})
})
</script>

2
go.mod
View File

@ -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

2
go.sum
View File

@ -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=