- Fix symlinks % bug
- A cleaner settings page - More bug fixes
This commit is contained in:
@@ -197,8 +197,8 @@
|
||||
{{ template "config" . }}
|
||||
{{ else if eq .Page "login" }}
|
||||
{{ template "login" . }}
|
||||
{{ else if eq .Page "auth" }}
|
||||
{{ template "auth" . }}
|
||||
{{ else if eq .Page "register" }}
|
||||
{{ template "register" . }}
|
||||
{{ else }}
|
||||
{{ end }}
|
||||
|
||||
@@ -206,6 +206,30 @@
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
|
||||
<script>
|
||||
|
||||
window.urlBase = "{{.URLBase}}";
|
||||
|
||||
function joinUrl (base, path) {
|
||||
if (path.substring(0, 1) === "/") {
|
||||
// path starts with `/`. Thus it is absolute.
|
||||
return path;
|
||||
}
|
||||
if (base.substring(base.length-1) === "/") {
|
||||
// base ends with `/`
|
||||
return base + path;
|
||||
}
|
||||
return base + "/" + path;
|
||||
}
|
||||
|
||||
function fetcher(endpoint, options = {}) {
|
||||
// Use the global urlBase or default to empty string
|
||||
let baseUrl = window.urlBase || '';
|
||||
|
||||
let url = joinUrl(baseUrl, endpoint);
|
||||
|
||||
// Return the regular fetcher with the complete URL
|
||||
return fetch(url, options);
|
||||
}
|
||||
/**
|
||||
* Create a toast message
|
||||
* @param {string} message - The message to display
|
||||
@@ -243,6 +267,7 @@
|
||||
const toast = new bootstrap.Toast(toastElement, {
|
||||
autohide: true,
|
||||
delay: toastTimeouts[type]
|
||||
|
||||
});
|
||||
|
||||
toast.show();
|
||||
@@ -302,7 +327,7 @@
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
fetch('/internal/version')
|
||||
fetcher('/version')
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
const versionBadge = document.getElementById('version-badge');
|
||||
|
||||
Reference in New Issue
Block a user