This commit is contained in:
2023-10-05 13:03:17 +03:00
parent 718cdb54f9
commit e037f770e5
9 changed files with 280 additions and 236 deletions
+1 -8
View File
@@ -7,14 +7,7 @@
const channel = getContext("channel");
const user = getContext("user");
function buildWebsite(e) {
e.preventDefault();
axios.post(channel.lucentUrl + "/build").then(response => {
window.location.href = channel.lucentUrl + "/build-report"
})
}
</script>
<nav class="lx-nav">
@@ -27,7 +20,7 @@
<a class="nav-item" href="{channel.lucentUrl}/members">Members</a>
{#if channel.generateCommand}
<button on:click={buildWebsite} class="btn btn-outline-primary btn-sm">Build website</button>
<a href="{channel.lucentUrl}/build-report" class="btn btn-outline-primary btn-sm">Build website</a>
{/if}
</div>
<div>
+25 -11
View File
@@ -8,25 +8,39 @@
const channel = getContext("channel");
export let title;
$: output = "";
const eventSource = new EventSource(channel.lucentUrl + "/build-report-source");
$: date = "";
$: logs = "";
function buildWebsite(e) {
e.preventDefault();
axios.post(channel.lucentUrl + "/build").then(response => {
const eventSource = new EventSource(channel.lucentUrl + "/build-report-source");
eventSource.onmessage = function(event) {
const data = JSON.parse(event.data);
date = data.date;
logs = data.logs;
}
eventSource.onerror = (e)=>{
console.log(e)
}
})
console.log("heklko")
eventSource.onmessage = function(event) {
const data = JSON.parse(event.data);
console.log(data)
output = output + "message: " + data.time;
}
eventSource.onerror = (e)=>{
console.log(e)
}
</script>
<div class="wrapper-tiny transparent mb-5">
<div class="lx-card mt-5">
<h3 class="header-small mb-5">{title}</h3>
{output}
<button on:click={buildWebsite} class="btn btn-outline-primary btn-sm mb-3">Start Build</button>
<div class="mb-3">{date}</div>
<pre>{logs}</pre>
</div>
</div>