fix: plausible analytics actions

This commit is contained in:
Andras Bacsai
2022-09-13 10:14:15 +02:00
parent 27af6459b3
commit 18e769b5e5
2 changed files with 9 additions and 7 deletions

View File

@@ -456,7 +456,7 @@ export async function activatePlausibleUsers(request: FastifyRequest<OnlyId>, re
if (destinationDockerId) { if (destinationDockerId) {
await executeDockerCmd({ await executeDockerCmd({
dockerId: destinationDocker.id, dockerId: destinationDocker.id,
command: `docker exec ${id} 'psql -H postgresql://${postgresqlUser}:${postgresqlPassword}@localhost:5432/${postgresqlDatabase} -c "UPDATE users SET email_verified = true;"'` command: `docker exec ${id}-postgresql psql -H postgresql://${postgresqlUser}:${postgresqlPassword}@localhost:5432/${postgresqlDatabase} -c "UPDATE users SET email_verified = true;"`
}) })
return await reply.code(201).send() return await reply.code(201).send()
} }
@@ -476,7 +476,7 @@ export async function cleanupPlausibleLogs(request: FastifyRequest<OnlyId>, repl
if (destinationDockerId) { if (destinationDockerId) {
await executeDockerCmd({ await executeDockerCmd({
dockerId: destinationDocker.id, dockerId: destinationDocker.id,
command: `docker exec ${id}-clickhouse sh -c "/usr/bin/clickhouse-client -q \\"SELECT name FROM system.tables WHERE name LIKE '%log%';\\"| xargs -I{} /usr/bin/clickhouse-client -q \"TRUNCATE TABLE system.{};\""` command: `docker exec ${id}-clickhouse /usr/bin/clickhouse-client -q \\"SELECT name FROM system.tables WHERE name LIKE '%log%';\\"| xargs -I{} /usr/bin/clickhouse-client -q \"TRUNCATE TABLE system.{};\"`
}) })
return await reply.code(201).send() return await reply.code(201).send()
} }

View File

@@ -219,6 +219,8 @@
<path d="M21 21v-2a4 4 0 0 0 -3 -3.85" /> <path d="M21 21v-2a4 4 0 0 0 -3 -3.85" />
</svg> </svg>
</a> </a>
<Tooltip triggeredBy="#iam" placement="right" color="bg-iam">IAM</Tooltip>
<a <a
id="settings" id="settings"
sveltekit:prefetch sveltekit:prefetch
@@ -245,6 +247,9 @@
<circle cx="12" cy="12" r="3" /> <circle cx="12" cy="12" r="3" />
</svg> </svg>
</a> </a>
<Tooltip triggeredBy="#settings" placement="right" color="bg-settings text-black"
>Settings</Tooltip
>
<div id="logout" class="icons bg-coolgray-200 hover:text-error" on:click={logout}> <div id="logout" class="icons bg-coolgray-200 hover:text-error" on:click={logout}>
<svg <svg
@@ -264,6 +269,8 @@
<path d="M7 12h14l-3 -3m0 6l3 -3" /> <path d="M7 12h14l-3 -3m0 6l3 -3" />
</svg> </svg>
</div> </div>
<Tooltip triggeredBy="#logout" placement="right" color="bg-red-600">Logout</Tooltip>
<div <div
class="w-full text-center font-bold text-stone-400 hover:bg-coolgray-200 hover:text-white" class="w-full text-center font-bold text-stone-400 hover:bg-coolgray-200 hover:text-white"
> >
@@ -287,8 +294,3 @@
<slot /> <slot />
</div> </div>
</main> </main>
<Tooltip triggeredBy="#iam" placement="right" color="bg-iam">IAM</Tooltip>
<Tooltip triggeredBy="#settings" placement="right" color="bg-settings text-black">Settings</Tooltip
>
<Tooltip triggeredBy="#logout" placement="right" color="bg-red-600">Logout</Tooltip>