loading tasks

This commit is contained in:
2025-07-26 22:56:40 +02:00
parent 91aa421ae9
commit 6599b08990
10 changed files with 177 additions and 18 deletions

View File

@@ -1,13 +1,19 @@
<script>
import {onMount} from 'svelte';
import {t} from '../translations.svelte.js';
let { caption = t('select_state'), selected = $bindable(0), onchange = (val) => console.log('changed to '+val)} = $props();
import {api} from '../urls.svelte.js';
let {
caption = t('select_state'),
selected = $bindable(0),
onchange = (val) => console.log('changed to '+val),
project_id = '?'
} = $props();
let message = $state(t('loading'));
let states = $state(null);
async function loadStates(){
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/task/states`;
const url = api(`project/${project_id}/states`);
var resp = await fetch(url,{credentials: 'include'});
if (resp.ok){
states = await resp.json();