12 changed files with 82 additions and 8 deletions
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
description = "Umbrella : Documents" |
||||
|
||||
dependencies{ |
||||
implementation(project(":core")) |
||||
} |
||||
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
/* © SRSoftware 2025 */ |
||||
package de.srsoftware.umbrella.documents; |
||||
|
||||
public class Constants { |
||||
private Constants(){} |
||||
|
||||
public static final String COMPANIES = "companies"; |
||||
} |
||||
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
/* © SRSoftware 2025 */ |
||||
package de.srsoftware.umbrella.documents; |
||||
|
||||
import static de.srsoftware.umbrella.core.ResponseCode.HTTP_NOT_IMPLEMENTED; |
||||
import static de.srsoftware.umbrella.documents.Constants.COMPANIES; |
||||
|
||||
import com.sun.net.httpserver.HttpExchange; |
||||
import de.srsoftware.tools.Path; |
||||
import de.srsoftware.umbrella.core.BaseHandler; |
||||
import java.io.IOException; |
||||
|
||||
public class DocumentApi extends BaseHandler { |
||||
@Override |
||||
public boolean doGet(Path path, HttpExchange ex) throws IOException { |
||||
addCors(ex); |
||||
var head = path.pop(); |
||||
return switch (head){ |
||||
case COMPANIES -> getCompanies(ex); |
||||
case null, default -> super.doGet(path,ex); |
||||
}; |
||||
} |
||||
|
||||
private boolean getCompanies(HttpExchange ex) throws IOException { |
||||
return sendEmptyResponse(HTTP_NOT_IMPLEMENTED,ex); |
||||
} |
||||
} |
||||
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
<script> |
||||
import { onMount } from 'svelte'; |
||||
import { t } from '../../translations.svelte.js'; |
||||
|
||||
let company = null; |
||||
let error = null; |
||||
|
||||
async function loadCompanies(){ |
||||
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/document/companies`; |
||||
var resp = await fetch(url,{ credentials: 'include'}); |
||||
if (resp.ok){ |
||||
} else { |
||||
error = await resp.text(); |
||||
} |
||||
} |
||||
|
||||
onMount(loadCompanies); |
||||
</script> |
||||
|
||||
<fieldset> |
||||
<legend>{t('documents.documents')}</legend> |
||||
{#if error} |
||||
<div class="error">{error}</div> |
||||
{/if} |
||||
<div> |
||||
{t('documents.select_company')} |
||||
|
||||
</div> |
||||
</fieldset> |
||||
Loading…
Reference in new issue