mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-26 07:13:41 +01:00
Adds more tests
This commit is contained in:
@@ -123,17 +123,20 @@ import {
|
||||
setTitle("Settings");
|
||||
|
||||
const currentVersion = config.version;
|
||||
const nextRelease = ref(null);
|
||||
const nextRelease = ref({ html_url: "", name: "" });
|
||||
const hasUpdate = ref(false);
|
||||
|
||||
async function fetchNextRelease() {
|
||||
const releases = await (await fetch("https://api.github.com/repos/amir20/dozzle/releases")).json();
|
||||
if (!["dev", "master"].includes(currentVersion)) {
|
||||
hasUpdate.value = gt(releases[0].tag_name, currentVersion);
|
||||
const response = await fetch("https://api.github.com/repos/dozzle/dozzle/releases/latest");
|
||||
if (response.ok) {
|
||||
const releases = await response.json();
|
||||
hasUpdate.value = gt(releases[0].tag_name, currentVersion);
|
||||
nextRelease.value = releases[0];
|
||||
}
|
||||
} else {
|
||||
hasUpdate.value = true;
|
||||
}
|
||||
nextRelease.value = releases[0];
|
||||
}
|
||||
|
||||
fetchNextRelease();
|
||||
|
||||
@@ -67,9 +67,9 @@ data: end of stream
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
Content-Security-Policy: default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self'; manifest-src 'self'; connect-src 'self' api.github.com;
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
Content-Type: text/html
|
||||
|
||||
dev
|
||||
<pre>dev</pre>
|
||||
|
||||
/* snapshot: Test_handler_streamEvents_error */
|
||||
HTTP/1.1 200 OK
|
||||
|
||||
@@ -129,5 +129,6 @@ func (h *handler) executeTemplate(w http.ResponseWriter, req *http.Request) {
|
||||
}
|
||||
|
||||
func (h *handler) version(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintf(w, "%v", h.config.Version)
|
||||
w.Header().Add("Content-Type", "text/html")
|
||||
fmt.Fprintf(w, "<pre>%v</pre>", h.config.Version)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user