support for acticve directory #261

This commit is contained in:
Jan Prochazka
2022-11-25 16:38:17 +01:00
parent 5e4c286427
commit 5ccd724166
5 changed files with 133 additions and 9 deletions

View File

@@ -5,6 +5,7 @@
import FormProvider from './forms/FormProvider.svelte';
import FormSubmit from './forms/FormSubmit.svelte';
import FormTextField from './forms/FormTextField.svelte';
import { apiCall, enableApi } from './utility/api';
onMount(() => {
const removed = document.getElementById('starting_dbgate_zero');
@@ -28,7 +29,8 @@
<FormSubmit
value="Log In"
on:click={e => {
console.log('log in', e);
enableApi();
apiCall('auth/login', e.detail);
}}
/>
</div>
@@ -51,8 +53,10 @@
position: fixed;
top: 1rem;
left: 1rem;
font-size: 40pt;
font-size: 30pt;
font-family: monospace;
color: var(--theme-bg-2);
text-transform: uppercase;
}
.submit {
margin: var(--dim-large-form-margin);
@@ -78,8 +82,10 @@
}
.box {
max-width: 600px;
width: 40vw;
width: 600px;
max-width: 80vw;
/* max-width: 600px;
width: 40vw; */
border: 1px solid var(--theme-border);
border-radius: 4px;
background-color: var(--theme-bg-0);

View File

@@ -16,6 +16,10 @@ export function disableApi() {
apiDisabled = true;
}
export function enableApi() {
apiDisabled = false;
}
function wantEventSource() {
if (!eventSource) {
eventSource = new EventSource(`${resolveApi()}/stream`);