Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
add algorithm check force invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
CelestialCrafter committed Oct 30, 2023
1 parent 04aef95 commit 3dc763b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/hooks.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mongoose.connect(DB_URI);
const redis = createClient({ url: REDIS_URI });
await evaluateModelsWhenConnectionReady();

const job = schedule.scheduleJob('*/5 * * * *', () =>
export const job = schedule.scheduleJob('*/5 * * * *', () =>
executeAlgorithmCheck(redis)
.catch()
.finally(() => redis.isOpen && redis.disconnect())
Expand Down
29 changes: 0 additions & 29 deletions src/routes/dashboard/BotControls.svelte

This file was deleted.

2 changes: 1 addition & 1 deletion src/routes/dashboard/Sidebar.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import BotControls from './BotControls.svelte';
import BotControls from './botControls/BotControls.svelte';
import { enhance } from '$app/forms';
import { getContext } from 'svelte';
Expand Down
46 changes: 46 additions & 0 deletions src/routes/dashboard/botControls/BotControls.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<script>
import {
Pause,
Play,
Clock,
Minus,
AdjustmentsHorizontal,
CommandLine,
ArrowPath
} from 'svelte-heros-v2';
import { getContext } from 'svelte';
const selectedAccount = getContext('selectedAccount');
const user = getContext('user');
</script>

<section
class="{$selectedAccount ? 'pointer-events-auto opacity-100' : 'pointer-events-none opacity-40'}
bg-section-200 flex flex-wrap items-center justify-center transition-[opacity] duration-300"
>
<form method="post">
<button class="square !border-white/20 hover:!bg-white" title="Temporary Pause Bot"
><Clock class="icon" /></button
>
<button class="square !border-green/20 hover:!bg-green" title="Resume Bot"
><Play class="icon" />
</button>
<button class="square !border-yellow/20 hover:!bg-yellow" title="Pause Bot"
><Pause class="icon" />
</button>
<button class="square !border-red/20 hover:!bg-red" title="Delete Bot">
<Minus class="icon" />
</button>
<button class="square"><AdjustmentsHorizontal class="icon" /></button>
{#if $user.admin}
<button class="square"><CommandLine class="icon" /></button>
<button class="square">
<ArrowPath
class="icon"
title="Invoke Algorithm Check"
formaction="/botControls?/invokeAlgorithmCheck"
/>
</button>
{/if}
</form>
</section>

0 comments on commit 3dc763b

Please sign in to comment.