feat: complete in-game commands, GUIs, admin panel fixes, and launcher enhancements
This commit is contained in:
1 parent
a9ff92e1d1
commit
752f0cc43d
34 files changed
+4170
-181
No files matched your search
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { Search, Plus, Pencil, Trash2, CheckCircle2, XCircle, Award, Sparkles, Filter } from '@lucide/svelte';
|
||||
import Modal from '../components/Modal.svelte';
|
||||
import { get, post, put, del } from '../lib/api';
|
||||
@@ -33,7 +34,19 @@
|
||||
async function loadQuests() {
|
||||
loading = true;
|
||||
try {
|
||||
quests = await get<Quest[]>('/api/admin/quests');
|
||||
const res = await get<any[]>('/api/admin/quests');
|
||||
quests = (res || []).map((q: any) => ({
|
||||
id: q.id || '',
|
||||
title: q.title || '',
|
||||
description: q.description || '',
|
||||
quest_type: q.quest_type || q.period || 'daily',
|
||||
category: q.category || 'mining',
|
||||
xp_reward: q.xp_reward || 0,
|
||||
stat_type: q.stat_type || q.target_stat || 'blocks_broken',
|
||||
target_count: q.target_count || 1,
|
||||
icon: q.icon || '⛏️',
|
||||
active: q.active !== undefined ? q.active : (q.enabled !== undefined ? q.enabled : true),
|
||||
}));
|
||||
} catch (e) {
|
||||
toastError(e);
|
||||
} finally {
|
||||
@@ -41,7 +54,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
$effect(() => {
|
||||
onMount(() => {
|
||||
loadQuests();
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user