loading tasks
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user