feat: replace CLI script with web UI (Joe) for listing outdated applications

This commit is contained in:
Pierre Martin
2024-01-30 00:36:12 +01:00
parent e4a01bb96c
commit 76a8909dc1
13 changed files with 531 additions and 219 deletions

33
ui/Layout.ts Normal file
View File

@@ -0,0 +1,33 @@
export const html = String.raw;
const Layout = (content: string) => {
return html`<html>
<head>
<title>Joe</title>
<link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css" />
<meta charset="utf-8" />
</head>
<body>
<header>
<nav>
<a href="/"><code>/</code></a>
<a href="/applications">Applications</a>
</nav>
</header>
<main>${content}</main>
<script>
// add class "current" to all links matching the current URL
const links = document.querySelectorAll("a");
const currentUrl = window.location.pathname;
links.forEach((link) => {
if (link.getAttribute("href") === currentUrl) {
link.classList.add("current");
}
});
</script>
</body>
</html>`;
};
export default Layout;