import Mustache from 'mustache';
var configjson = require('../config.json');
var host = document.location.hostname;
var port = document.location.port;
var args = new URLSearchParams(document.location.search.substring(1));
var token = args.get("x-afb-token") || args.get("token") || "HELLO";
var afb;
var template;
function log(smgs) {
document.getElementById('log').innerHTML += '
'+smgs+'
';
}
function show_app(app) {
document.getElementById("app-"+app.id).style["display"]="block";
}
function display_icon(app) {
return new Promise(function(resolve, reject) {
var iconInactiveURL = '/images/icons/'+app.name.toLowerCase()+'_inactive.svg';
var iconActiveURL = '/images/icons/'+app.name.toLowerCase()+'_active.svg';
var image = new Image();
image.onload = function() {
document.getElementById("icon-inactive-"+app.id).src = iconInactiveURL;
document.getElementById("icon-enabled-"+app.id).src = iconActiveURL;
resolve();
}
image.onerror = function(){
resolve();
}
image.src = iconInactiveURL;
});
}
function render_applications(apps) {
var appContainer = document.getElementById('AppContainer');
for( var i=0; i