feat: replace CLI script with web UI (Joe) for listing outdated applications
This commit is contained in:
33
ui/Layout.ts
Normal file
33
ui/Layout.ts
Normal 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;
|
||||
Reference in New Issue
Block a user