build fixes
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
import {getContext} from "svelte";
|
import {getContext, onMount} from "svelte";
|
||||||
import SpinnerButton from "../common/SpinnerButton.svelte";
|
import SpinnerButton from "../common/SpinnerButton.svelte";
|
||||||
import ErrorAlert from "../common/ErrorAlert.svelte";
|
import ErrorAlert from "../common/ErrorAlert.svelte";
|
||||||
import MemberSettingsCard from "../members/MemberSettingsCard.svelte";
|
import MemberSettingsCard from "../members/MemberSettingsCard.svelte";
|
||||||
@@ -10,26 +10,39 @@
|
|||||||
export let title;
|
export let title;
|
||||||
$: date = "";
|
$: date = "";
|
||||||
$: logs = "";
|
$: logs = "";
|
||||||
|
let inProgress = false;
|
||||||
|
|
||||||
|
function connect() {
|
||||||
function buildWebsite(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
axios.post(channel.lucentUrl + "/build").then(response => {
|
|
||||||
const eventSource = new EventSource(channel.lucentUrl + "/build-report-source");
|
const eventSource = new EventSource(channel.lucentUrl + "/build-report-source");
|
||||||
|
|
||||||
eventSource.onmessage = function (event) {
|
eventSource.onmessage = function (event) {
|
||||||
|
inProgress = true;
|
||||||
const data = JSON.parse(event.data);
|
const data = JSON.parse(event.data);
|
||||||
date = data.date;
|
date = data.date;
|
||||||
logs = data.logs;
|
logs = data.logs;
|
||||||
|
|
||||||
}
|
}
|
||||||
eventSource.onerror = (e) => {
|
eventSource.onerror = (e) => {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
|
eventSource.close();
|
||||||
|
inProgress = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildWebsite(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
inProgress = true;
|
||||||
|
|
||||||
|
axios.post(channel.lucentUrl + "/build").then(response => {
|
||||||
|
connect()
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
connect()
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="wrapper-tiny transparent mb-5">
|
<div class="wrapper-tiny transparent mb-5">
|
||||||
@@ -37,9 +50,26 @@
|
|||||||
|
|
||||||
<h3 class="header-small mb-5">{title}</h3>
|
<h3 class="header-small mb-5">{title}</h3>
|
||||||
|
|
||||||
<button on:click={buildWebsite} class="btn btn-outline-primary btn-sm mb-3">Start Build</button>
|
<button on:click={buildWebsite} class="btn btn-outline-primary btn-sm mb-3" disabled={inProgress}>Start Build
|
||||||
|
</button>
|
||||||
|
|
||||||
<div class="mb-3">{date}</div>
|
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
{#if inProgress}
|
||||||
|
<span class="badge text-bg-warning">
|
||||||
|
Build in progress
|
||||||
|
</span>
|
||||||
|
{/if}
|
||||||
|
{#if !inProgress && logs}
|
||||||
|
<span class="badge text-bg-info">
|
||||||
|
Build completed at
|
||||||
|
</span>
|
||||||
|
{/if}
|
||||||
|
<span class="badge text-bg-light"> {date}</span>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<pre>{logs}</pre>
|
<pre>{logs}</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -93,9 +93,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
|
|
||||||
class="me-2 text-decoration-none text-dark fs-6"
|
class="me-2 text-decoration-none text-dark fs-6"
|
||||||
href="{channel.lucentUrl}/records/{record.id}"
|
href="{channel.lucentUrl}/records/{record.id}"
|
||||||
target={inModal ? "_blank" : "_self"}
|
target={inModal ? "_blank" : "_self"}
|
||||||
|
title={previewTitle(channel.schemas, record, graph)}
|
||||||
|
data-bs-toggle="tooltip" data-bs-placement="left"
|
||||||
|
|
||||||
>
|
>
|
||||||
{previewTitle(channel.schemas, record, graph)}
|
{previewTitle(channel.schemas, record, graph)}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user