diff --git a/scripts/timezone.js b/scripts/timezone.js new file mode 100644 index 0000000..369ea9e --- /dev/null +++ b/scripts/timezone.js @@ -0,0 +1,12 @@ +window.formatTime = function (timeStr) { + const date = new Date(timeStr); + return date.toLocaleString(); +} + +document.addEventListener('DOMContentLoaded', function () { + const elements = document.getElementsByClassName('to-local-time'); + for (let element of elements) { + const innerText = element.innerText; + element.replaceChild(document.createTextNode(window.formatTime(innerText)), element.firstChild); + } +}); \ No newline at end of file diff --git a/src/DB.ts b/src/DB.ts index 2c38067..67e5090 100644 --- a/src/DB.ts +++ b/src/DB.ts @@ -134,12 +134,13 @@ class DB { await this.logChunk.sync(); } - public async createBuild(repo: string, commit: string, patch: string, distro: string): Promise { + public async createBuild(repo: string, commit: string, patch: string, distro: string, dependencies: string): Promise { const buildRec = await this.build.create({ repo, commit: commit || null, patch: patch || null, - distro + distro, + dependencies }); return buildRec.id; } diff --git a/src/Web.ts b/src/Web.ts index 4676ea9..2651d76 100644 --- a/src/Web.ts +++ b/src/Web.ts @@ -77,7 +77,13 @@ class Web { }); app.post('/build/?', async (req, res) => { - const buildId = await this.db.createBuild(req.body.repo, req.body.commit || null, req.body.patch || null, req.body.distro); + const buildId = await this.db.createBuild( + req.body.repo, + req.body.commit || null, + req.body.patch || null, + req.body.distro || 'arch', + req.body.dependencies || 'stable' + ); res.redirect(`/build/${buildId}`); this.buildController.triggerBuild(); }); diff --git a/views/build-new.ejs b/views/build-new.ejs index 106e37c..17b7761 100644 --- a/views/build-new.ejs +++ b/views/build-new.ejs @@ -18,6 +18,12 @@ + +
diff --git a/views/build.ejs b/views/build.ejs index 9ce7364..f349149 100644 --- a/views/build.ejs +++ b/views/build.ejs @@ -16,7 +16,7 @@ <% if (build.patch) { %>patch file<% } else { %>none<% } %> <%= build.distro %> <%= build.dependencies %> - <%= build.startTime %> + <%= build.startTime %>

Full logs

@@ -32,6 +32,7 @@ <% } %>
<%- include("footer", locals) %> + <% if (!ended) { %> <% } %> diff --git a/views/index.ejs b/views/index.ejs index 4f7ae55..a0b274d 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -21,7 +21,7 @@ <%= build.repo %> <%= build.distro %> - <%= build.startTime %> + <%= build.startTime %> TODO <%= build.status %> @@ -29,5 +29,6 @@ <%- include("footer", locals) %> +