arcast/pkg/server/apps/home/app.js

19 lines
652 B
JavaScript

fetch('/api/v1/apps')
.then(res => res.json())
.then(res => {
const defaultApp = res.data.defaultApp
const apps = res.data.apps
const container = document.createElement("div")
container.className = "container"
apps.forEach(app => {
if (app.id === defaultApp) return
const appLink = document.createElement("a")
appLink.className = "app-link"
appLink.href = "/apps/" + app.id
appLink.innerText = app.title['fr']
container.appendChild(appLink)
})
document.getElementById("main").replaceWith(container);
})