commit
db5353914d
3 changed files with 17 additions and 49 deletions
|
@ -228,6 +228,8 @@ table a{
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.apps_text a{
|
||||
|
|
|
@ -1,50 +1,16 @@
|
|||
var data_links = "links.json";
|
||||
var bookmarks = JSON.parse(localStorage.getItem("links"));
|
||||
|
||||
function handleLinks(data) {
|
||||
var mysource = document.getElementById("links-template").innerHTML;
|
||||
var mytemplate = Handlebars.compile(mysource);
|
||||
var myresult = mytemplate(data)
|
||||
document.getElementById("links").innerHTML = myresult;
|
||||
function fetchAndRender (name) {
|
||||
fetch(name + '.json')
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
const mysource = document.getElementById(name + '-template').innerHTML;
|
||||
const mytemplate = Handlebars.compile(mysource);
|
||||
const myresult = mytemplate(data);
|
||||
document.getElementById(name).innerHTML = myresult;
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
if (!bookmarks) {
|
||||
fetch(data_links)
|
||||
.then(response => response.json())
|
||||
.then(function (data) {
|
||||
handleLinks(data);
|
||||
localStorage.setItem("links", JSON.stringify(data));
|
||||
});
|
||||
} else {
|
||||
handleLinks(bookmarks);
|
||||
}
|
||||
});
|
||||
|
||||
var data_apps = "apps.json";
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
fetch(data_apps)
|
||||
.then( response => response.json())
|
||||
.then(
|
||||
function (data) {
|
||||
var mysource = document.getElementById("apps-template").innerHTML;
|
||||
var mytemplate = Handlebars.compile(mysource);
|
||||
var myresult = mytemplate(data)
|
||||
document.getElementById("apps").innerHTML = myresult;
|
||||
});
|
||||
});
|
||||
|
||||
var data_providers = "providers.json";
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
fetch(data_providers)
|
||||
.then( response => response.json())
|
||||
.then(
|
||||
function (data) {
|
||||
var mysource = document.getElementById("providers-template").innerHTML;
|
||||
var mytemplate = Handlebars.compile(mysource);
|
||||
var myresult = mytemplate(data)
|
||||
document.getElementById("providers").innerHTML = myresult;
|
||||
});
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
fetchAndRender('apps');
|
||||
fetchAndRender('links');
|
||||
fetchAndRender('providers');
|
||||
});
|
|
@ -14,7 +14,7 @@ services:
|
|||
ports:
|
||||
- 4000:80
|
||||
volumes:
|
||||
- ./:/usr/share/nginx/html
|
||||
- ./:/opt/html
|
||||
|
||||
networks:
|
||||
nginx-proxy:
|
||||
|
|
Loading…
Reference in a new issue