Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 9e69bca

Browse files
committed
webui: Remove local.js file
This removes the local.js file by moving the last function it contains to the two pages that still use it.
1 parent 9e3c71e commit 9e69bca

File tree

5 files changed

+28
-22
lines changed

5 files changed

+28
-22
lines changed

webui/js/local.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

webui/main.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3341,10 +3341,6 @@ func main() {
33413341
http.ServeFile(w, r, filepath.Join(com.Conf.Web.BaseDir, "webui", "js", "dbhub.js"))
33423342
})))
33433343

3344-
http.Handle("/js/local.js", gz.GzipHandler(logReq(func(w http.ResponseWriter, r *http.Request) {
3345-
http.ServeFile(w, r, filepath.Join(com.Conf.Web.BaseDir, "webui", "js", "local.js"))
3346-
})))
3347-
33483344
http.Handle("/js/plotly-basic-2.18.2.min.js", gz.GzipHandler(logReq(func(w http.ResponseWriter, r *http.Request) {
33493345
http.ServeFile(w, r, filepath.Join(com.Conf.Web.BaseDir, "webui", "js", "plotly-basic-2.18.2.min.js"))
33503346
})))

webui/templates/execute.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,20 @@ <h4 style="color: {{ statusMessageColour }};" data-cy="statusmsg">&nbsp;{{ statu
8181
[[ template "script_db_header" . ]]
8282
[[ template "footer" . ]]
8383
<script>
84+
// Construct a timestamp string for use in user messages
85+
function nowString() {
86+
const now = new Date();
87+
let mins = now.getMinutes();
88+
let secs = now.getSeconds();
89+
if (mins < 10) {
90+
mins = "0" + mins;
91+
}
92+
if (secs < 10) {
93+
secs = "0" + secs;
94+
}
95+
return "[" + now.getHours() + ":" + mins + ":" + secs + "] ";
96+
}
97+
8498
// Pre-filled table row data
8599
let dataReceived = false;
86100

webui/templates/head.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<link rel="stylesheet" href="/css/font-awesome-4.7.0.min.css" integrity="sha384-dNpIIXE8U05kAbPhy3G1cz+yZmTzA6CY8Vg/u2L9xRnHjJiAK76m2BIEaSEV+/aU" crossorigin="anonymous">
1212
<link href="/css/local.css" rel="stylesheet">
1313
<script src="//cdn.auth0.com/js/lock/11.35.0/lock.min.js"></script>
14-
<script src="/js/local.js" type="application/javascript"></script>
1514
[[ if eq .PageMeta.Environment "production" ]]
1615
<script type="application/javascript">
1716
// Only invoke the Auth0 pieces in the production environment

webui/templates/visualise.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,20 @@ <h4 style="color: {{ statusMessageColour }};" data-cy="statusmsg">&nbsp;{{ statu
195195
[[ template "script_db_header" . ]]
196196
[[ template "footer" . ]]
197197
<script>
198+
// Construct a timestamp string for use in user messages
199+
function nowString() {
200+
const now = new Date();
201+
let mins = now.getMinutes();
202+
let secs = now.getSeconds();
203+
if (mins < 10) {
204+
mins = "0" + mins;
205+
}
206+
if (secs < 10) {
207+
secs = "0" + secs;
208+
}
209+
return "[" + now.getHours() + ":" + mins + ":" + secs + "] ";
210+
}
211+
198212
// Pre-filled table row data
199213
let chartData = {
200214
XAxisLabel: "",

0 commit comments

Comments
 (0)