garm/webapp/assets/index.html
Gabriel Adrian Samfira 5fdb69ac18 Add the ability to set tools download source (Gitea)
This change adds 2 new options to gitea forge endpoints:

* Tools metadata URL
* Use internal tools URLs

By default, GARM looks in the releases page of the gitea arc_runner
to determine where it can download the runner binary from for a particular
OS/arch. The tools metadata URL option can be set on an endpoint and can point
to a mirror of the upstream repo. The requirement is that the asset names
exactly mirror upstream naming conventions.

The second option disables GARM calling out to the tools metadata URL entirely.
GARM has some hardcoded values for nightly binaries. If this option is checked,
GARM will use those values, without making any kind of outgoing API call to
determine availability. This is useful in air-gapped environments.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-09-26 18:59:15 +03:00

105 lines
3.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- Light theme icon -->
<link rel="icon" href="/ui/favicon-light.png" media="(prefers-color-scheme: light)" id="favicon-light" />
<!-- Dark theme icon -->
<link rel="icon" href="/ui/favicon-dark.png" media="(prefers-color-scheme: dark)" id="favicon-dark" />
<!-- Fallback favicon -->
<link rel="icon" href="/ui/favicon-light.png" id="favicon-fallback" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script>
// Theme management - apply system theme or saved preference
(function() {
function applyTheme() {
const savedTheme = localStorage.getItem('theme');
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
// Determine if we should use dark mode
const useDarkMode = savedTheme === 'dark' ||
(!savedTheme && prefersDark) ||
(savedTheme === 'system' && prefersDark);
// Apply the theme class to document
if (useDarkMode) {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
}
}
function updateFavicon() {
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
const savedTheme = localStorage.getItem('theme');
const useDarkMode = savedTheme === 'dark' ||
(!savedTheme && prefersDark) ||
(savedTheme === 'system' && prefersDark);
const fallbackIcon = document.getElementById('favicon-fallback');
if (useDarkMode) {
fallbackIcon.href = '/ui/favicon-dark.png';
} else {
fallbackIcon.href = '/ui/favicon-light.png';
}
}
// Apply theme and favicon on load
applyTheme();
updateFavicon();
// Listen for system theme changes
if (window.matchMedia) {
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
const handleChange = function(e) {
const savedTheme = localStorage.getItem('theme');
// Only update if using system theme (no saved preference or explicit 'system')
if (!savedTheme || savedTheme === 'system') {
applyTheme();
updateFavicon();
}
};
// Modern browsers
if (mediaQuery.addEventListener) {
mediaQuery.addEventListener('change', handleChange);
} else {
// Older browsers
mediaQuery.addListener(handleChange);
}
}
})();
</script>
<link rel="modulepreload" href="/ui/_app/immutable/entry/start.CDo6YuQR.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/HMJxCnAR.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/DniTuB_0.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/CGAsTaG2.js">
<link rel="modulepreload" href="/ui/_app/immutable/entry/app.G6LK5zv-.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/DsnmJJEf.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/DbNhg6mG.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/BZLWIdPw.js">
<link rel="modulepreload" href="/ui/_app/immutable/chunks/C-xTH-sp.js">
</head>
<body data-sveltekit-preload-data="hover" class="bg-gray-100 dark:bg-gray-900">
<div style="display: contents">
<script>
{
__sveltekit_1odpo7n = {
base: "/ui",
assets: "/ui"
};
const element = document.currentScript.parentElement;
Promise.all([
import("/ui/_app/immutable/entry/start.CDo6YuQR.js"),
import("/ui/_app/immutable/entry/app.G6LK5zv-.js")
]).then(([kit, app]) => {
kit.start(app, element);
});
}
</script>
</div>
</body>
</html>