summaryrefslogtreecommitdiffstats
path: root/src/js/app.js
blob: f3080324b2372268920513c9dcdbefbeb1c63c9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { load as load_template } from './templates';
import * as network from './network';
import * as apps from './apps';
import * as time from './time';
import Mustache from 'mustache';

var template;
var page = {

};

export function show() {
    document.body.innerHTML = Mustache.render(template, page);
    network.init(document.getElementById('NetworkContainer'));
    apps.init(document.getElementById('AppsContainer'));
    time.init(document.getElementById('TimeContainer'));
}

export function init() {
    load_template('main.template.html').then(function(result) {
        template = result;
        Mustache.parse(template);
        show();
    }, function(error) {
        console.error('ERRROR loading main template', error);
    });
}