feat: Aufgaben laden und validieren
tasks/<gruppe>/<name>/ wird eingelesen. Pflichtdateien, task.toml-Werte und ausführbares check.sh werden geprüft, fehlerhafte Aufgaben mit Grund gemeldet. Setup zeigt gültige Aufgaben und Fehler. cargo test: 13 Tests grün. Klicktests aufgabe2validierung.1-.2 noch manuell offen. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -8,8 +8,14 @@
|
||||
tasks_dir: string;
|
||||
};
|
||||
|
||||
type TaskInfo = { id: string; title: string; group: string; dir: string };
|
||||
type TaskError = { dir: string; message: string };
|
||||
type LoadReport = { tasks: TaskInfo[]; errors: TaskError[] };
|
||||
|
||||
let paths = $state<Paths | null>(null);
|
||||
let error = $state("");
|
||||
let report = $state<LoadReport | null>(null);
|
||||
let taskError = $state("");
|
||||
|
||||
onMount(async () => {
|
||||
try {
|
||||
@ -17,6 +23,11 @@
|
||||
} catch (e) {
|
||||
error = String(e);
|
||||
}
|
||||
try {
|
||||
report = await invoke<LoadReport>("load_tasks");
|
||||
} catch (e) {
|
||||
taskError = String(e);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -40,6 +51,30 @@
|
||||
<p>Lade Pfade …</p>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Aufgaben</h2>
|
||||
{#if taskError}
|
||||
<p class="fehler">Fehler: {taskError}</p>
|
||||
{:else if report}
|
||||
<p>{report.tasks.length} gültig, {report.errors.length} mit Fehlern.</p>
|
||||
<ul>
|
||||
{#each report.tasks as t (t.dir)}
|
||||
<li><strong>{t.id}</strong> · {t.title} <span class="gruppe">Gruppe {t.group}</span></li>
|
||||
{/each}
|
||||
</ul>
|
||||
{#if report.errors.length > 0}
|
||||
<h3>Fehler</h3>
|
||||
<ul class="fehler">
|
||||
{#each report.errors as e (e.dir)}
|
||||
<li><code>{e.dir}</code>: {e.message}</li>
|
||||
{/each}
|
||||
</ul>
|
||||
{/if}
|
||||
{:else}
|
||||
<p>Lade Aufgaben …</p>
|
||||
{/if}
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user